org.apache.cocoon.portal.event.impl
Class DefaultEventManager

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.portal.event.impl.DefaultEventManager
All Implemented Interfaces:
Disposable, Initializable, Component, Configurable, Contextualizable, LogEnabled, Serviceable, ThreadSafe, EventManager, Publisher, Register

public class DefaultEventManager
extends AbstractLogEnabled
implements EventManager, Serviceable, Initializable, ThreadSafe, Configurable, Disposable, Contextualizable, Publisher, Register

This is the default implementation of the event manager.

Version:
CVS $Id: DefaultEventManager.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Carsten Ziegeler, Volker Schmitt

Nested Class Summary
protected static class DefaultEventManager.MethodInfo
           
 
Field Summary
protected  ServiceSelector aspectSelector
           
protected  EventAspectChain chain
           
protected  Context context
           
protected  Map receiverClasses
          Introspected receiver classes
protected  PortalService service
          The portal service
 
Fields inherited from interface org.apache.cocoon.portal.event.EventManager
ROLE
 
Constructor Summary
DefaultEventManager()
           
 
Method Summary
 void configure(Configuration conf)
           
 void contextualize(Context context)
           
 void dispose()
           
protected  Map getObjectModel()
          Helper method to get the current object model
 Publisher getPublisher()
          Returns the Publisher with which events can be published.
 Register getRegister()
          Returns the Register with which subscribers can subscribe and unsubscribe interest to given Events.
 void initialize()
           
protected  List introspect(Class receiverClass)
           
 void processEvents()
          Process the events
 void publish(Event event)
          Publishes an event for subscribers to be informed of.
 void send(Event event)
          Publish an event.
 void service(ServiceManager manager)
           
 void subscribe(Receiver receiver)
          Subscribes a receiver for a specific type of event.
 void subscribe(Subscriber subscriber)
          Subscribes a Subscriber to the EventManager.
 void unsubscribe(Receiver receiver)
          Unsubscribes a receiver for all events.
 void unsubscribe(Subscriber subscriber)
          Unsubscribes an Subscriber from the EventManager.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chain

protected EventAspectChain chain

aspectSelector

protected ServiceSelector aspectSelector

context

protected Context context

service

protected PortalService service
The portal service


receiverClasses

protected Map receiverClasses
Introspected receiver classes

Constructor Detail

DefaultEventManager

public DefaultEventManager()
Method Detail

service

public void service(ServiceManager manager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)

getPublisher

public Publisher getPublisher()
Description copied from interface: EventManager
Returns the Publisher with which events can be published.

Specified by:
getPublisher in interface EventManager

getRegister

public Register getRegister()
Description copied from interface: EventManager
Returns the Register with which subscribers can subscribe and unsubscribe interest to given Events.

Specified by:
getRegister in interface EventManager

getObjectModel

protected Map getObjectModel()
Helper method to get the current object model


configure

public void configure(Configuration conf)
               throws ConfigurationException
Specified by:
configure in interface Configurable
Throws:
ConfigurationException

dispose

public void dispose()
Specified by:
dispose in interface Disposable

initialize

public void initialize()
                throws Exception
Specified by:
initialize in interface Initializable
Throws:
Exception

publish

public void publish(Event event)
Description copied from interface: Publisher
Publishes an event for subscribers to be informed of.

Specified by:
publish in interface Publisher
Parameters:
event - the Event being published

subscribe

public void subscribe(Subscriber subscriber)
Description copied from interface: Register
Subscribes a Subscriber to the EventManager. The Subscriber abstracts all the information needed for the subscription.

Specified by:
subscribe in interface Register
Parameters:
subscriber - the Subscriber
See Also:
Subscriber

unsubscribe

public void unsubscribe(Subscriber subscriber)
Description copied from interface: Register
Unsubscribes an Subscriber from the EventManager.

Specified by:
unsubscribe in interface Register
Parameters:
subscriber - the Subscriber
See Also:
Subscriber

processEvents

public void processEvents()
                   throws ProcessingException
Description copied from interface: EventManager
Process the events

Specified by:
processEvents in interface EventManager
Throws:
ProcessingException

contextualize

public void contextualize(Context context)
                   throws ContextException
Specified by:
contextualize in interface Contextualizable
Throws:
ContextException
See Also:
Contextualizable.contextualize(org.apache.avalon.framework.context.Context)

send

public void send(Event event)
Description copied from interface: EventManager
Publish an event. All registered receivers get notified.

Specified by:
send in interface EventManager
Parameters:
event - The event to broadcast.
See Also:
EventManager.send(org.apache.cocoon.portal.event.Event)

introspect

protected List introspect(Class receiverClass)

subscribe

public void subscribe(Receiver receiver)
Description copied from interface: EventManager
Subscribes a receiver for a specific type of event.

Specified by:
subscribe in interface EventManager
See Also:
EventManager.subscribe(org.apache.cocoon.portal.event.Receiver)

unsubscribe

public void unsubscribe(Receiver receiver)
Description copied from interface: EventManager
Unsubscribes a receiver for all events.

Specified by:
unsubscribe in interface EventManager
See Also:
EventManager.unsubscribe(org.apache.cocoon.portal.event.Receiver)


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