org.enhydra.barracuda.core.event
Class DefaultBaseEventListener

java.lang.Object
  |
  +--org.enhydra.barracuda.core.event.DefaultBaseEventListener
All Implemented Interfaces:
BaseEventListener, java.util.EventListener
Direct Known Subclasses:
BlockIterateHandler, DefaultViewHandler

public abstract class DefaultBaseEventListener
extends java.lang.Object
implements BaseEventListener

This class provides the default implementation for a BaseEventListener. This is an abstract class, meaning you have to extend it if you intend to use it. Typically you would implement it as an inner class and extend handleReqEvent, handleRespEvent, or handleOtherEvent. Or, you can always just override handleEvent and do whatever you want.


Field Summary
protected  java.lang.String idStr
           
protected static org.apache.log4j.Logger localLogger
           
 
Constructor Summary
DefaultBaseEventListener()
           
 
Method Summary
 java.lang.String getListenerID()
          Get the ID that identifies this listener.
 void handleControlEvent(ControlEventContext context)
          Handle HttpRequestEvents
 void handleEvent(EventContext context)
          Handle all events.
 void handleOtherEvent(EventContext context)
          Handle all Other events
 void handleViewEvent(ViewEventContext context)
          Handle HttpResponseEvents
 boolean isHandled()
          Return true if the event was handled in the handleEvent method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

localLogger

protected static org.apache.log4j.Logger localLogger

idStr

protected java.lang.String idStr
Constructor Detail

DefaultBaseEventListener

public DefaultBaseEventListener()
Method Detail

handleEvent

public void handleEvent(EventContext context)
                 throws EventException
Handle all events. This represents a default implementation that will route the event on to the convenience respective convenience methods.

Specified by:
handleEvent in interface BaseEventListener
Parameters:
context - the EventContext for the base event we are handling
Throws:
EventException

handleControlEvent

public void handleControlEvent(ControlEventContext context)
                        throws EventException,
                               javax.servlet.ServletException,
                               java.io.IOException
Handle HttpRequestEvents

Parameters:
context - the ControlEventContext
Throws:
EventException
javax.servlet.ServletException
java.io.IOException

handleViewEvent

public void handleViewEvent(ViewEventContext context)
                     throws EventException,
                            javax.servlet.ServletException,
                            java.io.IOException
Handle HttpResponseEvents

Parameters:
context - the ViewEventContext
Throws:
EventException
javax.servlet.ServletException
java.io.IOException

handleOtherEvent

public void handleOtherEvent(EventContext context)
                      throws EventException
Handle all Other events

Parameters:
context - the EventContext
Throws:
EventException

isHandled

public boolean isHandled()
Return true if the event was handled in the handleEvent method. By default, most implementations will return true for you, so the only time you'd need to override is if the handler wanted to specifically indicate that it had NOT handled the event (ie in logging scenarios).

Specified by:
isHandled in interface BaseEventListener
Returns:
true if the event was handled in the handleEvent method

getListenerID

public java.lang.String getListenerID()
Get the ID that identifies this listener. This will typically be the class name.

Specified by:
getListenerID in interface BaseEventListener
Returns:
a string that uniquely identifies this listener


Copyright © 2001 Enhydra.org