## org.jboss.jmx.client
Class RMIClientConnectorImpl

    java.lang.Object
      |
      +--org.jboss.jmx.client.RMIClientConnectorImpl

All Implemented Interfaces:
  JMXConnector, JMXConnectorMBean, RMIClientConnectorImplMBean

public class RMIClientConnectorImpl
extends java.lang.Object
implements JMXConnectorMBean, RMIClientConnectorImplMBean

Implementation of the JMX Connector over the RMI protocol

Author:
  Rickard Öberg (rickard.oberg@telkel.com), Andreas "Mad" Schaefer

Inner Class Summary
`class` `RMIClientConnectorImpl.Listener` Listener wrapper around the remote RMI Notification Listener

Constructor Summary
`RMIClientConnectorImpl(java.lang.String pServerName)`

Method Summary
`void` `addNotificationListener(javax.management.ObjectName pName, javax.management.NotificationListener pListener, javax.management.NotificationFilter pFilter, java.lang.Object pHandback)` Adds the given Notification Listener in a way that the Notification Events are send back to the listener Please asume that the listening is terminated when the instance of these interface goes down.
`void` `addNotificationListener(javax.management.ObjectName pName, javax.management.ObjectName pListener, javax.management.NotificationFilter pFilter, java.lang.Object pHandback)`
`javax.management.ObjectInstance` `createMBean(java.lang.String pClassName, javax.management.ObjectName pName)`
`javax.management.ObjectInstance` `createMBean(java.lang.String pClassName, javax.management.ObjectName pName, java.lang.Object[] pParams, java.lang.String[] pSignature)` Instantiates the given class and registers it on the remote MBeanServer and returns an Object Instance of the MBean.
`javax.management.ObjectInstance` `createMBean(java.lang.String pClassName, javax.management.ObjectName pName, javax.management.ObjectName pLoaderName)`
`javax.management.ObjectInstance` `createMBean(java.lang.String pClassName, javax.management.ObjectName pName, javax.management.ObjectName pLoaderName, java.lang.Object[] pParams, java.lang.String[] pSignature)`
`java.io.ObjectInputStream` `deserialize(javax.management.ObjectName pName, byte[] pData)`
`java.io.ObjectInputStream` `deserialize(java.lang.String pClassName, byte[] pData)`
`java.io.ObjectInputStream` `deserialize(java.lang.String pClassName, javax.management.ObjectName pLoaderName, byte[] pData)`
`java.lang.Object` `getAttribute(javax.management.ObjectName pName, java.lang.String pAttribute)`
`javax.management.AttributeList` `getAttributes(javax.management.ObjectName pName, java.lang.String[] pAttributes)`
`java.lang.String` `getDefaultDomain()`
`java.lang.Integer` `getMBeanCount()`
`javax.management.MBeanInfo` `getMBeanInfo(javax.management.ObjectName pName)`
`javax.management.ObjectInstance` `getObjectInstance(javax.management.ObjectName pName)`
`java.lang.String` `getServerDescription()` Delivers the actual server description to which the client is connected to
`java.lang.Object` `instantiate(java.lang.String pClassName)` Instantiate the given class on the remote MBeanServer and returns a Object Handler you can use to register it as a MBean with `registerMBean()` or as a parameter to createMBean() or instantiate() method which takes it as a parameter.
`java.lang.Object` `instantiate(java.lang.String pClassName, java.lang.Object[] pParams, java.lang.String[] pSignature)` Instantiate the given class on the remote MBeanServer and returns a Object Handler you can use to register it as a MBean with `registerMBean()`
`java.lang.Object` `instantiate(java.lang.String pClassName, javax.management.ObjectName pLoaderName)`
`java.lang.Object` `instantiate(java.lang.String pClassName, javax.management.ObjectName pLoaderName, java.lang.Object[] pParams, java.lang.String[] pSignature)`
`java.lang.Object` `invoke(javax.management.ObjectName pName, java.lang.String pActionName, java.lang.Object[] pParams, java.lang.String[] pSignature)`
`boolean` `isAlive()` Indicates if the connection is alive and ready to serve
`boolean` `isInstanceOf(javax.management.ObjectName pName, java.lang.String pClassName)`
`boolean` `isRegistered(javax.management.ObjectName pName)`
`java.util.Set` `queryMBeans(javax.management.ObjectName pName, javax.management.QueryExp pQuery)`
`java.util.Set` `queryNames(javax.management.ObjectName pName, javax.management.QueryExp pQuery)`
`javax.management.ObjectInstance` `registerMBean(java.lang.Object pObject, javax.management.ObjectName pName)` Register the given Object (already instantiated) as a MBean on the remote MBeanServer
`void` `removeNotificationListener(javax.management.ObjectName pName, javax.management.NotificationListener pListener)` Remoes the given Notification Listener in a way that all involved instances are removed and the remote listener is removed from the broadcaster.
`void` `removeNotificationListener(javax.management.ObjectName pName, javax.management.ObjectName pListener)`
`void` `setAttribute(javax.management.ObjectName pName, javax.management.Attribute pAttribute)`
`javax.management.AttributeList` `setAttributes(javax.management.ObjectName pName, javax.management.AttributeList pAttributes)`
`void` `start(java.lang.Object pServer)` Initialize the client connector to a given server side JMX Connector
`void` `stop()` Stops the client connector, remove the remote connection and frees the resources.
`void` `unregisterMBean(javax.management.ObjectName pName)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RMIClientConnectorImpl

    public RMIClientConnectorImpl(java.lang.String pServerName)

Method Detail

### start

    public void start(java.lang.Object pServer)
               throws java.lang.IllegalArgumentException

  Description copied from interface: `JMXConnectorMBean`
  Initialize the client connector to a given server side JMX Connector
  Specified by:
    `start` in interface `JMXConnectorMBean`
  Following copied from interface: `org.jboss.jmx.interfaces.JMXConnectorMBean`
  Parameters:
    `pServer` - Server indentification (because I do not know the necessary type for a general server ident. I choose Object)
  Throws:
    `java.lang.IllegalArgumentException` - If the given server is not valid or not recognized by the connector implementation

### stop

    public void stop()

  Description copied from interface: `JMXConnectorMBean`
  Stops the client connector, remove the remote connection and frees the resources.
  Specified by:
    `stop` in interface `JMXConnectorMBean`

### isAlive

    public boolean isAlive()

  Description copied from interface: `JMXConnectorMBean`
  Indicates if the connection is alive and ready to serve
  Specified by:
    `isAlive` in interface `JMXConnectorMBean`
  Following copied from interface: `org.jboss.jmx.interfaces.JMXConnectorMBean`
  Returns:
    True if the connection is alive

### getServerDescription

    public java.lang.String getServerDescription()

  Description copied from interface: `JMXConnectorMBean`
  Delivers the actual server description to which the client is connected to
  Specified by:
    `getServerDescription` in interface `JMXConnectorMBean`
  Following copied from interface: `org.jboss.jmx.interfaces.JMXConnectorMBean`
  Returns:
    Description of the server the client is connected to or null if there is no connection

### instantiate

    public java.lang.Object instantiate(java.lang.String pClassName)
                                 throws javax.management.ReflectionException,
                                        javax.management.MBeanException

  Description copied from interface: `JMXConnector`
  Instantiate the given class on the remote MBeanServer and returns a Object Handler you can use to register it as a MBean with `registerMBean()` or as a parameter to createMBean() or instantiate() method which takes it as a parameter.
  Specified by:
    `instantiate` in interface `JMXConnector`
  Following copied from interface: `org.jboss.jmx.interfaces.JMXConnector`
  Parameters:
    `pClassName` - Class name of the class to be loaded and instantiated
  Returns:
    Object handler. Please use this handler to register it as MBean or as a parameter in the other methods as a parameter. The server-side connector will look up for an object handler parameter and then replace the object handler by the effective object.

### instantiate

    public java.lang.Object instantiate(java.lang.String pClassName,
                                        javax.management.ObjectName pLoaderName)
                                 throws javax.management.ReflectionException,
                                        javax.management.MBeanException,
                                        javax.management.InstanceNotFoundException

  Specified by:
    `instantiate` in interface `JMXConnector`

### instantiate

    public java.lang.Object instantiate(java.lang.String pClassName,
                                        java.lang.Object[] pParams,
                                        java.lang.String[] pSignature)
                                 throws javax.management.ReflectionException,
                                        javax.management.MBeanException

  Description copied from interface: `JMXConnector`
  Instantiate the given class on the remote MBeanServer and returns a Object Handler you can use to register it as a MBean with `registerMBean()`
  Specified by:
    `instantiate` in interface `JMXConnector`
  Following copied from interface: `org.jboss.jmx.interfaces.JMXConnector`
  Parameters:
    `pClassName` - Class name of the class to be loaded and instantiated
    `pParams` - Array of parameter passed to the creator of the class. If one is of data type Object handler it will be replaced on the server-side by its effective object.
    `pSignature` - Array of Class Names (full qualified) to find the right parameter. When there is an ObjectHandler as a parameter type then it will be replaced on the server- side by the class name of the effective object) otherwise it will be kept.
  Returns:
    Object handler. Please use this handler to register it as MBean or as a parameter in the other methods as a parameter. The server-side connector will look up for an object handler parameter and then replace the object handler by the effective object.

### instantiate

    public java.lang.Object instantiate(java.lang.String pClassName,
                                        javax.management.ObjectName pLoaderName,
                                        java.lang.Object[] pParams,
                                        java.lang.String[] pSignature)
                                 throws javax.management.ReflectionException,
                                        javax.management.MBeanException,
                                        javax.management.InstanceNotFoundException

  Specified by:
    `instantiate` in interface `JMXConnector`

### createMBean

    public javax.management.ObjectInstance createMBean(java.lang.String pClassName,
                                                       javax.management.ObjectName pName)
                                                throws javax.management.ReflectionException,
                                                       javax.management.InstanceAlreadyExistsException,
                                                       javax.management.MBeanRegistrationException,
                                                       javax.management.MBeanException,
                                                       javax.management.NotCompliantMBeanException

  Specified by:
    `createMBean` in interface `JMXConnector`

### createMBean

    public javax.management.ObjectInstance createMBean(java.lang.String pClassName,
                                                       javax.management.ObjectName pName,
                                                       javax.management.ObjectName pLoaderName)
                                                throws javax.management.ReflectionException,
                                                       javax.management.InstanceAlreadyExistsException,
                                                       javax.management.MBeanRegistrationException,
                                                       javax.management.MBeanException,
                                                       javax.management.NotCompliantMBeanException,
                                                       javax.management.InstanceNotFoundException

  Specified by:
    `createMBean` in interface `JMXConnector`

### createMBean

    public javax.management.ObjectInstance createMBean(java.lang.String pClassName,
                                                       javax.management.ObjectName pName,
                                                       java.lang.Object[] pParams,
                                                       java.lang.String[] pSignature)
                                                throws javax.management.ReflectionException,
                                                       javax.management.InstanceAlreadyExistsException,
                                                       javax.management.MBeanRegistrationException,
                                                       javax.management.MBeanException,
                                                       javax.management.NotCompliantMBeanException

  Description copied from interface: `JMXConnector`
  Instantiates the given class and registers it on the remote MBeanServer and returns an Object Instance of the MBean.
  Specified by:
    `createMBean` in interface `JMXConnector`
  Following copied from interface: `org.jboss.jmx.interfaces.JMXConnector`
  Parameters:
    `pClassName` - Class name of the class to be loaded and instantiated
    `pNameToAssign` - Object Name the new MBean should be assigned to
    `pParams` - Array of parameter passed to the creator of the class. If one is of data type Object handler it will be replaced on the server-side by its effective object.
    `pSignature` - Array of Class Names (full qualified) to find the right parameter. When there is an ObjectHandler as a parameter type then it will be replaced on the server- side by the class name of the effective object) otherwise it will be kept.
  Returns:
    Object Instance of the new MBean

### createMBean

    public javax.management.ObjectInstance createMBean(java.lang.String pClassName,
                                                       javax.management.ObjectName pName,
                                                       javax.management.ObjectName pLoaderName,
                                                       java.lang.Object[] pParams,
                                                       java.lang.String[] pSignature)
                                                throws javax.management.ReflectionException,
                                                       javax.management.InstanceAlreadyExistsException,
                                                       javax.management.MBeanRegistrationException,
                                                       javax.management.MBeanException,
                                                       javax.management.NotCompliantMBeanException,
                                                       javax.management.InstanceNotFoundException

  Specified by:
    `createMBean` in interface `JMXConnector`

### registerMBean

    public javax.management.ObjectInstance registerMBean(java.lang.Object pObject,
                                                         javax.management.ObjectName pName)
                                                  throws javax.management.InstanceAlreadyExistsException,
                                                         javax.management.MBeanRegistrationException,
                                                         javax.management.NotCompliantMBeanException

  Description copied from interface: `JMXConnector`
  Register the given Object (already instantiated) as a MBean on the remote MBeanServer
  Specified by:
    `registerMBean` in interface `JMXConnector`
  Following copied from interface: `org.jboss.jmx.interfaces.JMXConnector`
  Parameters:
    `pObjectHandler` - Object Handler of th given object to register as MBean
    `pNaemToAssign` - Object Name to MBean is assigned to
  Returns:
    Object Instance of the new MBean

### unregisterMBean

    public void unregisterMBean(javax.management.ObjectName pName)
                         throws javax.management.InstanceNotFoundException,
                                javax.management.MBeanRegistrationException

  Specified by:
    `unregisterMBean` in interface `JMXConnector`

### getObjectInstance

    public javax.management.ObjectInstance getObjectInstance(javax.management.ObjectName pName)
                                                      throws javax.management.InstanceNotFoundException

  Specified by:
    `getObjectInstance` in interface `JMXConnector`

### queryMBeans

    public java.util.Set queryMBeans(javax.management.ObjectName pName,
                                     javax.management.QueryExp pQuery)

  Specified by:
    `queryMBeans` in interface `JMXConnector`

### queryNames

    public java.util.Set queryNames(javax.management.ObjectName pName,
                                    javax.management.QueryExp pQuery)

  Specified by:
    `queryNames` in interface `JMXConnector`

### isRegistered

    public boolean isRegistered(javax.management.ObjectName pName)

  Specified by:
    `isRegistered` in interface `JMXConnector`

### isInstanceOf

    public boolean isInstanceOf(javax.management.ObjectName pName,
                                java.lang.String pClassName)
                         throws javax.management.InstanceNotFoundException

  Specified by:
    `isInstanceOf` in interface `JMXConnector`

### getMBeanCount

    public java.lang.Integer getMBeanCount()

  Specified by:
    `getMBeanCount` in interface `JMXConnector`

### getAttribute

    public java.lang.Object getAttribute(javax.management.ObjectName pName,
                                         java.lang.String pAttribute)
                                  throws javax.management.MBeanException,
                                         javax.management.AttributeNotFoundException,
                                         javax.management.InstanceNotFoundException,
                                         javax.management.ReflectionException

  Specified by:
    `getAttribute` in interface `JMXConnector`

### getAttributes

    public javax.management.AttributeList getAttributes(javax.management.ObjectName pName,
                                                        java.lang.String[] pAttributes)
                                                 throws javax.management.InstanceNotFoundException,
                                                        javax.management.ReflectionException

  Specified by:
    `getAttributes` in interface `JMXConnector`

### setAttribute

    public void setAttribute(javax.management.ObjectName pName,
                             javax.management.Attribute pAttribute)
                      throws javax.management.InstanceNotFoundException,
                             javax.management.AttributeNotFoundException,
                             javax.management.InvalidAttributeValueException,
                             javax.management.MBeanException,
                             javax.management.ReflectionException

  Specified by:
    `setAttribute` in interface `JMXConnector`

### setAttributes

    public javax.management.AttributeList setAttributes(javax.management.ObjectName pName,
                                                        javax.management.AttributeList pAttributes)
                                                 throws javax.management.InstanceNotFoundException,
                                                        javax.management.ReflectionException

  Specified by:
    `setAttributes` in interface `JMXConnector`

### invoke

    public java.lang.Object invoke(javax.management.ObjectName pName,
                                   java.lang.String pActionName,
                                   java.lang.Object[] pParams,
                                   java.lang.String[] pSignature)
                            throws javax.management.InstanceNotFoundException,
                                   javax.management.MBeanException,
                                   javax.management.ReflectionException

  Specified by:
    `invoke` in interface `JMXConnector`

### getDefaultDomain

    public java.lang.String getDefaultDomain()

  Specified by:
    `getDefaultDomain` in interface `JMXConnector`

### addNotificationListener

    public void addNotificationListener(javax.management.ObjectName pName,
                                        javax.management.NotificationListener pListener,
                                        javax.management.NotificationFilter pFilter,
                                        java.lang.Object pHandback)
                                 throws javax.management.InstanceNotFoundException

  Description copied from interface: `JMXConnector`
  Adds the given Notification Listener in a way that the Notification Events are send back to the listener
  Please asume that the listening is terminated when the instance of these interface goes down.
  Specified by:
    `addNotificationListener` in interface `JMXConnector`
  Following copied from interface: `org.jboss.jmx.interfaces.JMXConnector`
  Parameters:
    `pBroadcasterName` - Name of the Broadcaster MBean on the remote side
    `pListener` - Local notification listener
    `pFilter` - In general there are three ways this could work: 1) A copy of the filter is send to the server but then the Filter cannot interact with the client. This is default. 2) Wrapper around the filter therefore the server sends the filter call to the client to be performed. This filter must be a subclass of RemoteNotificationListener. 3) All Notification events are sent to the client and the client performs the filtering. This filter must be a subclass of LocalNotificationListener.
    `pHandback` - Object to be send back to the listener. To make it complete transparent to the client an Object Handler is sent to the Server and and when a Notification comes back it will be looked up and send to the client. Therefore it must not be serializable.

### addNotificationListener

    public void addNotificationListener(javax.management.ObjectName pName,
                                        javax.management.ObjectName pListener,
                                        javax.management.NotificationFilter pFilter,
                                        java.lang.Object pHandback)
                                 throws javax.management.InstanceNotFoundException,
                                        java.lang.UnsupportedOperationException

  Specified by:
    `addNotificationListener` in interface `JMXConnector`
  Following copied from interface: `org.jboss.jmx.interfaces.JMXConnector`
  Throws:
    `java.lang.UnsupportedOperationException` - The MBean related to the given object cannot be wrapped by the transport layer implementation and therefore it makes no sense (no callback could be instantiated) and therefore this exception is always thrown

### removeNotificationListener

    public void removeNotificationListener(javax.management.ObjectName pName,
                                           javax.management.NotificationListener pListener)
                                    throws javax.management.InstanceNotFoundException,
                                           javax.management.ListenerNotFoundException

  Description copied from interface: `JMXConnector`
  Remoes the given Notification Listener in a way that all involved instances are removed and the remote listener is removed from the broadcaster.
  Please asume that the listening is terminated when the instance of these interface goes down.
  Specified by:
    `removeNotificationListener` in interface `JMXConnector`
  Following copied from interface: `org.jboss.jmx.interfaces.JMXConnector`
  Parameters:
    `pBroadcasterName` - Name of the Broadcaster MBean on the remote side
    `pListener` - Local notification listener

### removeNotificationListener

    public void removeNotificationListener(javax.management.ObjectName pName,
                                           javax.management.ObjectName pListener)
                                    throws javax.management.InstanceNotFoundException,
                                           javax.management.ListenerNotFoundException,
                                           java.lang.UnsupportedOperationException

  Specified by:
    `removeNotificationListener` in interface `JMXConnector`
  Following copied from interface: `org.jboss.jmx.interfaces.JMXConnector`
  Throws:
    `java.lang.UnsupportedOperationException` - The MBean related to the given object cannot be wrapped by the transport layer which prevents the remove of the the wrapper and therefore it makes no sense (no callback could be instantiated) and therefore this exception is always thrown

### getMBeanInfo

    public javax.management.MBeanInfo getMBeanInfo(javax.management.ObjectName pName)
                                            throws javax.management.InstanceNotFoundException,
                                                   javax.management.IntrospectionException,
                                                   javax.management.ReflectionException

  Specified by:
    `getMBeanInfo` in interface `JMXConnector`

### deserialize

    public java.io.ObjectInputStream deserialize(javax.management.ObjectName pName,
                                                 byte[] pData)
                                          throws javax.management.InstanceNotFoundException,
                                                 javax.management.OperationsException,
                                                 java.lang.UnsupportedOperationException

  Specified by:
    `deserialize` in interface `JMXConnector`
  Following copied from interface: `org.jboss.jmx.interfaces.JMXConnector`
  Throws:
    `java.lang.UnsupportedOperationException` - Return value is not serializable and the operation makes really no sense on a connector therefore this exception is always thrown

### deserialize

    public java.io.ObjectInputStream deserialize(java.lang.String pClassName,
                                                 byte[] pData)
                                          throws javax.management.OperationsException,
                                                 javax.management.ReflectionException,
                                                 java.lang.UnsupportedOperationException

  Specified by:
    `deserialize` in interface `JMXConnector`
  Following copied from interface: `org.jboss.jmx.interfaces.JMXConnector`
  Throws:
    `java.lang.UnsupportedOperationException` - Return value is not serializable and the operation makes really no sense on a connector therefore this exception is always thrown

### deserialize

    public java.io.ObjectInputStream deserialize(java.lang.String pClassName,
                                                 javax.management.ObjectName pLoaderName,
                                                 byte[] pData)
                                          throws javax.management.InstanceNotFoundException,
                                                 javax.management.OperationsException,
                                                 javax.management.ReflectionException,
                                                 java.lang.UnsupportedOperationException

  Specified by:
    `deserialize` in interface `JMXConnector`
  Following copied from interface: `org.jboss.jmx.interfaces.JMXConnector`
  Throws:
    `java.lang.UnsupportedOperationException` - Return value is not serializable and the operation makes really no sense on a connector therefore this exception is always thrown

Copyright Š 2000 The JBoss Organization. All Rights Reserved.