Package adams.core
Class PublishSubscribeHandler
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.PublishSubscribeHandler
-
- All Implemented Interfaces:
LoggingSupporter
,SizeOfHandler
,Serializable
public class PublishSubscribeHandler extends LoggingObject
Manages publishing of data to subscribed listeners.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description Set<PublicationListener>
m_Subscribers
the subscribers.-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description PublishSubscribeHandler()
Initializes the handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSubscriber(PublicationListener s)
Adds the subscriber.void
clear()
Removes all subscribers.protected void
initialize()
Initializes the members.void
publish(Object source, Object data)
Publishes the data.void
removeSubscriber(PublicationListener s)
Removes the subscriber.-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Subscribers
public Set<PublicationListener> m_Subscribers
the subscribers.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.
-
addSubscriber
public void addSubscriber(PublicationListener s)
Adds the subscriber.- Parameters:
s
- the subscriber to add
-
removeSubscriber
public void removeSubscriber(PublicationListener s)
Removes the subscriber.- Parameters:
s
- the subscriber to remove
-
clear
public void clear()
Removes all subscribers.
-
-