org.apache.felix.ipojo.handlers.lifecycle.callback
Class LifecycleCallbackHandler

java.lang.Object
  extended by org.apache.felix.ipojo.Handler
      extended by org.apache.felix.ipojo.PrimitiveHandler
          extended by org.apache.felix.ipojo.handlers.lifecycle.callback.LifecycleCallbackHandler
All Implemented Interfaces:
FieldInterceptor, MethodInterceptor

public class LifecycleCallbackHandler
extends PrimitiveHandler

Lifecycle callback handler.

Author:
Felix Project Team

Field Summary
private  LifecycleCallback[] m_callbacks
          The list of the callback of the component.
private  boolean m_immediate
          Does a POJO object be created at starting.
private  int m_state
          State of the instance manager (unresolved at the beginning).
 
Fields inherited from class org.apache.felix.ipojo.PrimitiveHandler
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
LifecycleCallbackHandler()
           
 
Method Summary
private  void addCallback(LifecycleCallback callback)
          Add the given callback to the callback list.
 void configure(Element metadata, java.util.Dictionary configuration)
          Configure the handler.
 void start()
          Start the handler.
 void stateChanged(int state)
          When the state change call the associated callback.
 void stop()
          Stop the handler.
 
Methods inherited from class org.apache.felix.ipojo.PrimitiveHandler
attach, getFactory, getHandler, getInstanceManager, getLogger, getPojoMetadata, onCreation, onEntry, onError, onExit, onFinally, onGet, onSet, setFactory
 
Methods inherited from class org.apache.felix.ipojo.Handler
debug, error, error, getDescription, getHandlerManager, getValidity, info, initializeComponentFactory, isValid, reconfigure, setValidity, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_callbacks

private LifecycleCallback[] m_callbacks
The list of the callback of the component.


m_state

private int m_state
State of the instance manager (unresolved at the beginning).


m_immediate

private boolean m_immediate
Does a POJO object be created at starting.

Constructor Detail

LifecycleCallbackHandler

public LifecycleCallbackHandler()
Method Detail

addCallback

private void addCallback(LifecycleCallback callback)
Add the given callback to the callback list.

Parameters:
callback - : the element to add

configure

public void configure(Element metadata,
                      java.util.Dictionary configuration)
               throws ConfigurationException
Configure the handler.

Specified by:
configure in class Handler
Parameters:
metadata - : the component type metadata
configuration - : the instance configuration
Throws:
ConfigurationException - : one callback metadata is not correct (either the transition or the method are not correct).
See Also:
org.apache.felix.ipojo.Handler#configure(org.apache.felix.ipojo.InstanceManager, org.apache.felix.ipojo.metadata.Element, java.util.Dictionary)

start

public void start()
Start the handler.

Specified by:
start in class Handler
See Also:
Handler.start()

stop

public void stop()
Stop the handler.

Specified by:
stop in class Handler
See Also:
Handler.stop()

stateChanged

public void stateChanged(int state)
When the state change call the associated callback.

Overrides:
stateChanged in class Handler
Parameters:
state - : the new instance state.
See Also:
Handler.stateChanged(int)


Copyright © 2006-2010 The Apache Software Foundation. All Rights Reserved.