org.enhydra.barracuda.core.event
Interface ListenerFactory

All Known Implementing Classes:
DefaultListenerFactory

public interface ListenerFactory

This interface defines the methods needed to be an ListenerFactory. Note that a factory is responsible for ensuring threadsafety within the underlying listener, so the factory should either return a new instance of the listener OR keep one static synchronized instance and return that instead.


Method Summary
 BaseEventListener getInstance()
          Get an instance of the underlying BaseEventListener
 String getListenerID()
          Get the Listener ID associated with this class of listener.
 boolean notifyAlways()
          Return true if you want to always be notified, even when an event has been handled by someone else.
 

Method Detail

getInstance

public BaseEventListener getInstance()
Get an instance of the underlying BaseEventListener

Returns:
get an instance of the BaseEventListener

notifyAlways

public boolean notifyAlways()
Return true if you want to always be notified, even when an event has been handled by someone else. Return false (default) when you only want to notified if the event hasn't been handled already. Typically, only logging type listeners would return true.

Returns:
return true to be notified of the event even if it's already been handled

getListenerID

public String getListenerID()
Get the Listener ID associated with this class of listener. This will generally either be the class name of the listener that the factory creates

Returns:
the listener ID that describes this factory


Copyright © 2003 BarracudaMVC.org All Rights Reserved.