Package org.jrd.agent
Class ConnectionDelegator
- java.lang.Object
-
- java.lang.Thread
-
- org.jrd.agent.ConnectionDelegator
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_ADRESS
static int
DEFAULT_PORT
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
gracefulShutdown()
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.-
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
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
DEFAULT_ADRESS
public static final String DEFAULT_ADRESS
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public static boolean initialize(String hostname, Integer port, InstrumentationProvider provider)
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
-
gracefulShutdown
public static void gracefulShutdown()
Closes server socket Already connected clients can finish their work but no new clients can connect.
-
-