javax.management.remote.message
Class MBeanServerRequestMessage

java.lang.Object
  extended by javax.management.remote.message.MBeanServerRequestMessage
All Implemented Interfaces:
Serializable, Message

public class MBeanServerRequestMessage
extends Object
implements Message

An MBeanServerConnection method call, encoded as an object. Objects of this type are sent from the client end to the server end of a JMX API connection. The result of the method is sent as an MBeanServerResponseMessage.

Instances of this class are immutable.

The method to be called is specified by an integer constant; these constants are defined in this class. Overloaded methods such as createMBean define a different constant for each overloaded version.

The parameters to the method are provided as an Object[] when the MBeanServerRequestMessage is constructed. Except where specified, the number and type of these parameters are the same as for the MBeanServerConnection method to be called. Similarly, except where specified, the type of the value returned in the corresponding MBeanServerResponseMessage is the return type of the method to be called, or null if this type is void.

Because an MBean can use a class loader other than the default one, some parameters need to be wrapped before being encoded in an MBeanServerRequestMessage. See ObjectWrapping and the JMX Remote API specification.

Subject delegation might be used by supplying the appropriate delegation subject on each request. The delegation subject is the subject on which the authorization checks are performed for this request. If null the authorization checks are performed on the authentication subject instead.

See Also:
Serialized Form

Field Summary
static int ADD_NOTIFICATION_LISTENER_OBJECTNAME
          Identifier for the method MBeanServerConnection.addNotificationListener(ObjectName, ObjectName, NotificationFilter, Object).
static int ADD_NOTIFICATION_LISTENERS
          Identifier for the method MBeanServerConnection.addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object).
static int CREATE_MBEAN
          Identifier for the method MBeanServerConnection.createMBean(String, ObjectName).
static int CREATE_MBEAN_LOADER
          Identifier for the method MBeanServerConnection.createMBean(String, ObjectName, ObjectName).
static int CREATE_MBEAN_LOADER_PARAMS
          Identifier for the method MBeanServerConnection.createMBean(String, ObjectName, ObjectName, Object[], String[]).
static int CREATE_MBEAN_PARAMS
          Identifier for the method MBeanServerConnection.createMBean(String, ObjectName, Object[], String[]).
static int GET_ATTRIBUTE
          Identifier for the method MBeanServerConnection.getAttribute(ObjectName, String).
static int GET_ATTRIBUTES
          Identifier for the method MBeanServerConnection.getAttributes(ObjectName, String[]).
static int GET_DEFAULT_DOMAIN
          Identifier for the method MBeanServerConnection.getDefaultDomain().
static int GET_DOMAINS
          Identifier for the method MBeanServerConnection.getDomains().
static int GET_MBEAN_COUNT
          Identifier for the method MBeanServerConnection.getMBeanCount().
static int GET_MBEAN_INFO
          Identifier for the method MBeanServerConnection.getMBeanInfo(ObjectName).
static int GET_OBJECT_INSTANCE
          Identifier for the method MBeanServerConnection.getObjectInstance(ObjectName).
static int INVOKE
          Identifier for the method MBeanServerConnection.invoke(ObjectName, String, Object[], String[]).
static int IS_INSTANCE_OF
          Identifier for the method MBeanServerConnection.isInstanceOf(ObjectName, String).
static int IS_REGISTERED
          Identifier for the method MBeanServerConnection.isRegistered(ObjectName).
static int QUERY_MBEANS
          Identifier for the method MBeanServerConnection.queryMBeans(ObjectName, QueryExp).
static int QUERY_NAMES
          Identifier for the method MBeanServerConnection.queryNames(ObjectName, QueryExp).
static int REMOVE_NOTIFICATION_LISTENER
          Identifier for the method MBeanServerConnection.removeNotificationListener(ObjectName, NotificationListener).
static int REMOVE_NOTIFICATION_LISTENER_FILTER_HANDBACK
          Identifier for the method MBeanServerConnection.removeNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object).
static int REMOVE_NOTIFICATION_LISTENER_OBJECTNAME
          Identifier for the method MBeanServerConnection.removeNotificationListener(ObjectName, ObjectName).
static int REMOVE_NOTIFICATION_LISTENER_OBJECTNAME_FILTER_HANDBACK
          Identifier for the method MBeanServerConnection.removeNotificationListener(ObjectName, ObjectName, NotificationFilter, Object).
static int SET_ATTRIBUTE
          Identifier for the method MBeanServerConnection.setAttribute(ObjectName, Attribute).
static int SET_ATTRIBUTES
          Identifier for the method MBeanServerConnection.setAttributes(ObjectName, AttributeList).
static int UNREGISTER_MBEAN
          Identifier for the method MBeanServerConnection.unregisterMBean(ObjectName).
 
Constructor Summary
MBeanServerRequestMessage(int methodId, Object[] params, Subject delegationSubject)
          Constructs a message to invoke the method with the given identifier and parameters.
 
Method Summary
 Subject getDelegationSubject()
          Returns the delegation subject.
 long getMessageId()
          Returns this message's unique identifier.
 int getMethodId()
          Returns the method identifier of this message.
 Object[] getParams()
          Returns the method parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADD_NOTIFICATION_LISTENERS

public static final int ADD_NOTIFICATION_LISTENERS

Identifier for the method MBeanServerConnection.addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object). This message allows several listeners to be added at the same time.

The meaning of this message is : register for notifications from the given MBeans that match the given filters. The remote client can subsequently retrieve the notifications using NotificationRequestMessage.

For each listener, the original NotificationListener and handback are kept on the client side; in order for the client to be able to identify them, the server generates and returns a unique listenerID. This listenerID is forwarded with the Notifications to the remote client.

The parameters contained in the MBeanServerRequestMessage for this method are an array of ObjectName and an array of Object. Both arrays have the same size. Each element of the array of Object contains null or a NotificationFilter object wrapped using ObjectWrapping.

The corresponding MBeanServerResponseMessage will contain an Integer[] that identifies the listeners that were registered. Subsequent notifications sent from server to client will include this identifier to indicate which listener is to receive the notification.

See Also:
Constant Field Values

ADD_NOTIFICATION_LISTENER_OBJECTNAME

public static final int ADD_NOTIFICATION_LISTENER_OBJECTNAME

Identifier for the method MBeanServerConnection.addNotificationListener(ObjectName, ObjectName, NotificationFilter, Object).

The parameters contained in the MBeanServerRequestMessage for this method are the four parameters to the method. The NotificationFilter and Object parameters are wrapped using ObjectWrapping.

See Also:
Constant Field Values

CREATE_MBEAN

public static final int CREATE_MBEAN

Identifier for the method MBeanServerConnection.createMBean(String, ObjectName).

See Also:
Constant Field Values

CREATE_MBEAN_PARAMS

public static final int CREATE_MBEAN_PARAMS

Identifier for the method MBeanServerConnection.createMBean(String, ObjectName, Object[], String[]).

The Object[] parameter is wrapped using ObjectWrapping.

See Also:
Constant Field Values

CREATE_MBEAN_LOADER

public static final int CREATE_MBEAN_LOADER

Identifier for the method MBeanServerConnection.createMBean(String, ObjectName, ObjectName).

See Also:
Constant Field Values

CREATE_MBEAN_LOADER_PARAMS

public static final int CREATE_MBEAN_LOADER_PARAMS

Identifier for the method MBeanServerConnection.createMBean(String, ObjectName, ObjectName, Object[], String[]).

The Object[] parameter is wrapped using ObjectWrapping.

See Also:
Constant Field Values

GET_ATTRIBUTE

public static final int GET_ATTRIBUTE

Identifier for the method MBeanServerConnection.getAttribute(ObjectName, String).

See Also:
Constant Field Values

GET_ATTRIBUTES

public static final int GET_ATTRIBUTES

Identifier for the method MBeanServerConnection.getAttributes(ObjectName, String[]).

See Also:
Constant Field Values

GET_DEFAULT_DOMAIN

public static final int GET_DEFAULT_DOMAIN

Identifier for the method MBeanServerConnection.getDefaultDomain().

See Also:
Constant Field Values

GET_DOMAINS

public static final int GET_DOMAINS

Identifier for the method MBeanServerConnection.getDomains().

See Also:
Constant Field Values

GET_MBEAN_COUNT

public static final int GET_MBEAN_COUNT

Identifier for the method MBeanServerConnection.getMBeanCount().

See Also:
Constant Field Values

GET_MBEAN_INFO

public static final int GET_MBEAN_INFO

Identifier for the method MBeanServerConnection.getMBeanInfo(ObjectName).

See Also:
Constant Field Values

GET_OBJECT_INSTANCE

public static final int GET_OBJECT_INSTANCE

Identifier for the method MBeanServerConnection.getObjectInstance(ObjectName).

See Also:
Constant Field Values

INVOKE

public static final int INVOKE

Identifier for the method MBeanServerConnection.invoke(ObjectName, String, Object[], String[]).

The Object[] parameter is wrapped using ObjectWrapping.

See Also:
Constant Field Values

IS_INSTANCE_OF

public static final int IS_INSTANCE_OF

Identifier for the method MBeanServerConnection.isInstanceOf(ObjectName, String).

A successful MBeanServerResponseMessage response will contain a return value of type Boolean.

See Also:
Constant Field Values

IS_REGISTERED

public static final int IS_REGISTERED

Identifier for the method MBeanServerConnection.isRegistered(ObjectName).

A successful MBeanServerResponseMessage response will contain a return value of type Boolean.

See Also:
Constant Field Values

QUERY_MBEANS

public static final int QUERY_MBEANS

Identifier for the method MBeanServerConnection.queryMBeans(ObjectName, QueryExp).

See Also:
Constant Field Values

QUERY_NAMES

public static final int QUERY_NAMES

Identifier for the method MBeanServerConnection.queryNames(ObjectName, QueryExp).

See Also:
Constant Field Values

REMOVE_NOTIFICATION_LISTENER

public static final int REMOVE_NOTIFICATION_LISTENER

Identifier for the method MBeanServerConnection.removeNotificationListener(ObjectName, NotificationListener).

The parameters contained in the MBeanServerRequestMessage for this method are the ObjectName and an Integer[].

The Integer[] contains the identifiers that the server returned for every ADD_NOTIFICATION_LISTENERS message on this connection that specified the given ObjectName and NotificationListener and that was not cancelled by a subsequent REMOVE_NOTIFICATION_LISTENER or REMOVE_NOTIFICATION_LISTENER_FILTER_HANDBACK message.

See Also:
Constant Field Values

REMOVE_NOTIFICATION_LISTENER_FILTER_HANDBACK

public static final int REMOVE_NOTIFICATION_LISTENER_FILTER_HANDBACK

Identifier for the method MBeanServerConnection.removeNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object).

The parameters contained in the MBeanServerRequestMessage for this method are the ObjectName and an Integer.

The Integer contains the identifier that the server returned for the ADD_NOTIFICATION_LISTENERS message on this connection that specified the given ObjectName, NotificationListener, NotificationFilter, and Object handback.

See Also:
Constant Field Values

REMOVE_NOTIFICATION_LISTENER_OBJECTNAME

public static final int REMOVE_NOTIFICATION_LISTENER_OBJECTNAME

Identifier for the method MBeanServerConnection.removeNotificationListener(ObjectName, ObjectName).

The parameters contained in the MBeanServerRequestMessage for this method are the two ObjectName parameters.

See Also:
Constant Field Values

REMOVE_NOTIFICATION_LISTENER_OBJECTNAME_FILTER_HANDBACK

public static final int REMOVE_NOTIFICATION_LISTENER_OBJECTNAME_FILTER_HANDBACK

Identifier for the method MBeanServerConnection.removeNotificationListener(ObjectName, ObjectName, NotificationFilter, Object).

The parameters contained in the MBeanServerRequestMessage for this method are the four parameters to the method. The NotificationFilter and Object parameters are wrapped using ObjectWrapping.

See Also:
Constant Field Values

SET_ATTRIBUTE

public static final int SET_ATTRIBUTE

Identifier for the method MBeanServerConnection.setAttribute(ObjectName, Attribute).

The Attribute parameter is wrapped using ObjectWrapping.

See Also:
Constant Field Values

SET_ATTRIBUTES

public static final int SET_ATTRIBUTES

Identifier for the method MBeanServerConnection.setAttributes(ObjectName, AttributeList).

The AttributeList is wrapped using ObjectWrapping.

See Also:
Constant Field Values

UNREGISTER_MBEAN

public static final int UNREGISTER_MBEAN

Identifier for the method MBeanServerConnection.unregisterMBean(ObjectName).

See Also:
Constant Field Values
Constructor Detail

MBeanServerRequestMessage

public MBeanServerRequestMessage(int methodId,
                                 Object[] params,
                                 Subject delegationSubject)

Constructs a message to invoke the method with the given identifier and parameters. Each constructed object gets a unique message ID, as returned by getMessageId().

Parameters:
methodId - the identifier of an MBeanServerConnection method. This should be one of the integer constants defined in this class. The behavior is not specified if it is not.
params - parameters to the method. The number and types of the parameters depend on the method, as specified by the definition of the corresponding integer constant in this class.
delegationSubject - the subject on which the authorization checks are performed for this request. If null the authorization checks are performed on the authentication subject instead.
Method Detail

getMethodId

public int getMethodId()

Returns the method identifier of this message.

Returns:
the MBeanServerConnection method that this MBeanServerRequestMessage corresponds to. This will be one of the integer constants defined in this class.

getParams

public Object[] getParams()

Returns the method parameters.

Returns:
the method parameters. The number and types of the parameters depend on the method, as specified by the definition of the corresponding integer constant in this class. The returned array must not be modified by the caller.

getDelegationSubject

public Subject getDelegationSubject()

Returns the delegation subject.

Returns:
the delegation subject on which the authorization checks are performed for this request.

getMessageId

public long getMessageId()

Returns this message's unique identifier. Every instance of this class has a different identifier.

Returns:
the unique identifier of this message.

Open Source build 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.