org.exolab.jms.net.connector
Class Response

java.lang.Object
  |
  +--org.exolab.jms.net.connector.Response
All Implemented Interfaces:
java.io.Serializable

public class Response
extends java.lang.Object
implements java.io.Serializable

A Response wraps the result of a remote method invocation

Version:
$Revision: 1.1 $ $Date: 2004/11/26 01:51:03 $
Author:
Tim Anderson
See Also:
Request, Connection, Serialized Form

Constructor Summary
Response(java.lang.Object object, java.lang.reflect.Method method)
          Construct a new Response for a successful invocation
Response(java.lang.Throwable exception)
          Construct a new Response for a failed invocation
 
Method Summary
 java.lang.Throwable getException()
          Returns the exception generated by the invocation
 java.lang.Object getObject()
          Returns the result of the invocation
 boolean isException()
          Determines if the response is an exception
 boolean isReturn()
          Determines if the response is a successful return
static Response read(java.io.ObjectInput in, java.lang.reflect.Method method)
          Read a response from a stream
 void write(java.io.ObjectOutput out)
          Writes this to a stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Response

public Response(java.lang.Object object,
                java.lang.reflect.Method method)
Construct a new Response for a successful invocation
Parameters:
object - the result of the invocation
method - the invoked method

Response

public Response(java.lang.Throwable exception)
Construct a new Response for a failed invocation
Parameters:
exception - the exception generated by the invocation
Method Detail

getObject

public java.lang.Object getObject()
Returns the result of the invocation
Returns:
the result of the invocation

getException

public java.lang.Throwable getException()
Returns the exception generated by the invocation
Returns:
the exception, or null if no exception was thrown

isReturn

public boolean isReturn()
Determines if the response is a successful return
Returns:
true if the response is a successful return

isException

public boolean isException()
Determines if the response is an exception
Returns:
true if the response is an exception

write

public void write(java.io.ObjectOutput out)
           throws java.io.IOException
Writes this to a stream
Parameters:
out - the stream to write to
Throws:
java.io.IOException - if an I/O error occurs

read

public static Response read(java.io.ObjectInput in,
                            java.lang.reflect.Method method)
                     throws java.lang.ClassNotFoundException,
                            java.io.IOException
Read a response from a stream
Parameters:
in - the stream to read from
method - the method that the response relates to
Returns:
the read response
Throws:
java.lang.ClassNotFoundException - if the response contains a class which can't be found
java.io.IOException - if an I/O error occurs


Copyright © 1999-2007 The OpenJMS Group. All Rights Reserved.