public class SocketConnectionServer extends Object implements MessageConnectionServer
| Constructor and Description |
|---|
SocketConnectionServer(JMXServiceURL addr,
Map env) |
| Modifier and Type | Method and Description |
|---|---|
MessageConnection |
accept()
Listens for a connection to be made to this server and
accepts it.
|
JMXServiceURL |
getAddress()
The address of this connection server.
|
void |
start(Map env)
Activates this server for new client connections.
|
void |
stop()
Terminates this server.
|
public SocketConnectionServer(JMXServiceURL addr, Map env) throws IOException
IOExceptionpublic void start(Map env) throws IOException
MessageConnectionServerActivates this server for new client connections. Before this call is made, new client connections are not accepted. The behavior is unspecified if this method is called more than once.
start in interface MessageConnectionServerenv - the properties of the connector server.IOException - if the server cannot be activated.public MessageConnection accept() throws IOException
MessageConnectionServerListens for a connection to be made to this server and accepts it. The method blocks until a connection is made.
accept in interface MessageConnectionServerMessageConnection object.IOException - if an I/O error occurs when waiting for
a connection.public void stop()
throws IOException
MessageConnectionServerTerminates this server. On return from this method, new
connection attempts are refused. Existing connections are
unaffected by this call. The behavior is unspecified if
this method is called before the MessageConnectionServer.start(java.util.Map) method.
stop in interface MessageConnectionServerIOException - if an I/O error occurs when stopping the
server. A best effort will have been made to clean up the
server's resources. The caller will not call MessageConnectionServer.accept()
after stop(), whether or not it gets
IOException.public JMXServiceURL getAddress()
MessageConnectionServerThe address of this connection server.
getAddress in interface MessageConnectionServerCopyright © 2019 Terracotta, Inc.. All rights reserved.