## mx4j.tools.remote
Class JMXConnectionHandler

    java.lang.Object
      mx4j.tools.remote.AbstractConnection
          mx4j.tools.remote.JMXConnectionHandler

All Implemented Interfaces:
  Connection, JMXConnection

Direct Known Subclasses:
  HTTPConnectionHandler

public abstract class JMXConnectionHandler
extends AbstractConnection
implements JMXConnection

This handler manages the operations related to the connection itself, such as `close()`, `AbstractConnection.getConnectionId()`.

It is important that this object is the outermost wrapper of the Connection objects returned by `ConnectionManager.connect(java.lang.Object)`

Version:
  $Revision: 1.3 $

Constructor Summary
`JMXConnectionHandler(JMXConnection connection, ConnectionManager manager, java.lang.String connectionId)`

Method Summary
`void` `addNotificationListener(javax.management.ObjectName name, javax.management.ObjectName listener, java.lang.Object filter, java.lang.Object handback, javax.security.auth.Subject delegate)`
`void` `close()` Overridden to allow nested connections to close and release their resources and, afterwards, to close this connection with the JSR 160 semantic provided by the superclass.
`javax.management.ObjectInstance` `createMBean(java.lang.String className, javax.management.ObjectName name, javax.management.ObjectName loaderName, java.lang.Object params, java.lang.String[] signature, javax.security.auth.Subject delegate)`
`javax.management.ObjectInstance` `createMBean(java.lang.String className, javax.management.ObjectName name, java.lang.Object params, java.lang.String[] signature, javax.security.auth.Subject delegate)`
`java.lang.Object` `getAttribute(javax.management.ObjectName name, java.lang.String attribute, javax.security.auth.Subject delegate)`
`javax.management.AttributeList` `getAttributes(javax.management.ObjectName name, java.lang.String[] attributes, javax.security.auth.Subject delegate)`
`protected JMXConnection` `getConnection()`
`java.lang.String` `getDefaultDomain(javax.security.auth.Subject delegate)`
`java.lang.String[]` `getDomains(javax.security.auth.Subject delegate)`
`java.lang.Integer` `getMBeanCount(javax.security.auth.Subject delegate)`
`javax.management.MBeanInfo` `getMBeanInfo(javax.management.ObjectName name, javax.security.auth.Subject delegate)`
`javax.management.ObjectInstance` `getObjectInstance(javax.management.ObjectName name, javax.security.auth.Subject delegate)`
`java.lang.Object` `invoke(javax.management.ObjectName name, java.lang.String operationName, java.lang.Object params, java.lang.String[] signature, javax.security.auth.Subject delegate)`
`protected boolean` `isClosed()`
`boolean` `isInstanceOf(javax.management.ObjectName name, java.lang.String className, javax.security.auth.Subject delegate)`
`boolean` `isRegistered(javax.management.ObjectName name, javax.security.auth.Subject delegate)`
`java.util.Set` `queryMBeans(javax.management.ObjectName name, java.lang.Object query, javax.security.auth.Subject delegate)`
`java.util.Set` `queryNames(javax.management.ObjectName name, java.lang.Object query, javax.security.auth.Subject delegate)`
`void` `removeNotificationListener(javax.management.ObjectName name, javax.management.ObjectName listener, java.lang.Object filter, java.lang.Object handback, javax.security.auth.Subject delegate)`
`void` `removeNotificationListener(javax.management.ObjectName name, javax.management.ObjectName listener, javax.security.auth.Subject delegate)`
`void` `setAttribute(javax.management.ObjectName name, java.lang.Object attribute, javax.security.auth.Subject delegate)`
`javax.management.AttributeList` `setAttributes(javax.management.ObjectName name, java.lang.Object attributes, javax.security.auth.Subject delegate)`
`void` `unregisterMBean(javax.management.ObjectName name, javax.security.auth.Subject delegate)`

Methods inherited from class mx4j.tools.remote.AbstractConnection
`getConnectionId`

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

Constructor Detail

### JMXConnectionHandler

    public JMXConnectionHandler(JMXConnection connection,
                                ConnectionManager manager,
                                java.lang.String connectionId)

Method Detail

### close

    public void close()
               throws java.io.IOException

  Overridden to allow nested connections to close and release their resources and, afterwards, to close this connection with the JSR 160 semantic provided by the superclass.

  Specified by:
    `close` in interface `JMXConnection`
  Overrides:
    `close` in class `AbstractConnection`
  Throws:
    `java.io.IOException`

### isClosed

    protected boolean isClosed()

### getConnection

    protected JMXConnection getConnection()

### createMBean

    public javax.management.ObjectInstance createMBean(java.lang.String className,
                                                       javax.management.ObjectName name,
                                                       java.lang.Object params,
                                                       java.lang.String[] signature,
                                                       javax.security.auth.Subject delegate)
                                                throws javax.management.ReflectionException,
                                                       javax.management.InstanceAlreadyExistsException,
                                                       javax.management.MBeanRegistrationException,
                                                       javax.management.MBeanException,
                                                       javax.management.NotCompliantMBeanException,
                                                       java.io.IOException

  Specified by:
    `createMBean` in interface `JMXConnection`
  Throws:
    `javax.management.ReflectionException`
    `javax.management.InstanceAlreadyExistsException`
    `javax.management.MBeanRegistrationException`
    `javax.management.MBeanException`
    `javax.management.NotCompliantMBeanException`
    `java.io.IOException`

### createMBean

    public javax.management.ObjectInstance createMBean(java.lang.String className,
                                                       javax.management.ObjectName name,
                                                       javax.management.ObjectName loaderName,
                                                       java.lang.Object params,
                                                       java.lang.String[] signature,
                                                       javax.security.auth.Subject delegate)
                                                throws javax.management.ReflectionException,
                                                       javax.management.InstanceAlreadyExistsException,
                                                       javax.management.MBeanRegistrationException,
                                                       javax.management.MBeanException,
                                                       javax.management.NotCompliantMBeanException,
                                                       javax.management.InstanceNotFoundException,
                                                       java.io.IOException

  Specified by:
    `createMBean` in interface `JMXConnection`
  Throws:
    `javax.management.ReflectionException`
    `javax.management.InstanceAlreadyExistsException`
    `javax.management.MBeanRegistrationException`
    `javax.management.MBeanException`
    `javax.management.NotCompliantMBeanException`
    `javax.management.InstanceNotFoundException`
    `java.io.IOException`

### unregisterMBean

    public void unregisterMBean(javax.management.ObjectName name,
                                javax.security.auth.Subject delegate)
                         throws javax.management.InstanceNotFoundException,
                                javax.management.MBeanRegistrationException,
                                java.io.IOException

  Specified by:
    `unregisterMBean` in interface `JMXConnection`
  Throws:
    `javax.management.InstanceNotFoundException`
    `javax.management.MBeanRegistrationException`
    `java.io.IOException`

### getObjectInstance

    public javax.management.ObjectInstance getObjectInstance(javax.management.ObjectName name,
                                                             javax.security.auth.Subject delegate)
                                                      throws javax.management.InstanceNotFoundException,
                                                             java.io.IOException

  Specified by:
    `getObjectInstance` in interface `JMXConnection`
  Throws:
    `javax.management.InstanceNotFoundException`
    `java.io.IOException`

### queryMBeans

    public java.util.Set queryMBeans(javax.management.ObjectName name,
                                     java.lang.Object query,
                                     javax.security.auth.Subject delegate)
                              throws java.io.IOException

  Specified by:
    `queryMBeans` in interface `JMXConnection`
  Throws:
    `java.io.IOException`

### queryNames

    public java.util.Set queryNames(javax.management.ObjectName name,
                                    java.lang.Object query,
                                    javax.security.auth.Subject delegate)
                             throws java.io.IOException

  Specified by:
    `queryNames` in interface `JMXConnection`
  Throws:
    `java.io.IOException`

### isRegistered

    public boolean isRegistered(javax.management.ObjectName name,
                                javax.security.auth.Subject delegate)
                         throws java.io.IOException

  Specified by:
    `isRegistered` in interface `JMXConnection`
  Throws:
    `java.io.IOException`

### getMBeanCount

    public java.lang.Integer getMBeanCount(javax.security.auth.Subject delegate)
                                    throws java.io.IOException

  Specified by:
    `getMBeanCount` in interface `JMXConnection`
  Throws:
    `java.io.IOException`

### getAttribute

    public java.lang.Object getAttribute(javax.management.ObjectName name,
                                         java.lang.String attribute,
                                         javax.security.auth.Subject delegate)
                                  throws javax.management.MBeanException,
                                         javax.management.AttributeNotFoundException,
                                         javax.management.InstanceNotFoundException,
                                         javax.management.ReflectionException,
                                         java.io.IOException

  Specified by:
    `getAttribute` in interface `JMXConnection`
  Throws:
    `javax.management.MBeanException`
    `javax.management.AttributeNotFoundException`
    `javax.management.InstanceNotFoundException`
    `javax.management.ReflectionException`
    `java.io.IOException`

### getAttributes

    public javax.management.AttributeList getAttributes(javax.management.ObjectName name,
                                                        java.lang.String[] attributes,
                                                        javax.security.auth.Subject delegate)
                                                 throws javax.management.InstanceNotFoundException,
                                                        javax.management.ReflectionException,
                                                        java.io.IOException

  Specified by:
    `getAttributes` in interface `JMXConnection`
  Throws:
    `javax.management.InstanceNotFoundException`
    `javax.management.ReflectionException`
    `java.io.IOException`

### setAttribute

    public void setAttribute(javax.management.ObjectName name,
                             java.lang.Object attribute,
                             javax.security.auth.Subject delegate)
                      throws javax.management.InstanceNotFoundException,
                             javax.management.AttributeNotFoundException,
                             javax.management.InvalidAttributeValueException,
                             javax.management.MBeanException,
                             javax.management.ReflectionException,
                             java.io.IOException

  Specified by:
    `setAttribute` in interface `JMXConnection`
  Throws:
    `javax.management.InstanceNotFoundException`
    `javax.management.AttributeNotFoundException`
    `javax.management.InvalidAttributeValueException`
    `javax.management.MBeanException`
    `javax.management.ReflectionException`
    `java.io.IOException`

### setAttributes

    public javax.management.AttributeList setAttributes(javax.management.ObjectName name,
                                                        java.lang.Object attributes,
                                                        javax.security.auth.Subject delegate)
                                                 throws javax.management.InstanceNotFoundException,
                                                        javax.management.ReflectionException,
                                                        java.io.IOException

  Specified by:
    `setAttributes` in interface `JMXConnection`
  Throws:
    `javax.management.InstanceNotFoundException`
    `javax.management.ReflectionException`
    `java.io.IOException`

### invoke

    public java.lang.Object invoke(javax.management.ObjectName name,
                                   java.lang.String operationName,
                                   java.lang.Object params,
                                   java.lang.String[] signature,
                                   javax.security.auth.Subject delegate)
                            throws javax.management.InstanceNotFoundException,
                                   javax.management.MBeanException,
                                   javax.management.ReflectionException,
                                   java.io.IOException

  Specified by:
    `invoke` in interface `JMXConnection`
  Throws:
    `javax.management.InstanceNotFoundException`
    `javax.management.MBeanException`
    `javax.management.ReflectionException`
    `java.io.IOException`

### getDefaultDomain

    public java.lang.String getDefaultDomain(javax.security.auth.Subject delegate)
                                      throws java.io.IOException

  Specified by:
    `getDefaultDomain` in interface `JMXConnection`
  Throws:
    `java.io.IOException`

### getDomains

    public java.lang.String[] getDomains(javax.security.auth.Subject delegate)
                                  throws java.io.IOException

  Specified by:
    `getDomains` in interface `JMXConnection`
  Throws:
    `java.io.IOException`

### getMBeanInfo

    public javax.management.MBeanInfo getMBeanInfo(javax.management.ObjectName name,
                                                   javax.security.auth.Subject delegate)
                                            throws javax.management.InstanceNotFoundException,
                                                   javax.management.IntrospectionException,
                                                   javax.management.ReflectionException,
                                                   java.io.IOException

  Specified by:
    `getMBeanInfo` in interface `JMXConnection`
  Throws:
    `javax.management.InstanceNotFoundException`
    `javax.management.IntrospectionException`
    `javax.management.ReflectionException`
    `java.io.IOException`

### isInstanceOf

    public boolean isInstanceOf(javax.management.ObjectName name,
                                java.lang.String className,
                                javax.security.auth.Subject delegate)
                         throws javax.management.InstanceNotFoundException,
                                java.io.IOException

  Specified by:
    `isInstanceOf` in interface `JMXConnection`
  Throws:
    `javax.management.InstanceNotFoundException`
    `java.io.IOException`

### addNotificationListener

    public void addNotificationListener(javax.management.ObjectName name,
                                        javax.management.ObjectName listener,
                                        java.lang.Object filter,
                                        java.lang.Object handback,
                                        javax.security.auth.Subject delegate)
                                 throws javax.management.InstanceNotFoundException,
                                        java.io.IOException

  Specified by:
    `addNotificationListener` in interface `JMXConnection`
  Throws:
    `javax.management.InstanceNotFoundException`
    `java.io.IOException`

### removeNotificationListener

    public void removeNotificationListener(javax.management.ObjectName name,
                                           javax.management.ObjectName listener,
                                           javax.security.auth.Subject delegate)
                                    throws javax.management.InstanceNotFoundException,
                                           javax.management.ListenerNotFoundException,
                                           java.io.IOException

  Specified by:
    `removeNotificationListener` in interface `JMXConnection`
  Throws:
    `javax.management.InstanceNotFoundException`
    `javax.management.ListenerNotFoundException`
    `java.io.IOException`

### removeNotificationListener

    public void removeNotificationListener(javax.management.ObjectName name,
                                           javax.management.ObjectName listener,
                                           java.lang.Object filter,
                                           java.lang.Object handback,
                                           javax.security.auth.Subject delegate)
                                    throws javax.management.InstanceNotFoundException,
                                           javax.management.ListenerNotFoundException,
                                           java.io.IOException

  Specified by:
    `removeNotificationListener` in interface `JMXConnection`
  Throws:
    `javax.management.InstanceNotFoundException`
    `javax.management.ListenerNotFoundException`
    `java.io.IOException`

Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.