mx4j.tools.remote.proxy
Class RemoteMBeanProxy

java.lang.Object
  extended by mx4j.tools.remote.proxy.RemoteMBeanProxy
All Implemented Interfaces:
javax.management.DynamicMBean, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter

public class RemoteMBeanProxy
extends java.lang.Object
implements javax.management.DynamicMBean, javax.management.NotificationEmitter, javax.management.MBeanRegistration

Version:
$Revision: 1.4 $

Constructor Summary
RemoteMBeanProxy(javax.management.ObjectName remoteObjectName, javax.management.remote.JMXConnector connector, java.util.Map environment, javax.security.auth.Subject delegate)
           
RemoteMBeanProxy(javax.management.ObjectName remoteObjectName, javax.management.remote.JMXServiceURL url, java.util.Map environment, javax.security.auth.Subject delegate)
           
RemoteMBeanProxy(javax.management.ObjectName remoteObjectName, javax.management.MBeanServerConnection connection)
           
 
Method Summary
 void addNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
          Adds a notification listener to this emitter.
 java.lang.Object getAttribute(java.lang.String attribute)
           
 javax.management.AttributeList getAttributes(java.lang.String[] attributes)
           
protected  javax.management.remote.JMXConnector getJMXConnector()
           
 javax.management.MBeanInfo getMBeanInfo()
           
protected  javax.management.MBeanServerConnection getMBeanServerConnection()
           
 javax.management.MBeanNotificationInfo[] getNotificationInfo()
          Returns the metadata information associated with this emitter.
protected  javax.management.ObjectName getRemoteObjectName()
           
 java.lang.Object invoke(java.lang.String method, java.lang.Object[] arguments, java.lang.String[] params)
           
 void postDeregister()
          Callback called just after the MBean has been successfully unregistered.
 void postRegister(java.lang.Boolean registrationDone)
          Callback called just after the MBean has been registered (successfully or not).
 void preDeregister()
          Callback called just before MBean unregistration from the MBeanServer.
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
          Callback called just before MBean registration in the MBeanServer.
 void removeNotificationListener(javax.management.NotificationListener listener)
          Removes a notification listener from this emitter.
 void removeNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
          Removes a notification listener from this MBean.
 void setAttribute(javax.management.Attribute attribute)
           
 javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteMBeanProxy

public RemoteMBeanProxy(javax.management.ObjectName remoteObjectName,
                        javax.management.remote.JMXServiceURL url,
                        java.util.Map environment,
                        javax.security.auth.Subject delegate)
                 throws java.io.IOException
Throws:
java.io.IOException

RemoteMBeanProxy

public RemoteMBeanProxy(javax.management.ObjectName remoteObjectName,
                        javax.management.remote.JMXConnector connector,
                        java.util.Map environment,
                        javax.security.auth.Subject delegate)
                 throws java.io.IOException
Throws:
java.io.IOException

RemoteMBeanProxy

public RemoteMBeanProxy(javax.management.ObjectName remoteObjectName,
                        javax.management.MBeanServerConnection connection)
Method Detail

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
                                        throws java.lang.Exception
Description copied from interface: javax.management.MBeanRegistration
Callback called just before MBean registration in the MBeanServer. Any exception thrown by this method will cause the MBean registration to abort.

Specified by:
preRegister in interface javax.management.MBeanRegistration
Parameters:
server - The MBeanServer on which the MBean will be registered.
name - The ObjectName of the MBean.
Returns:
The ObjectName of the registered MBean, must not be null
Throws:
java.lang.Exception - Any possible exception generated by this method will be caught by the MBeanServer and re-thrown as an MBeanRegistrationException to the client.

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Description copied from interface: javax.management.MBeanRegistration
Callback called just after the MBean has been registered (successfully or not).

Specified by:
postRegister in interface javax.management.MBeanRegistration
Parameters:
registrationDone - True if the registration was successful, false otherwise.

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Description copied from interface: javax.management.MBeanRegistration
Callback called just before MBean unregistration from the MBeanServer. Any exception thrown by this method will cause the MBean unregistration to abort.

Specified by:
preDeregister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception - Any possible exception generated by this method will be caught by the MBeanServer and re-thrown as an MBeanRegistrationException to the client.

postDeregister

public void postDeregister()
Description copied from interface: javax.management.MBeanRegistration
Callback called just after the MBean has been successfully unregistered.

Specified by:
postDeregister in interface javax.management.MBeanRegistration

getRemoteObjectName

protected javax.management.ObjectName getRemoteObjectName()

getMBeanServerConnection

protected javax.management.MBeanServerConnection getMBeanServerConnection()

getJMXConnector

protected javax.management.remote.JMXConnector getJMXConnector()

getMBeanInfo

public javax.management.MBeanInfo getMBeanInfo()
Specified by:
getMBeanInfo in interface javax.management.DynamicMBean

getAttribute

public java.lang.Object getAttribute(java.lang.String attribute)
                              throws javax.management.AttributeNotFoundException,
                                     javax.management.MBeanException,
                                     javax.management.ReflectionException
Specified by:
getAttribute in interface javax.management.DynamicMBean
Throws:
javax.management.AttributeNotFoundException
javax.management.MBeanException
javax.management.ReflectionException

setAttribute

public void setAttribute(javax.management.Attribute attribute)
                  throws javax.management.AttributeNotFoundException,
                         javax.management.InvalidAttributeValueException,
                         javax.management.MBeanException,
                         javax.management.ReflectionException
Specified by:
setAttribute in interface javax.management.DynamicMBean
Throws:
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionException

getAttributes

public javax.management.AttributeList getAttributes(java.lang.String[] attributes)
Specified by:
getAttributes in interface javax.management.DynamicMBean

setAttributes

public javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
Specified by:
setAttributes in interface javax.management.DynamicMBean

invoke

public java.lang.Object invoke(java.lang.String method,
                               java.lang.Object[] arguments,
                               java.lang.String[] params)
                        throws javax.management.MBeanException,
                               javax.management.ReflectionException
Specified by:
invoke in interface javax.management.DynamicMBean
Throws:
javax.management.MBeanException
javax.management.ReflectionException

getNotificationInfo

public javax.management.MBeanNotificationInfo[] getNotificationInfo()
Description copied from interface: javax.management.NotificationBroadcaster
Returns the metadata information associated with this emitter.

Specified by:
getNotificationInfo in interface javax.management.NotificationBroadcaster

addNotificationListener

public void addNotificationListener(javax.management.NotificationListener listener,
                                    javax.management.NotificationFilter filter,
                                    java.lang.Object handback)
                             throws java.lang.IllegalArgumentException
Description copied from interface: javax.management.NotificationBroadcaster
Adds a notification listener to this emitter.

Specified by:
addNotificationListener in interface javax.management.NotificationBroadcaster
Parameters:
listener - The notification listener which will handle the notifications emitted.
filter - Filters notifications that the listener should receive; may be null, if no filtering is required.
handback - An opaque object to be sent back to the listener when a notification is emitted.
Throws:
java.lang.IllegalArgumentException
See Also:
NotificationBroadcaster.removeNotificationListener(NotificationListener)

removeNotificationListener

public void removeNotificationListener(javax.management.NotificationListener listener)
                                throws javax.management.ListenerNotFoundException
Description copied from interface: javax.management.NotificationBroadcaster
Removes a notification listener from this emitter. If the listener has been registered with different handback objects or notification filters, all entries corresponding to the listener will be removed.

Specified by:
removeNotificationListener in interface javax.management.NotificationBroadcaster
Parameters:
listener - The notification listener that was previously added to this emitter.
Throws:
javax.management.ListenerNotFoundException - If the listener is not registered with the emitter.
See Also:
NotificationBroadcaster.addNotificationListener(NotificationListener, NotificationFilter, Object)

removeNotificationListener

public void removeNotificationListener(javax.management.NotificationListener listener,
                                       javax.management.NotificationFilter filter,
                                       java.lang.Object handback)
                                throws javax.management.ListenerNotFoundException
Description copied from interface: javax.management.NotificationEmitter
Removes a notification listener from this MBean. The MBean must have a registered listener that exactly matches the given listener, filter, and handback parameters.

Specified by:
removeNotificationListener in interface javax.management.NotificationEmitter
Parameters:
listener - The listener that was previously added to this MBean.
filter - The filter that was specified when the listener was added.
handback - The handback that was specified when the listener was added.
Throws:
javax.management.ListenerNotFoundException - If the triple listener, filter, handback is not registered with the emitter


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