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 ComponentInstance
listener
- : 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 ComponentInstance
ComponentInstance.dispose()
public CompositeHandler getCompositeHandler(java.lang.String name)
name
- : class name of the handler to findpublic org.osgi.framework.BundleContext getContext()
getContext
in interface ComponentInstance
ComponentInstance.getContext()
public ComponentFactory getFactory()
getFactory
in interface ComponentInstance
ComponentInstance.getFactory()
public org.osgi.framework.BundleContext getGlobalContext()
public InstanceDescription getInstanceDescription()
getInstanceDescription
in interface ComponentInstance
ComponentInstance.getInstanceDescription()
public java.lang.String getInstanceName()
getInstanceName
in interface ComponentInstance
ComponentInstance.getInstanceName()
public ServiceContext getParentServiceContext()
public CompositeHandler[] getRegistredCompositeHandlers()
public ServiceContext getServiceContext()
public int getState()
getState
in interface ComponentInstance
ComponentInstance.getState()
public boolean isStarted()
isStarted
in interface ComponentInstance
ComponentInstance.isStarted()
public void reconfigure(java.util.Dictionary configuration)
reconfigure
in interface ComponentInstance
configuration
- : the new instance configuration.ComponentInstance.reconfigure(java.util.Dictionary)
public void removeInstanceStateListener(InstanceStateListener listener)
removeInstanceStateListener
in interface ComponentInstance
listener
- : 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 InstanceStateListener
instance
- : changing instancenewState
- : new stateInstanceStateListener.stateChanged(org.apache.felix.ipojo.ComponentInstance, int)
public void stop()
stop
in interface ComponentInstance
protected void kill()
Copyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.