public class ReachabilityUIUpdater extends java.lang.Thread implements StopableObject
ReachabilityUI with new reachability status informations.ReachabilityUI up to date.| Modifier and Type | Field and Description |
|---|---|
private de.hawhamburg.livingplace.messaging.activemq.wrapper.LPSubscriber |
infoTopic
An
LPSubscriber, which listens on the reachability status topic (REACHABILITY_AGENT_RESULT_TOPIC). |
private java.util.Map<ReachabilityGroup,ReachabilityStatus> |
internStatus
An hash map holding the last known states of reachability for each
ReachabilityGroup
item. |
private boolean |
shutDown
Determines if the method
shutDown() has been called. |
private ReachabilityUI |
ui
The
ReachabilityUI object, which shall be updated. |
| Constructor and Description |
|---|
ReachabilityUIUpdater(ReachabilityUI sourceUi)
Generates a new
ReachabilityUIUpdater thread to keep the ReachabilityUI UI up to date. |
| Modifier and Type | Method and Description |
|---|---|
void |
end()
Disconnects the
infoTopic, if it isn't null. |
void |
init()
Opens a connection the the reachability information topic (REACHABILITY_AGENT_RESULT_TOPIC) and
initializes the intern state hash map
internStatus with ReachabilityStatus.NOT_CALCULATED. |
boolean |
isActive()
Determines whether the method
StopableObject.shutDown() has been called on this object or not. |
void |
run()
Connects to the reachability information topic using
init() and frequently tries to get the newest
reachability states from this topic. |
void |
shutDown()
Shuts the object down.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprivate ReachabilityUI ui
ReachabilityUI object, which shall be updated.private boolean shutDown
shutDown() has been called.private de.hawhamburg.livingplace.messaging.activemq.wrapper.LPSubscriber infoTopic
LPSubscriber, which listens on the reachability status topic (REACHABILITY_AGENT_RESULT_TOPIC).private java.util.Map<ReachabilityGroup,ReachabilityStatus> internStatus
ReachabilityGroup
item.public ReachabilityUIUpdater(ReachabilityUI sourceUi)
ReachabilityUIUpdater thread to keep the ReachabilityUI UI up to date.sourceUi - A ReachabilityUI, which shall be updated.public final void shutDown()
StopableObjectshutDown in interface StopableObjectStopableObject.shutDown()public final boolean isActive()
StopableObjectStopableObject.shutDown() has been called on this object or not.isActive in interface StopableObjecttrue if shutDown() wasn't called, otherwise false.StopableObject.isActive()public final void run()
init() and frequently tries to get the newest
reachability states from this topic. If a new state arrives, the ReachabilityUI ui will be
updated using ReachabilityUI.refresh(Map).run in interface java.lang.Runnablerun in class java.lang.Threadpublic final void init()
internStatus with ReachabilityStatus.NOT_CALCULATED.public final void end()
infoTopic, if it isn't null.