Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
EventChannel(WVA owner,
Socket socket) |
EventChannel(WVA owner,
String hostname,
int port) |
EventChannel(WVA owner,
String hostname,
int port,
EventChannelStateListener listener) |
| Modifier and Type | Method and Description |
|---|---|
BlockingQueue<JSONObject> |
getIncoming()
Allow the EventDispatcher access to the object queue
|
IOException |
ioException() |
boolean |
isStopped() |
protected Socket |
makeSocket()
Create a new
Socket pointed at this EventChannel's hostname and port. |
void |
run()
Read JSONObjects from a TCP stream into the incoming queue until either
the thread is interrupted or stopThread() is called.
|
void |
setStateListener(EventChannelStateListener listener)
Sets the state listener used to report back changes in the connection state.
|
void |
stopThread(IOException e) |
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, yieldpublic EventChannel(WVA owner, String hostname, int port, EventChannelStateListener listener)
public BlockingQueue<JSONObject> getIncoming()
public void setStateListener(EventChannelStateListener listener)
listener - the listener to setpublic void stopThread(IOException e)
public boolean isStopped()
public IOException ioException()
public void run()
protected Socket makeSocket() throws IOException
Socket pointed at this EventChannel's hostname and port.
This method is protected, rather than private, due to a bug between JaCoCo and the Android build tools which causes the instrumented bytecode to be invalid when this method is private: http://stackoverflow.com/questions/17603192/dalvik-transformation-using-wrong-invoke-opcode
IOException