com.ireasoning.protocol
Class ListenerManager
java.lang.Object
|
+--com.ireasoning.protocol.ListenerManager
- Direct Known Subclasses:
- Session, SnmpPoller
- public class ListenerManager
- extends Object
This class provides functionalities to manage Listener pool, including
methods such as add/remove/notify listeners.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_listeners
protected Listener[] _listeners
- Array of registered Listener objects.
ListenerManager
public ListenerManager()
addListener
public void addListener(Listener listener)
- This method allows the registration of event listeners.
Listener.handleMsg(Session session, Msg msg) will get called if Session
recieves message.
- Parameters:
listener
- an object which implements Listener interface. If passed listener already exists, it will not be added.- See Also:
Listener.handleMsg(java.lang.Object, com.ireasoning.protocol.Msg)
removeListener
public void removeListener(Listener listener)
- This method allows the removal of event listeners from the event target.
If an EventListener is removed from an EventTarget while it is processing
an event, it will not be triggered by the current actions.
- Parameters:
listener
- an object which implements Listener interface
listenerExists
protected boolean listenerExists()
- Checks if there's any listener registered
- Returns:
- true if there's at least one listener registered
notifyListeners
public void notifyListeners(Msg msg)
- Notifys all listeners on just recieved message
- Parameters:
msg
- the message object to notify
notifyListeners
public void notifyListeners(Msg[] msg)
- Notifys all listeners on just recieved message
- Parameters:
msg
- the message object to notify
Copyright © 2002 iReasoning Inc. All Rights Reserved.