public class InstanceHandler extends CompositeHandler implements InstanceStateListener
HANDLER_TYPE
HANDLER_LEVEL_PROPERTY, HANDLER_NAME_PROPERTY, HANDLER_NAMESPACE_PROPERTY, HANDLER_TYPE_PROPERTY, m_instance, m_isValid
Constructor and Description |
---|
InstanceHandler() |
Modifier and Type | Method and Description |
---|---|
void |
bindFactory(Factory factory)
A new valid factory appears.
|
void |
configure(org.apache.felix.ipojo.metadata.Element metadata,
java.util.Dictionary configuration)
Configure method.
|
HandlerDescription |
getDescription()
Return the handler description, i.e.
|
java.lang.Object |
getObjectFromInstance(java.lang.String type)
Method returning an instance object of the given component type.
|
java.util.List |
getUsedType()
Get the list of used component type.
|
static java.util.Properties |
parseInstance(org.apache.felix.ipojo.metadata.Element instance)
Parse an Element to get a dictionary.
|
static void |
parseProperty(org.apache.felix.ipojo.metadata.Element prop,
java.util.Dictionary dict)
Parse a property.
|
void |
reconfigure(java.util.Dictionary configuration)
The composite is reconfigured, we check if we have a property to change.
|
void |
start()
Start method.
|
void |
stateChanged(ComponentInstance instance,
int newState)
Instance state listener.
|
void |
stop()
Stop all created instances.
|
void |
unbindFactory(Factory factory)
An existing factory disappears or becomes invalid.
|
attach, getCompositeManager, getHandler, getLogger, setFactory
debug, error, error, getHandlerManager, getValidity, info, initializeComponentFactory, isValid, setValidity, stateChanged, warn, warn
public void bindFactory(Factory factory)
factory
- : factory.public void unbindFactory(Factory factory)
factory
- : factorypublic void configure(org.apache.felix.ipojo.metadata.Element metadata, java.util.Dictionary configuration) throws ConfigurationException
configure
in class Handler
metadata
- : component type metadata.configuration
- : instance configuration.ConfigurationException
- : occurs an instance cannot be parsed correctly.Handler.configure(org.apache.felix.ipojo.metadata.Element, java.util.Dictionary)
public static java.util.Properties parseInstance(org.apache.felix.ipojo.metadata.Element instance) throws ParseException
instance
- : the Element describing an instance.ParseException
- : occurs when a configuration cannot be parse correctly.public static void parseProperty(org.apache.felix.ipojo.metadata.Element prop, java.util.Dictionary dict) throws ParseException
prop
- : the current element to parsedict
- : the dictionary to populateParseException
- : occurs if the property cannot be parsed correctlypublic void start()
start
in class Handler
Handler.start()
public void stateChanged(ComponentInstance instance, int newState)
stateChanged
in interface InstanceStateListener
instance
- : instancenewState
- : the now state of the given instanceInstanceStateListener.stateChanged(org.apache.felix.ipojo.ComponentInstance, int)
public java.lang.Object getObjectFromInstance(java.lang.String type)
type
- : type.public HandlerDescription getDescription()
getDescription
in class Handler
Handler.getDescription()
public java.util.List getUsedType()
public void reconfigure(java.util.Dictionary configuration)
reconfigure
in class Handler
configuration
- the new instance configurationCopyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.