Package org.jppf.process
Class LauncherListener
java.lang.Object
java.lang.Thread
org.jppf.process.LauncherListener
- All Implemented Interfaces:
Runnable
Instances of this class listen to a socket connection setup in the ProcessLauncher, to handle the situation when the Launcher dies unexpectedly.
In that situation, the connection is broken and this process knows that it must exit.
In that situation, the connection is broken and this process knows that it must exit.
- Author:
- Laurent Cohen
-
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
ConstructorsConstructorDescriptionLauncherListener(int port) Initialize this LauncherListener with the specified port.LauncherListener(int port, LauncherListenerProtocolHandler actionHandler) Initialize this LauncherListener with the specified port. -
Method Summary
Modifier and TypeMethodDescriptionGet the action handler for this listener.voidrun()Create a socket connection and listen to it, and exit this process when the connection is broken.voidsetActionHandler(LauncherListenerProtocolHandler actionHandler) Set the action handler for this listener.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
-
LauncherListener
public LauncherListener(int port) Initialize this LauncherListener with the specified port.- Parameters:
port- the port to listen to.
-
LauncherListener
Initialize this LauncherListener with the specified port.- Parameters:
port- the port to listen to.actionHandler- the action handler for this listener.- Since:
- 5.0
-
-
Method Details
-
run
public void run()Create a socket connection and listen to it, and exit this process when the connection is broken. -
getActionHandler
Get the action handler for this listener.- Returns:
- a
LauncherListenerProtocolHandlerobject. - Since:
- 5.0
-
setActionHandler
Set the action handler for this listener.- Parameters:
actionHandler- aLauncherListenerProtocolHandlerobject.- Since:
- 5.0
-