public class CompositeManager extends java.lang.Object implements ComponentInstance, InstanceStateListener
DISPOSED, INVALID, STOPPED, VALID| Constructor and Description |
|---|
CompositeManager(CompositeFactory factory,
org.osgi.framework.BundleContext context,
HandlerManager[] handlers)
Construct a new Component Manager.
|
| Modifier and Type | Method and Description |
|---|---|
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(org.apache.felix.ipojo.metadata.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.
|
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 plugpublic 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(org.apache.felix.ipojo.metadata.Element metadata, java.util.Dictionary configuration) throws ConfigurationException
metadata - : the component type metadataconfiguration - : the configuration of the instanceConfigurationException - : 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 findpublic 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 ComponentInstancepublic 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()
Copyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.