|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jdmk.remote.cascading.proxy.CascadingProxy
public class CascadingProxy
This class is used to proxy an MBean residing in a source
MBeanServer. Connections to that source MBeanServer
are obtained through an MBeanServerConnectionFactory
.
The CascadingProxy is a DynamicMBean
that forwards all
the calls it receive to a source MBean, residing in a source
MBeanServer. The CascadingProxy also makes it possible
for Notification Listeners
to register
for notifications emitted by the source MBeans.
Constructor Summary | |
---|---|
CascadingProxy(javax.management.ObjectName sourceMBeanName,
MBeanServerConnectionFactory mbscf)
Creates a new CascadingProxy. |
Method Summary | |
---|---|
void |
addNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
Adds a listener to the source MBean. |
java.lang.Object |
getAttribute(java.lang.String attribute)
Obtain the value of a specific attribute from the source MBean. |
javax.management.AttributeList |
getAttributes(java.lang.String[] attributes)
Get the values of several attributes from the source MBean. |
MBeanServerConnectionFactory |
getConnectionFactory()
Returns the MBeanServerConnectionFactory, as passed to this object's constructor. |
javax.management.MBeanInfo |
getMBeanInfo()
Returns the MBeanInfo of the source MBean. |
javax.management.MBeanNotificationInfo[] |
getNotificationInfo()
Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type. |
javax.management.ObjectName |
getSourceMBeanName()
The ObjectName of the source MBean, as passed to this Object's constructor. |
javax.management.ObjectName |
getTargetName()
The ObjectName of this cascading proxy. |
java.lang.Object |
invoke(java.lang.String actionName,
java.lang.Object[] params,
java.lang.String[] signature)
Allows an action to be invoked on the source MBean. |
void |
postDeregister()
Allows the MBean to perform any operations needed after having been unregistered in the MBean server. |
void |
postRegister(java.lang.Boolean registrationDone)
Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed. |
void |
preDeregister()
Allows the MBean to perform any operations it needs before being unregistered by the MBean server. |
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
Allows the MBean to perform any operations it needs before being registered in the MBean server. |
void |
removeNotificationListener(javax.management.NotificationListener listener)
Removes a listener from the source MBean. |
void |
removeNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
Removes a listener from the source MBean. |
void |
setAttribute(javax.management.Attribute attribute)
Set the value of a specific attribute on the source MBean. |
javax.management.AttributeList |
setAttributes(javax.management.AttributeList attributes)
Sets the values of several attributes in the source MBean. |
protected javax.management.Notification |
translate(javax.management.Notification notif)
Translate the source ObjectName into this CascadingProxy's ObjectName. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CascadingProxy(javax.management.ObjectName sourceMBeanName, MBeanServerConnectionFactory mbscf)
sourceMBeanName
- The ObjectName of the source MBean.mbscf
- An MBeanServerConnectionFactory from which
connections with the MBeanServer containing the
source MBean can be obtained.
The CascadingProxy will call mbscf.getMBeanServerConnection()
every time it needs to access
the subagent.Method Detail |
---|
public java.lang.Object getAttribute(java.lang.String attribute) throws javax.management.AttributeNotFoundException, javax.management.MBeanException, javax.management.ReflectionException
getAttribute
in interface javax.management.DynamicMBean
attribute
- The name of the attribute to be retrieved
javax.management.AttributeNotFoundException
javax.management.MBeanException
- Wraps a java.lang.Exception thrown by the MBean's getter.
javax.management.ReflectionException
- Wraps a java.lang.Exception
thrown while trying to invoke the getter.
java.lang.reflect.UndeclaredThrowableException
- if an
InstanceNotFoundException or an IOException
is raised while trying to forward the request to the source
MBean.setAttribute(javax.management.Attribute)
,
DynamicMBean.getAttribute(java.lang.String)
public void setAttribute(javax.management.Attribute attribute) throws javax.management.AttributeNotFoundException, javax.management.InvalidAttributeValueException, javax.management.MBeanException, javax.management.ReflectionException
setAttribute
in interface javax.management.DynamicMBean
attribute
- The identification of the attribute to
be set and the value it is to be set to.
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
- Wraps a java.lang.Exception thrown
by the MBean's setter.
javax.management.ReflectionException
- Wraps a java.lang.Exception
thrown while trying to invoke the MBean's setter.
java.lang.reflect.UndeclaredThrowableException
- if an
InstanceNotFoundException or an IOException
is raised while trying to forward the request to the source
MBean.getAttribute(java.lang.String)
,
DynamicMBean.setAttribute(javax.management.Attribute)
public javax.management.AttributeList getAttributes(java.lang.String[] attributes)
getAttributes
in interface javax.management.DynamicMBean
attributes
- A list of the attributes to be retrieved.
java.lang.reflect.UndeclaredThrowableException
- if an
InstanceNotFoundException, an IOException,
or a ReflectionException
is raised while trying to forward the request to the source
MBean.setAttributes(javax.management.AttributeList)
,
DynamicMBean.getAttributes(java.lang.String[])
public javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
setAttributes
in interface javax.management.DynamicMBean
attributes
- A list of attributes: The identification of the
attributes to be set and the values they are to be set to.
java.lang.reflect.UndeclaredThrowableException
- if an
InstanceNotFoundException, an IOException,
or a ReflectionException
is raised while trying to forward the request to the source
MBean.getAttributes(java.lang.String[])
,
DynamicMBean.setAttributes(javax.management.AttributeList)
public java.lang.Object invoke(java.lang.String actionName, java.lang.Object[] params, java.lang.String[] signature) throws javax.management.MBeanException, javax.management.ReflectionException
invoke
in interface javax.management.DynamicMBean
actionName
- The name of the action to be invoked.params
- An array containing the parameters to be set when
the action is invoked.signature
- An array containing the signature of the action.
javax.management.MBeanException
- Wraps a java.lang.Exception
thrown by the MBean's invoked method.
javax.management.ReflectionException
- Wraps a java.lang.Exception
thrown while trying to invoke the method
java.lang.reflect.UndeclaredThrowableException
- if an
InstanceNotFoundException or an IOException
is raised while trying to forward the request to the source
MBean.DynamicMBean.invoke(java.lang.String, java.lang.Object[], java.lang.String[])
public javax.management.MBeanInfo getMBeanInfo()
Subclasses may therefore wish to redefine this method in order to cache the returned MBeanInfo.
getMBeanInfo
in interface javax.management.DynamicMBean
java.lang.reflect.UndeclaredThrowableException
- if an
InstanceNotFoundException, an IOException,
a ReflectionException, or an
IntrospectionException
is raised while trying to forward the request to the source
MBean.public javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name) throws java.lang.Exception
getTargetName()
.
preRegister
in interface javax.management.MBeanRegistration
server
- The MBean server in which the MBean will be registered.name
- The object name of the MBean. If name
this method throws an IllegalArgumentException.
java.lang.IllegalArgumentException
- if the parameter name
is null
java.lang.Exception
MBeanRegistration.preRegister(javax.management.MBeanServer, javax.management.ObjectName)
public void postRegister(java.lang.Boolean registrationDone)
postRegister
in interface javax.management.MBeanRegistration
registrationDone
- Indicates whether or not the MBean has
been successfully registered in the MBean server. The value
false means that the registration phase has failed.MBeanRegistration.postRegister(java.lang.Boolean)
public void preDeregister() throws java.lang.Exception
preDeregister
in interface javax.management.MBeanRegistration
java.lang.Exception
- This exception will be caught by
the MBean server and re-thrown as an MBeanRegistrationException
or a RuntimeMBeanException
.MBeanRegistration.preDeregister()
public void postDeregister()
postDeregister
in interface javax.management.MBeanRegistration
public final javax.management.ObjectName getSourceMBeanName()
public javax.management.ObjectName getTargetName()
preRegister(javax.management.MBeanServer, javax.management.ObjectName)
method.
public javax.management.MBeanNotificationInfo[] getNotificationInfo()
Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.
This method returns the notification information present in the source MBean's MBeanInfo - if any. Otherwise, it returns an empty array.
It is not illegal for the MBean to send notifications not described in this array. However, some clients of the MBean server may depend on the array being complete for their correct functioning.
getNotificationInfo
in interface javax.management.NotificationBroadcaster
NotificationBroadcaster.getNotificationInfo()
public void addNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
addNotificationListener
in interface javax.management.NotificationBroadcaster
listener
- The listener object which will handle the
notifications emitted by the broadcaster.filter
- The filter object. If filter is null, no
filtering will be performed before handling notifications.handback
- An opaque object to be sent back to the
listener when a notification is emitted. This object cannot be
used by the Notification broadcaster object. It should be
resent unchanged with the notification to the listener.
java.lang.IllegalArgumentException
- Listener parameter is null.
java.lang.reflect.UndeclaredThrowableException
- if an
InstanceNotFoundException or an IOException
is raised while trying to forward the request to the source
MBean.removeNotificationListener(javax.management.NotificationListener)
,
NotificationBroadcaster.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
public void removeNotificationListener(javax.management.NotificationListener listener) throws javax.management.ListenerNotFoundException
removeNotificationListener
in interface javax.management.NotificationBroadcaster
listener
- A listener that was previously added to this
MBean.
javax.management.ListenerNotFoundException
- The listener is not
registered with the MBean.
java.lang.reflect.UndeclaredThrowableException
- if an
InstanceNotFoundException or an IOException
is raised while trying to forward the request to the source
MBean.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
,
NotificationEmitter.removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
public void removeNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback) throws javax.management.ListenerNotFoundException
Removes a listener from the source MBean. The MBean must have a
listener that exactly matches the given listener
,
filter
, and handback
parameters. If
there is more than one such listener, only one is removed.
The filter
and handback
parameters
may be null if and only if they are null in a listener to be
removed.
removeNotificationListener
in interface javax.management.NotificationEmitter
listener
- A 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.
javax.management.ListenerNotFoundException
- The listener is not
registered with the MBean, or it is not registered with the
given filter and handback.
java.lang.reflect.UndeclaredThrowableException
- if an
InstanceNotFoundException or an IOException
is raised while trying to forward the request to the source
MBean.NotificationEmitter.removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
public final MBeanServerConnectionFactory getConnectionFactory()
protected javax.management.Notification translate(javax.management.Notification notif)
|
Open Source build 01-ea opendmk-1.0-b01-ea 2010.10.20_19:39:55_UTC |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |