|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.felix.ipojo.Handler
org.apache.felix.ipojo.composite.CompositeHandler
org.apache.felix.ipojo.composite.instance.InstanceHandler
public class InstanceHandler
Composite Instance Handler. This handler allows creating an instance inside a composite. This instance is determine by its type and a configuration.
| Nested Class Summary | |
|---|---|
(package private) class |
InstanceHandler.ManagedConfiguration
This structure aims to manage a configuration. |
| Field Summary | |
|---|---|
private InstanceHandler.ManagedConfiguration[] |
m_configurations
Configurations to create and maintains. |
private InstanceHandlerDescription |
m_description
Handler description. |
private Factory[] |
m_factories
Available factories. |
private ServiceContext |
m_scope
Internal context. |
| Fields inherited from class org.apache.felix.ipojo.composite.CompositeHandler |
|---|
HANDLER_TYPE |
| Fields inherited from class org.apache.felix.ipojo.Handler |
|---|
HANDLER_LEVEL_PROPERTY, HANDLER_NAME_PROPERTY, HANDLER_NAMESPACE_PROPERTY, HANDLER_TYPE_PROPERTY, m_instance, m_isValid |
| Constructor Summary | |
|---|---|
InstanceHandler()
|
|
| Method Summary | |
|---|---|
void |
bindFactory(Factory factory)
A new valid factory appears. |
private void |
checkValidity()
Check handler validity. |
void |
configure(Element metadata,
java.util.Dictionary configuration)
Configure method. |
private void |
createInstance(Factory fact,
InstanceHandler.ManagedConfiguration config)
Create an instance using the given factory and the given configuration. |
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.Dictionary |
parseInstance(Element instance)
Parse an Element to get a dictionary. |
static void |
parseProperty(Element prop,
java.util.Dictionary dict)
Parse a property. |
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. |
| Methods inherited from class org.apache.felix.ipojo.composite.CompositeHandler |
|---|
attach, getCompositeManager, getHandler, getLogger, setFactory |
| Methods inherited from class org.apache.felix.ipojo.Handler |
|---|
debug, error, error, getHandlerManager, getValidity, info, initializeComponentFactory, isValid, reconfigure, setValidity, stateChanged, warn, warn |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private ServiceContext m_scope
private Factory[] m_factories
private InstanceHandlerDescription m_description
private InstanceHandler.ManagedConfiguration[] m_configurations
| Constructor Detail |
|---|
public InstanceHandler()
| Method Detail |
|---|
private void createInstance(Factory fact,
InstanceHandler.ManagedConfiguration config)
fact - : the factory name to used.config - : the configuration.public void bindFactory(Factory factory)
factory - : factory.public void unbindFactory(Factory factory)
factory - : factorypublic void stop()
stop in class Handler
public void configure(Element metadata,
java.util.Dictionary configuration)
throws ConfigurationException
configure in class Handlermetadata - : component type metadata.configuration - : instance configuration.
ConfigurationException - : occurs an instance cannot be parsed correctly.org.apache.felix.ipojo.CompositeHandler#configure(org.apache.felix.ipojo.CompositeManager, org.apache.felix.ipojo.metadata.Element, java.util.Dictionary)
public static java.util.Dictionary parseInstance(Element instance)
throws ParseException
instance - : the Element describing an instance.
ParseException - : occurs when a configuration cannot be parse correctly.
public static void parseProperty(Element prop,
java.util.Dictionary dict)
throws ParseException
prop - : the current element to parsedict - : the dictionary to populate
ParseException - : occurs if the property cannot be parsed correctlypublic void start()
start in class Handlerorg.apache.felix.ipojo.CompositeHandler#start()private void checkValidity()
public void stateChanged(ComponentInstance instance,
int newState)
stateChanged in interface InstanceStateListenerinstance - : 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 Handlerorg.apache.felix.ipojo.CompositeHandler#getDescription()public java.util.List getUsedType()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||