Class Listener
java.lang.Object
java.lang.Thread
com.arjuna.ats.internal.arjuna.recovery.Listener
- All Implemented Interfaces:
Runnable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorDescriptionCreates a listener thread on the specified port for the specified service to run.Listener
(ServerSocket serverSocket, Service service) Creates a listener thread on the specified server socket for the specified service to run. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addConnection
(Socket conn) void
Ensuring the socket does not accept more requests by closing it and setting flag to inform the listener is stopped.void
removeConnection
(Socket conn) void
run()
Loops waiting for connection requests from client, creates a new Connection object for each connection.void
Halts running of the listener thread.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
-
Constructor Details
-
Listener
Creates a listener thread on the specified port for the specified service to run.- Throws:
IOException
-
Listener
Creates a listener thread on the specified server socket for the specified service to run.- Throws:
IOException
-
-
Method Details
-
run
public void run()Loops waiting for connection requests from client, creates a new Connection object for each connection. -
addConnection
-
removeConnection
-
closeListenerSockets
public void closeListenerSockets()Ensuring the socket does not accept more requests by closing it and setting flag to inform the listener is stopped.
Method does not close opened connections, run the
stopListener()
method for that. -
stopListener
public void stopListener()Halts running of the listener thread.
-