|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
T - type of service managed by this lifecycle providerpublic interface ServiceLifecycleProvider<T>
Manages the state and availability of a service through a Dependency-
Injection pattern.
A ServiceLifecycleProvider defines the service dependencies as a List of
ServiceDependencyDescriptors, which provide a unique String key, dependency
class, and dependency filter string.
When all of the dependencies are available, the service lifecycle will be
started with a call to the start method. This should create
the service and make it available through the getService method.
Once the service is started, if a dependency is changed or removed,
dependencyChanged will be called with the new dependency.
| Nested Class Summary | |
|---|---|
static class |
ServiceLifecycleProvider.Validator
The Validator is used validate a dependencyId and dependency against a list of DependencyDescriptors. |
| Method Summary | |
|---|---|
void |
dependencyChanged(String dependencyId,
Object dependency)
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. |
Class<T> |
getServiceClass()
Returns the Class of the service managed by this lifecycle provider. |
void |
start(Map<String,Object> dependencyMap)
Called the first time all dependencies are available. |
| Method Detail |
|---|
void start(Map<String,Object> dependencyMap)
dependencyMap - dependencies needed to start the service lifecycle
void dependencyChanged(String dependencyId,
Object dependency)
dependencyId - dependency id defined in the
DependencyDescriptordependency - the new dependency, or null if the dependency is no
longer available.T getService()
List<DependencyDescriptor> getDependencyDescriptors()
Properties getRegistrationProperties()
Class<T> getServiceClass()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||