public class ConfigurationHandler extends PrimitiveHandler implements org.osgi.service.cm.ManagedService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MANAGED_SERVICE_PID |
HANDLER_TYPE
HANDLER_LEVEL_PROPERTY, HANDLER_NAME_PROPERTY, HANDLER_NAMESPACE_PROPERTY, HANDLER_TYPE_PROPERTY, m_instance, m_isValid
Constructor and Description |
---|
ConfigurationHandler() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(ConfigurationListener listener)
Add the given listener to the configuration handler's list of listeners.
|
protected void |
addProperty(Property prop)
Adds the given property metadata to the property metadata list.
|
void |
configure(org.apache.felix.ipojo.metadata.Element metadata,
java.util.Dictionary configuration)
Configures the handler.
|
HandlerDescription |
getDescription()
Gets the configuration handler description.
|
void |
initializeComponentFactory(ComponentTypeDescription desc,
org.apache.felix.ipojo.metadata.Element metadata)
Initialize the component type.
|
void |
onCreation(java.lang.Object instance)
Handler createInstance method.
|
void |
reconfigure(java.util.Dictionary configuration)
Reconfigure the component instance.
|
java.lang.Object |
reconfigureProperty(Property prop,
java.lang.Object value)
Reconfigures the given property with the given value.
|
void |
removeListener(ConfigurationListener listener)
Remove the given listener from the configuration handler's list of listeners.
|
void |
start()
Start method.
|
void |
stateChanged(int state)
This method is called when the component state changed.
|
void |
stop()
Stop method.
|
void |
updated(java.util.Dictionary conf)
Managed Service method.
|
attach, getConstructorParameter, getConstructorParameterType, getFactory, getHandler, getInstanceManager, getLogger, getPojoMetadata, onEntry, onError, onExit, onFinally, onGet, onSet, setFactory
debug, error, error, getHandlerManager, getValidity, info, isValid, setValidity, warn, warn
public static final java.lang.String MANAGED_SERVICE_PID
public void initializeComponentFactory(ComponentTypeDescription desc, org.apache.felix.ipojo.metadata.Element metadata) throws ConfigurationException
initializeComponentFactory
in class Handler
desc
- : component type description to populate.metadata
- : component type metadata.ConfigurationException
- : metadata are incorrect.Handler.initializeComponentFactory(org.apache.felix.ipojo.architecture.ComponentTypeDescription, org.apache.felix.ipojo.metadata.Element)
public void configure(org.apache.felix.ipojo.metadata.Element metadata, java.util.Dictionary configuration) throws ConfigurationException
configure
in class Handler
metadata
- the metadata of the componentconfiguration
- the instance configurationConfigurationException
- one property metadata is not correctHandler.configure(org.apache.felix.ipojo.metadata.Element, java.util.Dictionary)
public void stop()
stop
in class Handler
Handler.stop()
public void start()
start
in class Handler
Handler.start()
protected void addProperty(Property prop)
prop
- : property metadata to addpublic void reconfigure(java.util.Dictionary configuration)
reconfigure
in class Handler
configuration
- : the new configurationHandler.reconfigure(java.util.Dictionary)
public java.lang.Object reconfigureProperty(Property prop, java.lang.Object value)
InstanceManager.onSet(Object, String, Object)
call and the callback invocation.
The reconfiguration occurs only if the value changes.prop
- the property object to reconfigurevalue
- the new value.public void onCreation(java.lang.Object instance)
onCreation
in class PrimitiveHandler
instance
- : the created objectPrimitiveHandler.onCreation(Object)
public void updated(java.util.Dictionary conf) throws org.osgi.service.cm.ConfigurationException
updated
in interface org.osgi.service.cm.ManagedService
conf
- : pushed configuration.org.osgi.service.cm.ConfigurationException
- the reconfiguration failed.ManagedService.updated(java.util.Dictionary)
public HandlerDescription getDescription()
getDescription
in class Handler
Handler.getDescription()
public void addListener(ConfigurationListener listener)
listener
- the ConfigurationListener
object to be addedjava.lang.NullPointerException
- if listener
is null
public void removeListener(ConfigurationListener listener)
listener
- the ConfigurationListener
object to be removedjava.lang.NullPointerException
- if listener
is null
public void stateChanged(int state)
Handler
stateChanged
in class Handler
state
- the new instance state ComponentInstance
Copyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.