|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.jobagent.JobAgentServerConnection
public class JobAgentServerConnection
This class is used by job agents to listen for incoming requests from client applications.
Nested Class Summary | |
---|---|
private static class |
JobAgentServerConnection.ListenerThread
This class is used for listening to the specified socket for incoming connections. |
private static class |
JobAgentServerConnection.RequestHandlerThread
This class is used for forwarding requests to a RequestHandler . |
Field Summary | |
---|---|
private Thread |
listener
|
private Logger |
logger
|
private int |
port
|
private RequestHandler |
requestHandler
|
Constructor Summary | |
---|---|
JobAgentServerConnection(int port,
RequestHandler requestHandler,
Logger logger)
Create a new server connection. |
Method Summary | |
---|---|
void |
close()
Stop listening for incoming connections. |
boolean |
isListening()
Is a listener active or not for this server. |
void |
open()
Start listening for incoming connections. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final int port
private final RequestHandler requestHandler
private final Logger logger
private Thread listener
Constructor Detail |
---|
public JobAgentServerConnection(int port, RequestHandler requestHandler, Logger logger)
open()
method must be called
to start listening for incoming connections.
port
- The port to listing to for incoming connectionsrequestHandler
- A handler for taking care of incoming requests.
The handler must be thread-safe and able to handle multiple
requests at the same timelogger
- A logger object for logging debug and other information
or null if no logging is wantedMethod Detail |
---|
public void open() throws IOException
RequestHandler
. If a listener
has already been create thi method does nothing.
IOException
- If there is an errorpublic void close()
public boolean isListening()
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |