|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.management.NotificationBroadcasterSupport
javax.management.remote.JMXConnectorServer
javax.management.remote.generic.GenericConnectorServer
A JMX API Connector server that creates connections to remote
clients. This class can use a MessageConnectionServer
object
to specify how connections are made.
User code does not usually instantiate this class. Instead, a
JMXConnectorServerProvider
should be added to the JMXConnectorServerFactory
so that users can implicitly instantiate
the GenericConnector (or a subclass of it) through the JMXServiceURL
provided when creating it.
The specific connector protocol to be used by an instance of
this class is specified by attributes in the Map
passed to the constructor. The attribute MESSAGE_CONNECTION_SERVER
is the standard way to define the
transport. An implementation can recognize other attributes to
define the transport differently.
Field Summary | |
static String |
MESSAGE_CONNECTION_SERVER
Name of the attribute that specifies how connections are made to this connector server. |
static String |
OBJECT_WRAPPING
Name of the attribute that specifies the object wrapping for parameters whose deserialization requires special treatment. |
Fields inherited from class javax.management.remote.JMXConnectorServer |
AUTHENTICATOR |
Constructor Summary | |
GenericConnectorServer(Map env,
MBeanServer mbs)
Constructs a GenericConnectorServer attached to
the given MBean server. |
Method Summary | |
JMXServiceURL |
getAddress()
The address of this connector server. |
Map |
getAttributes()
The attributes for this connector server. |
boolean |
isActive()
Determines whether the connector server is active. |
void |
start()
Activates the connector server, that is, starts listening for client connections. |
void |
stop()
Deactivates the connector server, that is, stops listening for client connections. |
Methods inherited from class javax.management.remote.JMXConnectorServer |
connectionClosed, connectionFailed, connectionOpened, getConnectionIds, getMBeanServer, getNotificationInfo, postDeregister, postRegister, preDeregister, preRegister, setMBeanServerForwarder, toJMXConnector |
Methods inherited from class javax.management.NotificationBroadcasterSupport |
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String OBJECT_WRAPPING
Name of the attribute that specifies the object wrapping for
parameters whose deserialization requires special treatment.
The value associated with this attribute, if any, must be an
object that implements the interface ObjectWrapping
.
public static final String MESSAGE_CONNECTION_SERVER
Name of the attribute that specifies how connections are
made to this connector server. The value associated with this
attribute, if any, must be an object that implements the
interface MessageConnectionServer
.
Constructor Detail |
public GenericConnectorServer(Map env, MBeanServer mbs)
Constructs a GenericConnectorServer
attached to
the given MBean server.
env
- a set of attributes for the connector server. Can
be null, which is equivalent to an empty map.mbs
- the local MBeanServer used to execute a remote
request. Null if the MBean server will be specified by
registering this connector server as an MBean in it.
IllegalArgumentException
- if env contains
some invalid values.Method Detail |
public JMXServiceURL getAddress()
JMXConnectorServerMBean
The address of this connector server.
public Map getAttributes()
JMXConnectorServerMBean
The attributes for this connector server.
public void start() throws IOException
Activates the connector server, that is, starts listening for
client connections. Calling this method when the connector
server is already active has no effect. Calling this method
when the connector server has been stopped will generate an
IOException
.
IllegalStateException
- if the connector server has
not been attached to an MBean server.
IOException
- if the connector server cannot be
started.public void stop() throws IOException
JMXConnectorServerMBean
Deactivates the connector server, that is, stops listening for client connections. Calling this method will also close all client connections that were made by this server. After this method returns, whether normally or with an exception, the connector server will not create any new client connections.
Once a connector server has been stopped, it cannot be started again.
Calling this method when the connector server has already been stopped has no effect. Calling this method when the connector server has not yet been started will disable the connector server object permanently.
If closing a client connection produces an exception, that
exception is not thrown from this method. A JMXConnectionNotification
with type JMXConnectionNotification.FAILED
is emitted from this MBean
with the connection ID of the connection that could not be
closed.
Closing a connector server is a potentially slow operation. For example, if a client machine with an open connection has crashed, the close operation might have to wait for a network protocol timeout. Callers that do not want to block in a close operation should do it in a separate thread.
IOException
- if the server cannot be closed cleanly.
When this exception is thrown, the server has already attempted
to close all client connections. All client connections are
closed except possibly those that generated exceptions when the
server attempted to close them.public boolean isActive()
JMXConnectorServerMBean
Determines whether the connector server is active. A connector
server starts being active when its start
method
returns successfully and remains active until either its
stop
method is called or the connector server
fails.
|
JMX Remote API Specification 1.0 Final Release Generated from RI build jmxremote-1_0_1_03-b57.2 2005.11.28_17:40:34_MET |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |