|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.robokind.api.common.osgi.lifecycle.AbstractLifecycleProvider<I,T>
I - Interface or Base Class of the service managed by this lifecycleT - actual type of the service managedpublic abstract class AbstractLifecycleProvider<I,T extends I>
Abstract implementation of ServiceLifecycleProvider. Automatically validates dependencies against the descriptors provided at creation.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.robokind.api.common.osgi.lifecycle.ServiceLifecycleProvider |
|---|
ServiceLifecycleProvider.Validator |
| Field Summary | |
|---|---|
protected Properties |
myRegistrationProperties
OSGi registration properties |
protected T |
myService
Instance of the service being managed |
| Constructor Summary | |
|---|---|
AbstractLifecycleProvider(List<DependencyDescriptor> deps)
Creates a new AbstractLifecycleProvider with the given DependencyDescriptors. |
|
| Method Summary | |
|---|---|
protected abstract T |
create(Map<String,Object> dependencies)
Called when all dependencies are available. |
void |
dependencyChanged(String serviceId,
Object service)
Called after the service is started and a dependency is changed or removed. |
List<DependencyDescriptor> |
getDependencyDescriptors()
Returns a list describing the service dependencies required by this lifecycle provider. |
Properties |
getRegistrationProperties()
Returns the properties to be used when register the service managed by this lifecycle provider. |
T |
getService()
Returns the service managed by this lifecycle provider. |
protected abstract void |
handleChange(String dependencyId,
Object service)
Called from dependencyChanged with validated values. |
void |
start(Map<String,Object> dependencies)
Called the first time all dependencies are available. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.robokind.api.common.osgi.lifecycle.ServiceLifecycleProvider |
|---|
getServiceClass |
| Field Detail |
|---|
protected T extends I myService
protected Properties myRegistrationProperties
| Constructor Detail |
|---|
public AbstractLifecycleProvider(List<DependencyDescriptor> deps)
deps - descriptors of the dependencies for this lifecycle| Method Detail |
|---|
public void start(Map<String,Object> dependencies)
ServiceLifecycleProvider
start in interface ServiceLifecycleProvider<I>dependencies - dependencies needed to start the service lifecycleprotected abstract T create(Map<String,Object> dependencies)
dependencies - validated map of the lifecycle's dependencies
public T getService()
ServiceLifecycleProvider
getService in interface ServiceLifecycleProvider<I>public Properties getRegistrationProperties()
ServiceLifecycleProvider
getRegistrationProperties in interface ServiceLifecycleProvider<I>public List<DependencyDescriptor> getDependencyDescriptors()
ServiceLifecycleProvider
getDependencyDescriptors in interface ServiceLifecycleProvider<I>
public void dependencyChanged(String serviceId,
Object service)
ServiceLifecycleProvider
dependencyChanged in interface ServiceLifecycleProvider<I>serviceId - dependency id defined in the
DependencyDescriptorservice - the new dependency, or null if the dependency is no
longer available.
protected abstract void handleChange(String dependencyId,
Object service)
dependencyChanged with validated values.
dependencyId - id of the dependency changedservice - new dependency, null if the dependency was removed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||