org.robokind.api.common.lifecycle.config
Class GenericLifecycle<T>
java.lang.Object
org.robokind.api.common.property.PropertyChangeNotifier
org.robokind.api.common.lifecycle.AbstractLifecycleProvider<T,T>
org.robokind.api.common.lifecycle.config.GenericLifecycle<T>
- All Implemented Interfaces:
- ServiceLifecycleProvider<T>, PropertyChangeSource
public class GenericLifecycle<T>
- extends AbstractLifecycleProvider<T,T>
- Author:
- Matthew Stevenson
Methods inherited from class org.robokind.api.common.property.PropertyChangeNotifier |
addPropertyChangeListener, addPropertyChangeListener, clearAllListeners, clearListeners, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GenericLifecycle
public GenericLifecycle(String[] serviceClassNames,
List<DependencyDescriptor> deps,
Properties props,
org.jflux.api.core.Adapter<Map<String,Object>,T> serviceFactory,
org.jflux.api.core.Adapter<String,org.jflux.api.core.Listener<GenericLifecycle.DependencyChange>> changeListeners,
org.jflux.api.core.Listener<T> stopListener)
create
protected T create(Map<String,Object> dependencies)
- Description copied from class:
AbstractLifecycleProvider
- Called when all dependencies are available. This should create and
return the service for this lifecycle.
- Specified by:
create
in class AbstractLifecycleProvider<T,T>
- Parameters:
dependencies
- validated map of the lifecycle's dependencies
- Returns:
- the service managed by this lifecycle, null if the service
cannot be created
handleChange
protected void handleChange(String name,
Object dependency,
Map<String,Object> availableDependencies)
- Description copied from class:
AbstractLifecycleProvider
- Called from
dependencyChanged
with validated values.
- Specified by:
handleChange
in class AbstractLifecycleProvider<T,T>
- Parameters:
name
- name of the dependency changeddependency
- new dependency value, null if it was removedavailableDependencies
- a map of all available dependencies and
their names
stop
public void stop()
- Specified by:
stop
in interface ServiceLifecycleProvider<T>
- Overrides:
stop
in class AbstractLifecycleProvider<T,T>
getServiceClass
public Class<T> getServiceClass()
- Description copied from class:
AbstractLifecycleProvider
- Returns the Class of the service managed by this lifecycle provider.
- Specified by:
getServiceClass
in class AbstractLifecycleProvider<T,T>
- Returns:
- Class of the service managed by this lifecycle provider
Copyright © 2011-2013. All Rights Reserved.