javax.management.remote.message
Class MBeanServerResponseMessage

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

public class MBeanServerResponseMessage
extends Object
implements Message

The result of an MBeanServerConnection method call, encoded as an object. Objects of this type are sent from the server end to the client end of a JMX API connection in response to a previous MBeanServerRequestMessage.

Instances of this class are immutable.

The type of the returned value for a successful method call is the type of the MBeanServerConnection method that was called, except where otherwise specified in MBeanServerRequestMessage. The value is wrapped using the ObjectWrapping for the connection using this message.

See Also:
Serialized Form

Constructor Summary
MBeanServerResponseMessage(long id, Object wrappedResult, boolean isException)
          Constructs a message representing the response to a previous MBeanServerRequestMessage.
 
Method Summary
 long getMessageId()
          Returns the unique identifier of this message.
 Object getWrappedResult()
          Returns the wrapped result of the method invocation.
 boolean isException()
          Indicates whether this message corresponds to an exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MBeanServerResponseMessage

public MBeanServerResponseMessage(long id,
                                  Object wrappedResult,
                                  boolean isException)

Constructs a message representing the response to a previous MBeanServerRequestMessage.

Parameters:
id - the identifier of this message. This must be the same as the identifier of the MBeanServerRequestMessage.
wrappedResult - the result of the MBeanServerConnection method call, wrapped using the ObjectWrapping for this connection. If the method returned normally, the wrapped object is the value returned, or null if the method is void. If the method produced an exception, the wrapped object is the exception.
isException - true if the MBeanServerConnection method call produced an exception. The wrappedResponse parameter then contains the exception. The isException parameter serves to distinguish the case where a method generates an exception from the case where the method returns an object of type Exception.
Method Detail

getWrappedResult

public Object getWrappedResult()

Returns the wrapped result of the method invocation.

Returns:
the wrapped result of a successful method invocation, or the wrapped exception of an unsuccessful one.

getMessageId

public long getMessageId()

Returns the unique identifier of this message. This is the same as the identifier of the corresponding MBeanServerRequestMessage.

Returns:
the unique identifier of this message.

isException

public boolean isException()

Indicates whether this message corresponds to an exception.

Returns:
true if this message represents an exception generated by the MBeanServerConnection method that was called.

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.