org.jasig.portal.events.handlers
Class PortalEventMulticaster

java.lang.Object
  extended by org.jasig.portal.events.handlers.AbstractLimitedSupportEventHandler
      extended by org.jasig.portal.events.handlers.PortalEventMulticaster
All Implemented Interfaces:
EventHandler

public class PortalEventMulticaster
extends AbstractLimitedSupportEventHandler

Version:
$Revision$
Author:
Eric Dalquist

Nested Class Summary
protected static class PortalEventMulticaster.PortalEventTask
           
 
Field Summary
 
Fields inherited from class org.jasig.portal.events.handlers.AbstractLimitedSupportEventHandler
logger
 
Constructor Summary
PortalEventMulticaster()
           
 
Method Summary
 void addListener(EventHandler listener)
           
 void afterPropertiesSet()
           
 TaskExecutor getTaskExecutor()
          Return the current TaskExecutor for this multicaster.
 void handleEvent(PortalEvent event)
          Method to handle any processing of the event that is needed.
protected  void handleEventInternal(PortalEvent event, EventHandler handler)
          sub-classes can override this method to provide different handling for each PortalEvent and EventHandler.
 void setHandlers(Collection<EventHandler> listeners)
           
 void setTaskExecutor(TaskExecutor taskExecutor)
          Set the TaskExecutor to execute event handlers with.
 
Methods inherited from class org.jasig.portal.events.handlers.AbstractLimitedSupportEventHandler
getIgnoredUserNames, getSupportedEvents, getSupportedUserNames, isExplicitMatching, isRequireAll, isSupportGuest, setExplicitMatching, setIgnoredUserNames, setRequireAll, setSupportedEvents, setSupportedUserNames, setSupportGuest, supports
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortalEventMulticaster

public PortalEventMulticaster()
Method Detail

setTaskExecutor

public final void setTaskExecutor(TaskExecutor taskExecutor)
Set the TaskExecutor to execute event handlers with.

Default is a SyncTaskExecutor, executing the handlers synchronously in the calling thread.

Consider specifying an asynchronous TaskExecutor here to not block the caller until all handlers have been executed. However, note that asynchronous execution will not participate in the caller's thread context (class loader, transaction association) unless the TaskExecutor explicitly supports this.

See Also:
SyncTaskExecutor, SimpleAsyncTaskExecutor, TimerTaskExecutor

getTaskExecutor

public final TaskExecutor getTaskExecutor()
Return the current TaskExecutor for this multicaster.


setHandlers

public final void setHandlers(Collection<EventHandler> listeners)
Parameters:
handlers - the handlers to set

addListener

public final void addListener(EventHandler listener)

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Throws:
Exception

handleEvent

public void handleEvent(PortalEvent event)
Description copied from interface: EventHandler
Method to handle any processing of the event that is needed.

Parameters:
event - the event to handle.

handleEventInternal

protected void handleEventInternal(PortalEvent event,
                                   EventHandler handler)
sub-classes can override this method to provide different handling for each PortalEvent and EventHandler. The default implementation simply calls EventHandler.supports(PortalEvent) and EventHandler.handleEvent(PortalEvent).



Copyright © 2010 Jasig. All Rights Reserved.