javax.management.remote.generic
Class GenericConnector

java.lang.Object
  extended by javax.management.remote.generic.GenericConnector
All Implemented Interfaces:
java.io.Closeable, javax.management.remote.JMXConnector
Direct Known Subclasses:
JMXMPConnector

public class GenericConnector
extends java.lang.Object
implements javax.management.remote.JMXConnector

A client connection to a remote JMX API server. This class can use a MessageConnection object to specify the transport for communicating with the server.

User code does not usually instantiate this class. Instead, a JMXConnectorProvider should be added to the JMXConnectorFactory so that users can implicitly instantiate the GenericConnector (or a subclass of it) through the JMXServiceURL provided when connecting.

The specific connector protocol to be used by an instance of this class is specified by attributes in the Map passed to the constructor or the connect method. The attribute MESSAGE_CONNECTION is the standard way to define the transport. An implementation can recognize other attributes to define the transport differently.


Field Summary
static java.lang.String MESSAGE_CONNECTION
          Name of the attribute that specifies how this connector sends messages to its connector server.
static java.lang.String OBJECT_WRAPPING
          Name of the attribute that specifies the object wrapping for parameters whose deserialization requires special treatment.
 
Fields inherited from interface javax.management.remote.JMXConnector
CREDENTIALS
 
Constructor Summary
GenericConnector()
          Default no-arg constructor.
GenericConnector(java.util.Map env)
          Constructor specifying connection attributes.
 
Method Summary
 void addConnectionNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
           
 void close()
           
 void connect()
           
 void connect(java.util.Map env)
           
 java.lang.String getConnectionId()
           
 javax.management.MBeanServerConnection getMBeanServerConnection()
           
 javax.management.MBeanServerConnection getMBeanServerConnection(javax.security.auth.Subject delegationSubject)
           
 void removeConnectionNotificationListener(javax.management.NotificationListener listener)
           
 void removeConnectionNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
           
protected  void sendNotification(javax.management.Notification n)
          Send a notification to the connection listeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBJECT_WRAPPING

public static final java.lang.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.

See Also:
Constant Field Values

MESSAGE_CONNECTION

public static final java.lang.String MESSAGE_CONNECTION

Name of the attribute that specifies how this connector sends messages to its connector server. The value associated with this attribute, if any, must be an object that implements the interface MessageConnection.

See Also:
Constant Field Values
Constructor Detail

GenericConnector

public GenericConnector()

Default no-arg constructor.


GenericConnector

public GenericConnector(java.util.Map env)

Constructor specifying connection attributes.

Parameters:
env - the attributes of the connection.
Method Detail

connect

public void connect()
             throws java.io.IOException
Specified by:
connect in interface javax.management.remote.JMXConnector
Throws:
java.io.IOException

connect

public void connect(java.util.Map env)
             throws java.io.IOException
Specified by:
connect in interface javax.management.remote.JMXConnector
Throws:
java.io.IOException

getConnectionId

public java.lang.String getConnectionId()
                                 throws java.io.IOException
Specified by:
getConnectionId in interface javax.management.remote.JMXConnector
Throws:
java.io.IOException

getMBeanServerConnection

public javax.management.MBeanServerConnection getMBeanServerConnection()
                                                                throws java.io.IOException
Specified by:
getMBeanServerConnection in interface javax.management.remote.JMXConnector
Throws:
java.io.IOException

getMBeanServerConnection

public javax.management.MBeanServerConnection getMBeanServerConnection(javax.security.auth.Subject delegationSubject)
                                                                throws java.io.IOException
Specified by:
getMBeanServerConnection in interface javax.management.remote.JMXConnector
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Specified by:
close in interface javax.management.remote.JMXConnector
Throws:
java.io.IOException

addConnectionNotificationListener

public void addConnectionNotificationListener(javax.management.NotificationListener listener,
                                              javax.management.NotificationFilter filter,
                                              java.lang.Object handback)
Specified by:
addConnectionNotificationListener in interface javax.management.remote.JMXConnector

removeConnectionNotificationListener

public void removeConnectionNotificationListener(javax.management.NotificationListener listener)
                                          throws javax.management.ListenerNotFoundException
Specified by:
removeConnectionNotificationListener in interface javax.management.remote.JMXConnector
Throws:
javax.management.ListenerNotFoundException

removeConnectionNotificationListener

public void removeConnectionNotificationListener(javax.management.NotificationListener listener,
                                                 javax.management.NotificationFilter filter,
                                                 java.lang.Object handback)
                                          throws javax.management.ListenerNotFoundException
Specified by:
removeConnectionNotificationListener in interface javax.management.remote.JMXConnector
Throws:
javax.management.ListenerNotFoundException

sendNotification

protected void sendNotification(javax.management.Notification n)

Send a notification to the connection listeners. The notification will be sent to every listener added with addConnectionNotificationListener that was not subsequently removed by a removeConnectionNotificationListener, provided the corresponding NotificationFilter matches.

Parameters:
n - the notification to send. This will usually be a JMXConnectionNotification, but an implementation can send other notifications as well.

Open Source build 01-ea
opendmk-1.0-b01-ea 2010.10.22_13:26:06_UTC

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.