org.jasig.portal.events.handlers
Class QueueingEventHandler

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

public class QueueingEventHandler
extends AbstractLimitedSupportEventHandler
implements DisposableBean

Queues PortalEvents in a local ConcurrentLinkedQueue and flushes the events to the configured BatchingEventHandler when flush() is called. This class must be used with some external timer that will call flush() at regular intervals

Version:
$Revision$
Author:
Eric Dalquist

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
QueueingEventHandler()
           
 
Method Summary
 void destroy()
           
 void flush()
           
 void flush(boolean ignoreFailure)
          Flushes the queued PortalEvents to the configured BatchingEventHandler.
 BatchingEventHandler getBatchingEventHandler()
           
 int getBatchSize()
           
 void handleEvent(PortalEvent event)
          Method to handle any processing of the event that is needed.
 void setBatchingEventHandler(BatchingEventHandler batchingEventHandler)
           
 void setBatchSize(int batchSize)
          The maximum number of events to be flushed to the BatchingEventHandler per call.
 
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
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

QueueingEventHandler

public QueueingEventHandler()
Method Detail

getBatchingEventHandler

public BatchingEventHandler getBatchingEventHandler()
Returns:
the batchingEventHandler

setBatchingEventHandler

public void setBatchingEventHandler(BatchingEventHandler batchingEventHandler)
Parameters:
batchingEventHandler - the batchingEventHandler to set

getBatchSize

public int getBatchSize()
Returns:
the batchSize

setBatchSize

public void setBatchSize(int batchSize)
The maximum number of events to be flushed to the BatchingEventHandler per call.


destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface DisposableBean
Throws:
Exception

handleEvent

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

Specified by:
handleEvent in interface EventHandler
Parameters:
event - the event to handle.

flush

public void flush()
See Also:
flush(boolean)

flush

public void flush(boolean ignoreFailure)
Flushes the queued PortalEvents to the configured BatchingEventHandler. If force is false flushing only happens if there are enough events in the queue and a flush isn't already under way. If force is true all queued events will be flushed and the calling thread will wait until any previously executing flush call completes before flushing

Parameters:
ignoreFailure - Ignore failures while flushing, don't log anything


Copyright © 2010 Jasig. All Rights Reserved.