public class ReachabilityConfigUIResultListener
extends java.lang.Thread
implements de.hawhamburg.reachability.StopableObject
ReachabilityConfigUI
with new configuration sets.ReachabilityConfigUI
up to date.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
internalRequestId
The id of the request message, to match the correct response.
|
private ReachabilityConfigUI |
internalUI
The
ReachabilityConfigUI object, which shall be updated. |
private boolean |
jobDone
Determines if the job has been done or not.
|
private static long |
MAX_WAITING
The maximum amount of time to wait on response before timeout.
|
private de.hawhamburg.livingplace.messaging.activemq.wrapper.LPSubscriber |
resultTopic
An
LPSubscriber , which listens on the reachability configuration result topic
(REACHABILITY_CONFIG_RESULT_TOPIC). |
private boolean |
shutDown
Determines if the method
shutDown() has been called. |
private long |
startingTime
The time in milliseconds when this thread has been started.
|
Constructor and Description |
---|
ReachabilityConfigUIResultListener(ReachabilityConfigUI ui,
java.lang.String requestId)
Generates a new
ReachabilityConfigUIResultListener thread to keep the ReachabilityConfigUI
UI up to date. |
Modifier and Type | Method and Description |
---|---|
void |
end()
Disconnects the
resultTopic , if it isn't null . |
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,de.hawhamburg.reachability.properties.PropertyDescription>> |
fetchPropertiesDescription(java.util.Map<java.lang.String,de.hawhamburg.reachability.properties.PropertyDescription> props)
The method fetches the description of the properties from the result message and groups the properties whith the
same display group together.
|
void |
init()
Opens a connection the the configuration result topic (REACHABILITY_CONFIG_RESULT_TOPIC).
|
boolean |
isActive() |
void |
run()
Connects to the configuration result topic using
init() and frequently tries to get the newest result
states from this topic. |
void |
shutDown() |
boolean |
timeout()
Determines if the waiting-time has run out of acceptance.
|
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, yield
private static final long MAX_WAITING
private ReachabilityConfigUI internalUI
ReachabilityConfigUI
object, which shall be updated.private java.lang.String internalRequestId
private boolean jobDone
private boolean shutDown
shutDown()
has been called.private de.hawhamburg.livingplace.messaging.activemq.wrapper.LPSubscriber resultTopic
LPSubscriber
, which listens on the reachability configuration result topic
(REACHABILITY_CONFIG_RESULT_TOPIC).private long startingTime
public ReachabilityConfigUIResultListener(ReachabilityConfigUI ui, java.lang.String requestId)
ReachabilityConfigUIResultListener
thread to keep the ReachabilityConfigUI
UI up to date.ui
- A ReachabilityConfigUI
, which shall be updated.requestId
- The ID of the request message to match the correct result.public final void shutDown()
shutDown
in interface de.hawhamburg.reachability.StopableObject
StopableObject.shutDown()
public final boolean isActive()
isActive
in interface de.hawhamburg.reachability.StopableObject
true
if shutDown()
wasn't called, otherwise false
.StopableObject.isActive()
public final void run()
init()
and frequently tries to get the newest result
states from this topic. If a new state arrives, the ReachabilityConfigUI
internalUI
will be
updated using ReachabilityUI.refresh(java.util.Map)
.run
in interface java.lang.Runnable
run
in class java.lang.Thread
public final void init()
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,de.hawhamburg.reachability.properties.PropertyDescription>> fetchPropertiesDescription(java.util.Map<java.lang.String,de.hawhamburg.reachability.properties.PropertyDescription> props)
props
- The properties with their description as Map
of property name (String
) to
PropertyDescription
.Map
of group
(String
) to Map
of property (String
) to PropertyDescription
.public final void end()
resultTopic
, if it isn't null
.public final boolean timeout()
true
if the service is timed out, otherwise false
.