public class HandlerManager extends InstanceManager
m_className, m_handlers, m_listeners, m_name, m_pojoObjects, m_state
DISPOSED, INVALID, STOPPED, VALID
Constructor and Description |
---|
HandlerManager(ComponentFactory factory,
org.osgi.framework.BundleContext context,
HandlerManager[] handlers)
Creates a handler manager.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
createPojoObject()
Creates an instance of the content.
|
void |
dispose()
Disposes the instance.
|
Handler |
getHandler()
Gets the contained handler object.
|
void |
init(ComponentInstance instance,
org.apache.felix.ipojo.metadata.Element metadata,
java.util.Dictionary configuration)
Creates and initializes the handler object.
|
protected void |
kill()
Kills the current instance.
|
void |
start()
Starts the instance manager.
|
void |
stateChanged(ComponentInstance instance,
int newState)
State Change listener callback.
|
void |
stop()
Stops the instance manager.
|
addInstanceStateListener, configure, createObject, deletePojoObject, getClassName, getClazz, getContext, getFactory, getFieldValue, getFieldValue, getGlobalContext, getHandler, getInstanceContext, getInstanceDescription, getInstanceName, getLocalServiceContext, getLogger, getPojoObject, getPojoObjects, getRegisteredHandlers, getRegistredFields, getRegistredMethods, getState, isStarted, load, onEntry, onError, onExit, onGet, onSet, reconfigure, register, register, register, register, register, removeInstanceStateListener, setInstanceBundleContext, setState
public HandlerManager(ComponentFactory factory, org.osgi.framework.BundleContext context, HandlerManager[] handlers)
factory
- the handler factorycontext
- the bundle contexthandlers
- the handler arraypublic Handler getHandler()
public void init(ComponentInstance instance, org.apache.felix.ipojo.metadata.Element metadata, java.util.Dictionary configuration) throws ConfigurationException
instance
- the component instance on which the handler will be attached.metadata
- the component metadata.configuration
- the instance configuration.ConfigurationException
- if the handler configuration failed.public java.lang.Object createPojoObject()
InstanceManager.createObject()
method, and adds
the created object to the InstanceManager.m_pojoObjects
list. Then,
it calls the PrimitiveHandler.onCreation(Object)
methods on attached
handlers.createPojoObject
in class InstanceManager
null
if an error occurs during the
creation.public void start()
start
in interface ComponentInstance
start
in class InstanceManager
public void stop()
stop
in interface ComponentInstance
stop
in class InstanceManager
public void dispose()
dispose
in interface ComponentInstance
dispose
in class InstanceManager
ComponentInstance.dispose()
protected void kill()
public void stateChanged(ComponentInstance instance, int newState)
stateChanged
in interface InstanceStateListener
stateChanged
in class InstanceManager
instance
- the changing instancenewState
- the new stateInstanceStateListener.stateChanged(org.apache.felix.ipojo.ComponentInstance, int)
Copyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.