Package org.astrogrid.samp.web
Class WebHubConnection.CallWorker
- java.lang.Object
-
- java.lang.Thread
-
- org.astrogrid.samp.web.WebHubConnection.CallWorker
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- WebHubConnection
private static class WebHubConnection.CallWorker extends java.lang.Thread
Thread that performs repeated long polls to pull callbacks from the hub and passes them on to this connection's CallableClient for execution.
-
-
Field Summary
Fields Modifier and Type Field Description private CallableClient
client_
private long
minWaitMillis_
private boolean
stopped_
private int
timeoutSec_
private XmlRpcHubConnection
xconn_
-
Constructor Summary
Constructors Constructor Description CallWorker(XmlRpcHubConnection xconn, CallableClient client, java.lang.String appName)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
run()
private void
seriousError(java.lang.Throwable e)
Invoked if there is a serious (non-timeout) error when polling for callbacks.-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
xconn_
private final XmlRpcHubConnection xconn_
-
client_
private final CallableClient client_
-
timeoutSec_
private final int timeoutSec_
- See Also:
- Constant Field Values
-
minWaitMillis_
private final long minWaitMillis_
- See Also:
- Constant Field Values
-
stopped_
private volatile boolean stopped_
-
-
Constructor Detail
-
CallWorker
CallWorker(XmlRpcHubConnection xconn, CallableClient client, java.lang.String appName)
Constructor.- Parameters:
xconn
- hub connectionappName
- client's name
-
-
Method Detail
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
seriousError
private void seriousError(java.lang.Throwable e)
Invoked if there is a serious (non-timeout) error when polling for callbacks. This currently stops the polling for good. That may be a drastic response, but at least it prevents repeated high-frequency polling attempts to a broken server, which might otherwise result.
-
-