Package org.jrd.agent
Class ConnectionDelegator
java.lang.Object
java.lang.Thread
org.jrd.agent.ConnectionDelegator
- All Implemented Interfaces:
Runnable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static ConnectionDelegator
static final String
static final int
private InstrumentationProvider
private static boolean
private ServerSocket
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ConnectionDelegator
(InstrumentationProvider provider, ServerSocket serverSocket) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Closes server socket Already connected clients can finish their work but no new clients can connect.static boolean
initialize
(String hostname, Integer port, InstrumentationProvider provider) This method is used to create an ConnectionDelegator object and start listener threadvoid
run()
Waits for new connection.private static void
setRunning
(boolean isRunning) 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 Details
-
connectionDelegator
-
DEFAULT_PORT
public static final int DEFAULT_PORT- See Also:
-
DEFAULT_ADDRESS
- See Also:
-
theServerSocket
-
provider
-
running
private static boolean running
-
-
Constructor Details
-
ConnectionDelegator
-
-
Method Details
-
initialize
This method is used to create an ConnectionDelegator object and start listener thread- Parameters:
hostname
- host name to open communication withport
- on which open socketprovider
- this is where instrumentation and transformer objects are stored- Returns:
- boolean true if ran correctly, else false
-
run
public void run()Waits for new connection. When client connects starts new worker thread and delegates connection to it -
setRunning
private static void setRunning(boolean isRunning) -
gracefulShutdown
public static void gracefulShutdown()Closes server socket Already connected clients can finish their work but no new clients can connect.
-