public abstract class AbstractRegistry extends Object implements BundleActivator, BundleRegistry
BundleActivator.State| Constructor and Description |
|---|
AbstractRegistry()
Creates a new registry.
|
| Modifier and Type | Method and Description |
|---|---|
BundleActivator.State |
getCurrentState()
Gets the current state of the registry.
|
<T> T |
getService(Class<T> service)
Gets the instance of the given service.
|
void |
initialize()
Initializes the bundle.
|
void |
link()
Prepares the bundle.
|
protected abstract BundleActivator[] |
loadBundles()
Gets the loaded bundles.
|
<T> void |
register(Class<T> service,
T implementation)
Registers a service implementation.
|
void |
reset()
Stops the registry and all its environment and prepare it to be restarted.
|
void |
start()
Starts the bundle.
|
void |
stop()
Stops the bundle.
|
public BundleActivator.State getCurrentState()
BundleRegistrygetCurrentState in interface BundleRegistryBundleActivator.State@Nullable public <T> T getService(Class<T> service)
ServiceProvidergetService in interface ServiceProviderT - the service type.service - the service.public void initialize()
BundleActivator
Initializes and registers bundle services in the BundleRegistry instance.
initialize in interface BundleActivatorServiceRegistry.register(Class, Object)public void link()
BundleActivatorLinks bundle services to other services.
link in interface BundleActivatorServiceProvider.getService(Class)protected abstract BundleActivator[] loadBundles()
public <T> void register(Class<T> service, T implementation)
ServiceRegistry
The given instance is returned each time the service is requested by ServiceProvider.getService(Class).
register in interface ServiceRegistryT - the service type.service - the implemented service.implementation - the service implementation.public void reset()
BundleRegistryreset in interface BundleRegistrypublic void start()
BundleActivatorAt this step, all the bundles are prepared and ready. The services could be started.
start in interface BundleActivatorpublic void stop()
BundleActivatorUnlinks it from the others services and clean possible resources and threads.
stop in interface BundleActivator