|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JdmkLegacyConnector
.
public interface RemoteMBeanServer
Defines the methods necessary for remote creation, access and
deletion of MBeans. It creates local objects
(ProxyMBeans
and GenericProxies
) to be
used as "proxies" on the MBeans.
Field Summary |
---|
Fields inherited from interface com.sun.jdmk.comm.ClientNotificationHandler |
---|
DISCARD_NEW, DISCARD_OLD, NO_CACHE_LIMIT, PULL_MODE, PUSH_MODE |
Method Summary | |
---|---|
String |
connect(ConnectorAddress MBeanServerAddress)
Deprecated. Initializes the communication with the remote MBeanServer . |
ObjectInstance |
createMBean(String className,
ObjectName name)
Deprecated. Creates and registers an instance of an MBean in the remote object server. |
ObjectInstance |
createMBean(String className,
ObjectName name,
Object[] params,
String[] signature)
Deprecated. Creates and registers an instance of an MBean in the remote object server. |
ObjectInstance |
createMBean(String className,
ObjectName name,
ObjectName loaderName)
Deprecated. Creates and registers an instance of an MBean in the remote object server. |
ObjectInstance |
createMBean(String className,
ObjectName name,
ObjectName loaderName,
Object[] params,
String[] signature)
Deprecated. Creates and registers an instance of an MBean in the remote object server. |
void |
disconnect()
Deprecated. Terminates the communication with the MBeanServer . |
Object |
getAttribute(ObjectName name,
String attribute)
Deprecated. Gets the value of a specific attribute of a named MBean. |
AttributeList |
getAttributes(ObjectName name,
String[] attributes)
Deprecated. Allows you to retrieve the values of several attributes of an MBean. |
String |
getClassForProxyMBean(ObjectInstance instance)
Deprecated. Given the object name and the Java class name of the MBean( ObjectInstance ), this
method returns the name of the Java class of the corresponding ProxyMBean . |
String |
getDefaultDomain()
Deprecated. Returns the default domain used for the MBean naming. |
Integer |
getMBeanCount()
Deprecated. Returns the number of MBeans controlled by the MBeanServer . |
MBeanInfo |
getMBeanInfo(ObjectName name)
Deprecated. This method supplies the exposed attributes and actions of the MBean. |
ConnectorAddress |
getMBeanServerAddress()
Deprecated. Returns the exact address of the MBeanServer to which the ConnectorClient is
connected. |
String |
getMBeanServerId()
Deprecated. Returns a string which represents the MBeanServer identification. |
ObjectInstance |
getObjectInstance(ObjectName name)
Deprecated. Gets the ObjectInstance for a given MBean registered with the MBeanServer. |
OperationContext |
getOperationContext()
Deprecated. Get the OperationContext that was last given to setOperationContext, or null if setOperationContext was never called. |
Object |
invoke(ObjectName name,
String operationName,
Object[] params,
String[] signature)
Deprecated. Invokes a method of an MBean. |
boolean |
isConnected()
Deprecated. Checks whether communication with the MBeanServer is established. |
boolean |
isInstanceOf(ObjectName name,
String className)
Deprecated. Returns true if the MBean specified is an instance of the specified class, false otherwise. |
boolean |
isRegistered(ObjectName name)
Deprecated. Checks whether an MBean, identified by its object name, is already registered with the MBeanServer. |
Set |
queryMBeans(ObjectName name,
QueryExp query)
Deprecated. Gets MBeans controlled by the MBeanServer . |
Set |
queryNames(ObjectName name,
QueryExp query)
Deprecated. Gets the names of MBeans controlled by the MBeanServer . |
void |
setAttribute(ObjectName name,
Attribute attribute)
Deprecated. Sets the value of a specific attribute of a named MBean. |
AttributeList |
setAttributes(ObjectName name,
AttributeList attributes)
Deprecated. Allows you to modify the values of several attributes of an MBean. |
void |
setOperationContext(OperationContext c)
Deprecated. Set the OperationContext of this connection. |
void |
unregisterMBean(ObjectName name)
Deprecated. Deletes an instance of an MBean in the remote MBean server. |
Methods inherited from interface com.sun.jdmk.NotificationRegistration |
---|
addNotificationListener, removeNotificationListener |
Methods inherited from interface com.sun.jdmk.comm.ClientNotificationHandler |
---|
clearCache, getCacheSize, getMode, getNotifications, getOverflowCount, getOverflowMode, getPeriod, setCacheSize, setMode, setOverflowCount, setOverflowMode, setPeriod |
Methods inherited from interface com.sun.jdmk.NotificationRegistration |
---|
addNotificationListener, removeNotificationListener |
Method Detail |
---|
String connect(ConnectorAddress MBeanServerAddress)
MBeanServer
. All the information
needed for identifying the MBeanServer
to contact and the protocol to
be used is contained in the object of type ConnectorAddress
, passed as
a parameter. If a communication problem occurs this method will throw
a CommunicationException
(JMRuntimeException
).
If the RemoteMBeanServer
had already been connected and disconnected with an
MBeanServer
identified by its MBeanServerId
, and if the
MBeanServer
reachable by the MBeanServerAddress parameter doesn't
have the same MBeanServerId
, the java.lang.IllegalAccessException
is thrown.
MBeanServerAddress
- The exact MBeanServer
address to contact
(MBeanServer
identification, protocol specification).
MBeanServer
with which the communication is established.
IllegalArgumentException
- The RemoteMBeanServer
has already been connected and disconnected
and the specified ConnectorAddress
doesn't identify the same MBeanServer
.void disconnect()
MBeanServer
.
boolean isConnected()
MBeanServer
is established.
ConnectorAddress getMBeanServerAddress()
MBeanServer
to which the ConnectorClient is
connected. The address is of type ConnectorAddress
.
void setOperationContext(OperationContext c)
Set the OperationContext of this connection. This context will be sent along with each request and can be recovered by the server, which can make it available to the operations it invokes.
The saved OperationContext will be a clone of the object
c
made using its clone
method.
c
- the new OperationContext. It may be null to indicate that
there is no context. The previous OperationContext, if any, is lost.OperationContext getOperationContext()
String getMBeanServerId()
MBeanServer
identification.
This String comes from the MBeanServerDelegate
Mbean.
getMbeanServerId
still returns
the previous MbeanServer
identification.ObjectInstance createMBean(String className, ObjectName name) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException
ObjectInstance
representing the remote MBean created.
className
- The name of the Java class to be used by the MBeanServer
for creating the MBean.name
- The name of the MBean to be created.
ObjectInstance
representing the newly created MBean.
ReflectionException
- Wraps the java.lang.Exception
that occurred when trying
to invoke the MBean's constructor.
InstanceAlreadyExistsException
- The MBean is already under the control of the MBean server.
MBeanRegistrationException
- The preRegister
(MBeanRegistration
interface) method of the MBean has thrown an exception. The MBean will not be registered.
MBeanException
- Wraps an exception thrown by the MBean's constructor.
NotCompliantMBeanException
- This class is not a JMX compliant MBean.ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException
ObjectInstance
representing the remote MBean created.
className
- The name of the Java class to be used by the MBeanServer
for creating the MBean.name
- The name of the MBean to be created.loaderName
- The name of the class loader to be used by the MBeanServer
.
ObjectInstance
representing the newly created MBean.
ReflectionException
- Wraps the java.lang.Exception
that occurred trying to invoke the MBean's
constructor.
InstanceAlreadyExistsException
- The MBean is already under the control of the MBean server.
MBeanRegistrationException
- The preRegister
(MBeanRegistration
interface) method of the MBean has thrown an exception. The MBean will not be registered.
MBeanException
- Wraps an exception thrown by the MBean's constructor.
NotCompliantMBeanException
- This class is not a JMX compliant MBean.
InstanceNotFoundException
- The specified loader is not registered in the MBeanServer
ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException
ObjectInstance
representing the remote MBean created.
className
- The name of the Java class to be used by the MBeanServer
for creating
the MBean.name
- The name of the MBean to be created.params
- An array containing the parameters of the constructor to be invoked.
A parameter can be any Java object that is serializable
.signature
- An array containing the signature of the constructor to be invoked.
ObjectInstance
representing the newly created MBean.
ReflectionException
- Wraps the java.lang.Exception
that occurred trying to invoke the MBean's
constructor.
InstanceAlreadyExistsException
- The MBean is already under the control of the MBean server.
MBeanRegistrationException
- The preRegister
(MBeanRegistration
interface) method of the MBean has thrown an exception. The MBean will not be registered.
MBeanException
- Wraps an exception thrown by the MBean's constructor.
NotCompliantMBeanException
- This class is not a JMX compliant MBean.ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException
ObjectInstance
representing the remote MBean created.
className
- The name of the Java class to be used by the MBeanServer
for creating
the MBean.name
- The name of the MBean to be created.loaderName
- The name of the class loader to be used by the MBeanServer
.params
- An array containing the parameters of the constructor to be invoked.
A parameter can be any Java object that is serializable
.signature
- An array containing the signature of the constructor to be invoked.
ObjectInstance
representing the newly created MBean.
ReflectionException
- Wraps the java.lang.Exception
that occurred trying to invoke the MBean's
constructor.
InstanceAlreadyExistsException
- The MBean is already under the control of the MBean server.
MBeanRegistrationException
- The preRegister
(MBeanRegistration
interface) method of the MBean has thrown an exception. The MBean will not be registered.
MBeanException
- Wraps an exception thrown by the MBean's constructor.
NotCompliantMBeanException
- This class is not a JMX compliant MBean.
InstanceNotFoundException
- The specified loader is not registered in the MBeanServer
.void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException
ProxyMBean
and/or GenericProxy
) object from
remote MBean server.
unregisterMBean
in interface ProxyHandler
name
- The name of the MBean to be deleted.
InstanceNotFoundException
- The specified MBean is not registered in the MBean server.
MBeanRegistrationException
- The preDeregister
(MBeanRegistration
interface) method of the MBean has thrown an exception.Set queryNames(ObjectName name, QueryExp query)
MBeanServer
. This method
allows any of the following to be obtained: The names of all MBeans,
the names of a set of MBeans specified by pattern matching on the
ObjectName
and/or a Query expression, a specific MBean name (equivalent
to testing whether an MBean is registered). When the object name is
null or empty, all the objects are to be selected (and filtered if
a query is specified). It returns the set of ObjectName
s for the
MBeans selected.
name
- The object name pattern identifying the MBean names to be retrieved. If
null or empty, the names of all the registered MBeans will be retrieved.query
- The query expression to be applied for selecting MBeans.
ObjectNames
for the MBeans selected.Set queryMBeans(ObjectName name, QueryExp query)
MBeanServer
. This method allows any
of the following to be obtained: All MBeans, a set of MBeans specified
by pattern matching on the ObjectName and/or a Query expression, a
specific MBean. When the object name is null or empty, all objects are
to be selected (and filtered if a query is specified). It returns the
set of ObjectInstance
s for the selected MBeans.
name
- The object name pattern identifying the MBeans to be retrieved. If
null or empty all the MBeans registered will be retrieved.query
- The query expression to be applied for selecting MBeans.
ObjectInstance
s for the MBeans selected.boolean isRegistered(ObjectName name)
name
- The object name of the MBean to be checked.
RuntimeOperationsException
- Wraps an IllegalArgumentException: The object name in parameter is null.Object getAttribute(ObjectName name, String attribute) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException
getAttribute
in interface ProxyHandler
name
- The object name of the MBean from which the attribute is to be retrieved.attribute
- The name of the attribute to be retrieved.
serializable
.
AttributeNotFoundException
- The specified attribute is not accessible in the MBean.
MBeanException
- Wraps an exception thrown by the MBean's getter.
InstanceNotFoundException
- The specified MBean is not registered in the MBean server.
ReflectionException
- Wraps an exception thrown while trying to instantiate and apply the
operator specified in Modification.AttributeList getAttributes(ObjectName name, String[] attributes) throws InstanceNotFoundException, ReflectionException
getAttributes
in interface ProxyHandler
name
- The object name of the MBean from within which the attributes are
to be retrieved.attributes
- A list of the attributes to be retrieved.
serializable
.
InstanceNotFoundException
- The specified MBean is not registered in the MBean server.
ReflectionException
- An exception occurred trying to invoke the getAttributes of a Dynamic MBean.void setAttribute(ObjectName name, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
setAttribute
in interface ProxyHandler
name
- The name of the MBean within which the attribute is to be set.attribute
- The modification to be performed: The identification of the
attribute to be set, the value it is to be set to, and the operator to apply.
The value of the attribute can be any Java object that is serializable
.
InstanceNotFoundException
- The specified MBean is not registered in the MBean server.
AttributeNotFoundException
- The specified attribute is not accessible in the MBean.
InvalidAttributeValueException
- The specified value for the attribute is not valid.
MBeanException
- Wraps an exception thrown by the MBean's setter.
ReflectionException
- Wraps an exception thrown while trying to instantiate and apply the
operator specified in Modification.AttributeList setAttributes(ObjectName name, AttributeList attributes) throws InstanceNotFoundException, ReflectionException
setAttributes
in interface ProxyHandler
name
- The object name of the MBean from within which the attributes are
to be set.attributes
- A list of the attributes to be set, their values and, optionally, the
operators to apply.
The value of the attributes can be any Java object that is serializable
.
serializable
.
InstanceNotFoundException
- The specified MBean is not registered in the MBean server.
ReflectionException
- An exception occurred trying to invoke the setAttributes of a Dynamic MBean.Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException
invoke
in interface ProxyHandler
name
- The name of the MBean on which the method is to be invoked.operationName
- The name of the operation to be invoked.params
- An array containing the parameters to be set when the operation is
invoked.
A parameter can be any Java object that is serializable
.signature
- An array containing the signature of the method.
serializable
.
InstanceNotFoundException
- The specified MBean is not registered in the MBean server.
MBeanException
- Wraps an exception thrown by the MBean's invoked method.
ReflectionException
- Wraps a java.lang.Exception
thrown while trying to invoke the method.MBeanInfo getMBeanInfo(ObjectName name) throws InstanceNotFoundException, IntrospectionException, ReflectionException
MBeanInfo
object.
getMBeanInfo
in interface ProxyHandler
name
- The name of the MBean whose attributes and actions will be returned.
MBeanInfo
which allows all methods and actions of
this MBean to be retrieved.
InstanceNotFoundException
- The specified MBean is not registered in the MBean server.
IntrospectionException
- An exception occurs during introspection.
ReflectionException
- Wraps a java.lang.Exception
thrown while trying to invoke
the getMBeanInfo
method.ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException
name
- The object name of the MBean.
InstanceNotFoundException
- The specified MBean is not registered in the MBeanServer.Integer getMBeanCount()
MBeanServer
.
String getDefaultDomain()
boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException
name
- The ObjectName
of the MBean.className
- The name of the class.
InstanceNotFoundException
- The MBean specified is not registered in the MBean server.String getClassForProxyMBean(ObjectInstance instance) throws ProxyMBeanInstantiationException
ObjectInstance
), this
method returns the name of the Java class of the corresponding ProxyMBean
.
The returned name can be null, if there is no Java class corresponding to
the ProxyMBean
needed.
instance
- The ObjectInstance
of the MBean which is represented by the
ProxyMBean
.
ProxyMBean
.
ProxyMBeanInstantiationException
|
Open Source build 02 opendmk-1.0-b02 2007.10.01_19:17:46_MEST |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |