org.apache.hadoop.chukwa.datacollection.agent
Class AgentControlSocketListener
java.lang.Object
java.lang.Thread
org.apache.hadoop.chukwa.datacollection.agent.AgentControlSocketListener
- All Implemented Interfaces:
- Runnable
public class AgentControlSocketListener
- extends Thread
Class to handle the agent control protocol. This is a simple line-oriented
ASCII protocol, that is designed to be easy to work with both
programmatically and via telnet.
The port to bind to can be specified by setting option
chukwaAgent.agent.control.port. A port of 0 creates a socket on any free
port.
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, 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, yield |
agent
protected ChukwaAgent agent
portno
protected int portno
s
protected ServerSocket s
ALLOW_REMOTE
public boolean ALLOW_REMOTE
REMOTE_ACCESS_OPT
public static final String REMOTE_ACCESS_OPT
- See Also:
- Constant Field Values
AgentControlSocketListener
public AgentControlSocketListener(ChukwaAgent agent)
- Initializes listener, but does not bind to socket.
- Parameters:
a
- the agent to control
run
public void run()
- Binds to socket, starts looping listening for commands
- Specified by:
run
in interface Runnable
- Overrides:
run
in class Thread
shutdown
public void shutdown()
- Close the control socket, and exit. Triggers graceful thread shutdown.
isBound
public boolean isBound()
tryToBind
public void tryToBind()
throws IOException
- Throws:
IOException
getPort
public int getPort()
getStatusLine
public String getStatusLine()
Copyright © ${year} The Apache Software Foundation