|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.grinder.communication.Acceptor
public final class Acceptor
Active object that accepts connections on a ServerSocket.
| Nested Class Summary | |
|---|---|
static interface |
Acceptor.Listener
Listener interface. |
static class |
Acceptor.ShutdownException
Indicates the Acceptor has been shut down. |
| Constructor Summary | |
|---|---|
Acceptor(String addressString,
int port,
int numberOfThreads,
TimeAuthority timeAuthority)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addListener(ConnectionType connectionType,
Acceptor.Listener listener)
Add a new listener. |
int |
getNumberOfConnections()
The number of connections that have been accepted and are still active. |
Exception |
getPendingException()
Asynchronous exception handling. |
int |
getPort()
Get the port this Acceptor is listening on. |
void |
shutdown()
Shut down this acceptor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Acceptor(String addressString,
int port,
int numberOfThreads,
TimeAuthority timeAuthority)
throws CommunicationException
addressString - The TCP address to listen on. Zero-length
string => listen on all interfaces.port - The TCP port to listen to. 0 => use any free port.numberOfThreads - Number of acceptor threads.timeAuthority - Knows the time.
CommunicationException - If server socket could not be
bound.| Method Detail |
|---|
public void shutdown()
throws CommunicationException
CommunicationException - If an IO exception occurs.public int getPort()
public Exception getPendingException()
null if this Acceptor has been shut down.public int getNumberOfConnections()
public void addListener(ConnectionType connectionType,
Acceptor.Listener listener)
connectionType - The connection type.listener - The listener.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||