org.apache.felix.ipojo.handler.event
Class EventAdminSubscriberHandler

java.lang.Object
  extended by org.apache.felix.ipojo.Handler
      extended by org.apache.felix.ipojo.PrimitiveHandler
          extended by org.apache.felix.ipojo.handler.event.EventAdminSubscriberHandler
All Implemented Interfaces:
org.apache.felix.ipojo.FieldInterceptor, org.apache.felix.ipojo.MethodInterceptor, org.osgi.service.event.EventHandler

public class EventAdminSubscriberHandler
extends org.apache.felix.ipojo.PrimitiveHandler
implements org.osgi.service.event.EventHandler

Event Subscriber Handler.

Author:
Felix Project Team

Field Summary
static java.lang.String NAMESPACE
          Handler Namespace.
 
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
EventAdminSubscriberHandler()
           
 
Method Summary
 void configure(org.apache.felix.ipojo.metadata.Element metadata, java.util.Dictionary conf)
          Constructor.
 void handleEvent(org.osgi.service.event.Event event)
          Receive an event.
 void initializeComponentFactory(org.apache.felix.ipojo.architecture.ComponentTypeDescription cd, org.apache.felix.ipojo.metadata.Element metadata)
          Initialize the component type.
 void start()
          Handler start method.
 void stateChanged(int state)
          Handler state change method.
 void stop()
          The stop method of a handler.
 
Methods inherited from class org.apache.felix.ipojo.PrimitiveHandler
attach, getFactory, getHandler, getInstanceManager, getLogger, getMetadata, getPojoMetadata, onCreation, onEntry, onError, onExit, onFinally, onGet, onSet, setFactory
 
Methods inherited from class org.apache.felix.ipojo.Handler
error, error, getDescription, getHandlerManager, getValidity, info, 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

NAMESPACE

public static final java.lang.String NAMESPACE
Handler Namespace.

See Also:
Constant Field Values
Constructor Detail

EventAdminSubscriberHandler

public EventAdminSubscriberHandler()
Method Detail

initializeComponentFactory

public void initializeComponentFactory(org.apache.felix.ipojo.architecture.ComponentTypeDescription cd,
                                       org.apache.felix.ipojo.metadata.Element metadata)
                                throws org.apache.felix.ipojo.ConfigurationException
Initialize the component type.

Overrides:
initializeComponentFactory in class org.apache.felix.ipojo.Handler
Parameters:
cd - : component type description to populate.
metadata - : component type metadata.
Throws:
org.apache.felix.ipojo.ConfigurationException - : metadata are incorrect.
See Also:
org.apache.felix.ipojo.Handler#initializeComponentFactory(org.apache.felix.ipojo.architecture.ComponentDescription, org.apache.felix.ipojo.metadata.Element)

configure

public void configure(org.apache.felix.ipojo.metadata.Element metadata,
                      java.util.Dictionary conf)
               throws org.apache.felix.ipojo.ConfigurationException
Constructor.

Specified by:
configure in class org.apache.felix.ipojo.Handler
Parameters:
metadata - : component type metadata
conf - : instance configuration
Throws:
org.apache.felix.ipojo.ConfigurationException - : one event subscription is 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()
Handler start method. Expose the EventHandler service.

Specified by:
start in class org.apache.felix.ipojo.Handler
See Also:
Handler.start()

stateChanged

public void stateChanged(int state)
Handler state change method. register or unregister the EventHandler service according to the new state.

Overrides:
stateChanged in class org.apache.felix.ipojo.Handler
Parameters:
state - : new state
See Also:
Handler.stateChanged(int)

handleEvent

public void handleEvent(org.osgi.service.event.Event event)
Receive an event. The event is dispatch to attached subscribers.

Specified by:
handleEvent in interface org.osgi.service.event.EventHandler
Parameters:
event - : the received event.
See Also:
EventHandler.handleEvent(org.osgi.service.event.Event)

stop

public void stop()
The stop method of a handler.

Specified by:
stop in class org.apache.felix.ipojo.Handler
See Also:
Handler.stop()