javax.management.remote.generic
Class GenericConnector

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

public class GenericConnector
extends Object
implements 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 String MESSAGE_CONNECTION
          Name of the attribute that specifies how this connector sends messages to its 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 interface javax.management.remote.JMXConnector
CREDENTIALS
 
Constructor Summary
GenericConnector()
          Default no-arg constructor.
GenericConnector(Map env)
          Constructor specifying connection attributes.
 
Method Summary
 void addConnectionNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
           
 void close()
           
 void connect()
           
 void connect(Map env)
           
 String getConnectionId()
           
 MBeanServerConnection getMBeanServerConnection()
           
 MBeanServerConnection getMBeanServerConnection(Subject delegationSubject)
           
 void removeConnectionNotificationListener(NotificationListener listener)
           
 void removeConnectionNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
           
protected  void sendNotification(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 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 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(Map env)

Constructor specifying connection attributes.

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

connect

public void connect()
             throws IOException
Specified by:
connect in interface JMXConnector
Throws:
IOException

connect

public void connect(Map env)
             throws IOException
Specified by:
connect in interface JMXConnector
Throws:
IOException

getConnectionId

public String getConnectionId()
                       throws IOException
Specified by:
getConnectionId in interface JMXConnector
Throws:
IOException

getMBeanServerConnection

public MBeanServerConnection getMBeanServerConnection()
                                               throws IOException
Specified by:
getMBeanServerConnection in interface JMXConnector
Throws:
IOException

getMBeanServerConnection

public MBeanServerConnection getMBeanServerConnection(Subject delegationSubject)
                                               throws IOException
Specified by:
getMBeanServerConnection in interface JMXConnector
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface JMXConnector
Throws:
IOException

addConnectionNotificationListener

public void addConnectionNotificationListener(NotificationListener listener,
                                              NotificationFilter filter,
                                              Object handback)
Specified by:
addConnectionNotificationListener in interface JMXConnector

removeConnectionNotificationListener

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

removeConnectionNotificationListener

public void removeConnectionNotificationListener(NotificationListener listener,
                                                 NotificationFilter filter,
                                                 Object handback)
                                          throws ListenerNotFoundException
Specified by:
removeConnectionNotificationListener in interface JMXConnector
Throws:
ListenerNotFoundException

sendNotification

protected void sendNotification(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 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

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