|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.abstracthorizon.extend.server.support.Control
public class Control
Little control class that knows how gracefully to shutdown the spring application server.
Field Summary | |
---|---|
protected InetAddress |
address
Address to bind to |
protected org.slf4j.Logger |
logger
Logger |
static String |
MAGIC
String that must be passed down the socket for control to react |
protected int |
port
Local port control class is going to wait for signal to shutdown the server. |
protected SpringBasedServer |
server
Reference to the server instance |
protected ServerSocket |
serverSocket
Server socket this control is operating on |
protected Thread |
thread
Thread this control class is going to run under |
Constructor Summary | |
---|---|
Control()
Empty constructor |
Method Summary | |
---|---|
InetAddress |
getAddress()
Returns bind address |
int |
getPort()
Returns the port control is going to run on |
SpringBasedServer |
getServer()
Reference to the server instance |
protected String |
processLine(String line)
|
void |
run()
Main method |
void |
setAddress(InetAddress address)
Sets bind address |
void |
setPort(int port)
Sets the port control is going to run on |
void |
setServer(SpringBasedServer server)
Sets reference to the server instance |
void |
shutdownServer()
Stops the server invoking stop and destory methods. |
void |
start()
Starts the thread |
void |
stop()
Signals the thread that it should stop as soon as possible |
protected void |
writeControlFile()
This method writes control file with server socket's port number |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String MAGIC
protected final org.slf4j.Logger logger
protected int port
protected Thread thread
protected SpringBasedServer server
protected ServerSocket serverSocket
protected InetAddress address
Constructor Detail |
---|
public Control()
Method Detail |
---|
public void start()
public void stop()
public void run()
run
in interface Runnable
public int getPort()
public void setPort(int port)
port
- the port control is going to run onpublic InetAddress getAddress()
public void setAddress(InetAddress address)
address
- bind addresspublic SpringBasedServer getServer()
public void setServer(SpringBasedServer server)
server
- the server instancepublic void shutdownServer()
protected void writeControlFile()
protected String processLine(String line)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |