Package org.ka2ddo.yaac.ax25
Class MsgEventDispatcher
java.lang.Object
org.ka2ddo.yaac.ax25.MsgEventDispatcher
This singleton class provides a dispatcher of events of type MsgEventType.
Listeners can register here to be informed of events.
- Author:
- Andrew Pavlin, KA2DDO
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Helper class for queuing events that can't be fired immediately (perhaps because they were detected while in mutex-synchronized code). -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Register the specified listener for all types of events.static void
addMsgEventListener
(MsgEventListener l, MsgEventType... types) Register the specified listener for all types of events.static void
fireMsgEvent
(MsgEventType type, StationState ss, AX25Message msg, String text, Object other) Notify all interested MsgEventListeners about an event.static void
Unregister a MsgEventListener.
-
Method Details
-
addMsgEventListener
Register the specified listener for all types of events. Note that if the listener is already registered, its registration will remain unchanged; the types will not be altered.- Parameters:
l
- MsgEventListener to register
-
addMsgEventListener
Register the specified listener for all types of events. Note that if the listener is already registered, its registration will remain unchanged; the types will not be altered.- Parameters:
l
- MsgEventListener to registertypes
- MsgEventTypes to be reported; types not matching this list will not be reported to this particular listener
-
removeMsgEventListener
Unregister a MsgEventListener.- Parameters:
l
- MsgEventListener to remove
-
fireMsgEvent
public static void fireMsgEvent(MsgEventType type, StationState ss, AX25Message msg, String text, Object other) Notify all interested MsgEventListeners about an event.- Parameters:
type
- MsgEventType of eventss
- StationState associated with eventmsg
- AX25Message associated with eventtext
- String associated with eventother
- Object of some other class associated with the event
-