com.sun.jmx.remote.socket
Class SocketConnectionServer

java.lang.Object
  extended by com.sun.jmx.remote.socket.SocketConnectionServer
All Implemented Interfaces:
MessageConnectionServer

public class SocketConnectionServer
extends Object
implements MessageConnectionServer

This class uses a Tcp Server Socket to realize a JMX connection server


Constructor Summary
SocketConnectionServer(JMXServiceURL addr, Map env)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketConnectionServer

public SocketConnectionServer(JMXServiceURL addr,
                              Map env)
                       throws IOException
Throws:
IOException
Method Detail

start

public void start(Map env)
           throws IOException
Description copied from interface: MessageConnectionServer

Activates 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.

Specified by:
start in interface MessageConnectionServer
Parameters:
env - the properties of the connector server.
Throws:
IOException - if the server cannot be activated.

accept

public MessageConnection accept()
                         throws IOException
Description copied from interface: MessageConnectionServer

Listens for a connection to be made to this server and accepts it. The method blocks until a connection is made.

Specified by:
accept in interface MessageConnectionServer
Returns:
a new MessageConnection object.
Throws:
IOException - if an I/O error occurs when waiting for a connection.

stop

public void stop()
          throws IOException
Description copied from interface: MessageConnectionServer

Terminates 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.

Specified by:
stop in interface MessageConnectionServer
Throws:
IOException - 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.

getAddress

public JMXServiceURL getAddress()
Description copied from interface: MessageConnectionServer

The address of this connection server.

Specified by:
getAddress in interface MessageConnectionServer
Returns:
the address of this connection server, or null if it does not have one.


Copyright © 2014 Terracotta, Inc.. All rights reserved.