|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectConnectionManager
public class ConnectionManager
The Utool main program for accessing the Domgraph functionality in server mode. Utool ("Underspecification Tool") is the Swiss Army Knife of Underspecification (Java version). This version will accept commands in XML format from a socket. It is started by calling the command-line version with command "server".
The operation of this class is described in more detail in the end-user documentation of Utool.
Technically, the class ConnectionManager
is only
responsible for accepting a new socket connection. It then
starts a ServerThread
, which does all the work
of XML parsing and domgraph computations.
Nested Class Summary | |
---|---|
static class |
ConnectionManager.State
|
static interface |
ConnectionManager.StateChangeListener
|
Constructor Summary | |
---|---|
ConnectionManager()
|
Method Summary | |
---|---|
static void |
addListener(ConnectionManager.StateChangeListener listener)
Adds a state change listener to this server. |
static ConnectionManager.State |
getState()
Returns the current state of the server (RUNNING or STOPPED). |
static void |
removeListener(ConnectionManager.StateChangeListener listener)
|
static void |
startServer(AbstractOptions cmdlineOptions)
Starts the Utool Server. |
static void |
stopServer()
Stops a running Utool Server. |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConnectionManager()
Method Detail |
---|
public static void startServer(AbstractOptions cmdlineOptions) throws IOException
cmdlineOptions
, and accepts connections
from clients on this port. It will then spawn a new thread for dealing
with this particular client and go back to accepting more connections.
This method doesn't return under normal circumstances. You will probably
want to run it in a new thread of its own, which also takes care of
catching the IOException that this method can throw.
If an I/O error occurs in this method, it will throw the IOException
that was thrown by the method that encountered the problem. In this case,
the server and all client-specific threads will be shut down, as per
the stopServer
method below.
This method sets the server state to RUNNING
while it
accepts connections. It will also notify all connected state change
listeners of the change to the RUNNING
state.
cmdlineOptions
- - an AbstractOptions object that defines the
"port", "hasOptionLogging", "getLogWriter", and "hasOptionWarmup" options.
IOException
public static void stopServer()
This method sets the server state to STOPPED
.
It will also notify all connected state change
listeners of the change to the STOPPED
state.
public static ConnectionManager.State getState()
public static void addListener(ConnectionManager.StateChangeListener listener)
stateChanged
method will be called each time the
server's state changes.
listener
- a listenerpublic static void removeListener(ConnectionManager.StateChangeListener listener)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |