|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.felix.ipojo.composite.CompositeManager
public class CompositeManager
iPOJO Composite manager. The composite manager class manages one instance of a component type which is a composition. It manages component lifecycle, and handlers...
| Field Summary | |
|---|---|
private org.osgi.framework.BundleContext |
m_context
The context of the component. |
private CompositeInstanceDescription |
m_description
The instance description. |
private CompositeFactory |
m_factory
Parent factory (ComponentFactory). |
private HandlerManager[] |
m_handlers
Composite Handler list. |
private CompositeServiceContext |
m_internalContext
Internal service context of the composition. |
private java.util.List |
m_listeners
Instance State Listener List. |
private java.lang.String |
m_name
Name of the component instance. |
private int |
m_state
Component state (STOPPED at the beginning). |
| Fields inherited from interface org.apache.felix.ipojo.ComponentInstance |
|---|
DISPOSED, INVALID, STOPPED, VALID |
| Constructor Summary | |
|---|---|
CompositeManager(CompositeFactory factory,
org.osgi.framework.BundleContext context,
HandlerManager[] handlers)
Construct a new Component Manager. |
|
| Method Summary | |
|---|---|
void |
addCompositeHandler(HandlerManager handler)
Plug the given handler to the current container. |
void |
addInstanceStateListener(InstanceStateListener listener)
Add an instance to the created instance list. |
void |
configure(Element metadata,
java.util.Dictionary configuration)
Configure the instance manager. |
void |
dispose()
Dispose the instance. |
CompositeHandler |
getCompositeHandler(java.lang.String name)
Return a specified handler. |
org.osgi.framework.BundleContext |
getContext()
Get the bundle context used by this instance. |
ComponentFactory |
getFactory()
Get the factory which create this instance. |
org.osgi.framework.BundleContext |
getGlobalContext()
Get the global bundle context. |
InstanceDescription |
getInstanceDescription()
Return the instance description of this instance. |
java.lang.String |
getInstanceName()
Get the instance name. |
ServiceContext |
getParentServiceContext()
Get the parent service context. |
CompositeHandler[] |
getRegistredCompositeHandlers()
REturn the list of handlers plugged on this instance. |
ServiceContext |
getServiceContext()
Get the internal service context of this instance. |
int |
getState()
Get the actual state of the instance. |
boolean |
isStarted()
Check if the instance is started. |
protected void |
kill()
Kill the current instance. |
void |
reconfigure(java.util.Dictionary configuration)
Reconfigure the current instance. |
void |
removeInstanceStateListener(InstanceStateListener listener)
Remove an instance state listener. |
void |
setState(int state)
Set the state of the component. |
void |
start()
Start the instance manager. |
void |
stateChanged(ComponentInstance instance,
int newState)
State Change listener callback. |
void |
stop()
Stop the instance manager. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final org.osgi.framework.BundleContext m_context
private final CompositeFactory m_factory
private HandlerManager[] m_handlers
private java.util.List m_listeners
private CompositeServiceContext m_internalContext
private final CompositeInstanceDescription m_description
private java.lang.String m_name
private int m_state
| Constructor Detail |
|---|
public CompositeManager(CompositeFactory factory,
org.osgi.framework.BundleContext context,
HandlerManager[] handlers)
factory - : the factory managing the instance managercontext - : the bundle context to give to the instancehandlers - : the handlers to plug| Method Detail |
|---|
public void addCompositeHandler(HandlerManager handler)
handler - : the handler to plug.public void addInstanceStateListener(InstanceStateListener listener)
addInstanceStateListener in interface ComponentInstancelistener - : the instance state listener to add.ComponentInstance.addInstanceStateListener(org.apache.felix.ipojo.InstanceStateListener)
public void configure(Element metadata,
java.util.Dictionary configuration)
throws ConfigurationException
metadata - : the component type metadataconfiguration - : the configuration of the instance
ConfigurationException - : occurs when the component type are incorrect.public void dispose()
dispose in interface ComponentInstanceComponentInstance.dispose()public CompositeHandler getCompositeHandler(java.lang.String name)
name - : class name of the handler to find
public org.osgi.framework.BundleContext getContext()
getContext in interface ComponentInstanceComponentInstance.getContext()public ComponentFactory getFactory()
getFactory in interface ComponentInstanceComponentInstance.getFactory()public org.osgi.framework.BundleContext getGlobalContext()
public InstanceDescription getInstanceDescription()
getInstanceDescription in interface ComponentInstanceComponentInstance.getInstanceDescription()public java.lang.String getInstanceName()
getInstanceName in interface ComponentInstanceComponentInstance.getInstanceName()public ServiceContext getParentServiceContext()
public CompositeHandler[] getRegistredCompositeHandlers()
public ServiceContext getServiceContext()
public int getState()
getState in interface ComponentInstanceComponentInstance.getState()public boolean isStarted()
isStarted in interface ComponentInstanceComponentInstance.isStarted()public void reconfigure(java.util.Dictionary configuration)
reconfigure in interface ComponentInstanceconfiguration - : the new instance configuration.ComponentInstance.reconfigure(java.util.Dictionary)public void removeInstanceStateListener(InstanceStateListener listener)
removeInstanceStateListener in interface ComponentInstancelistener - : the listener to removeComponentInstance.removeInstanceStateListener(org.apache.felix.ipojo.InstanceStateListener)public void setState(int state)
state - : new statepublic void start()
start in interface ComponentInstance
public void stateChanged(ComponentInstance instance,
int newState)
stateChanged in interface InstanceStateListenerinstance - : changing instancenewState - : new stateInstanceStateListener.stateChanged(org.apache.felix.ipojo.ComponentInstance, int)public void stop()
stop in interface ComponentInstanceprotected void kill()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||