Voyager ORB

com.objectspace.voyager.message
Class Result

java.lang.Object
  |
  +--com.objectspace.voyager.message.Result

public final class Result
extends java.lang.Object

A Result represents the result of a Sync or Future message. A Result may be polled using isAvailable(), read in a blocking fashion using the readXXX() family of methods, or listened to using addResultListener(). If the reply is not received within the specified timeout period, the result is set to a TimeoutException. The final values of any holder arguments are accessible via the getArgs() method.

Version:
3.0

Method Summary
 void addResultListener(ResultListener listener)
          Add the specified listener to my set of result listeners.
 java.lang.Object[] getArgs()
          Return the arguments.
 java.lang.Exception getException()
          Wait for the reply and then return the exception or null if the method succeeded.
 long getTimeout()
          Return my timeout value in milliseconds.
 boolean isAvailable()
          Return true if the reply has arrived.
 boolean isException()
          Wait for the reply and then return true if it is an exception.
 boolean readBoolean()
          Wait for the reply and then return the result as a boolean or rethrow an exception if one occurred.
 byte readByte()
          Wait for the reply and then return the result as a byte or rethrow an exception if one occurred.
 char readChar()
          Wait for the reply and then return the result as a char or rethrow an exception if one occurred.
 double readDouble()
          Wait for the reply and then return the result as a double or rethrow an exception if one occurred.
 float readFloat()
          Wait for the reply and then return the result as a float or rethrow an exception if one occurred.
 int readInt()
          Wait for the reply and then return the result as an int or rethrow an exception if one occurred.
 long readLong()
          Wait for the reply and then return the result as a long or rethrow an exception if one occurred.
 java.lang.Object readObject()
          Wait for the reply and then return the result as an object or rethrow an exception if one occurred.
 short readShort()
          Wait for the reply and then return the result as a short or rethrow an exception if one occurred.
 void removeResultListener(ResultListener listener)
          Remove the specified listener from my set of result listeners.
 java.lang.String toString()
          Return a string that describes me.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

toString

public java.lang.String toString()
Return a string that describes me.
Overrides:
toString in class java.lang.Object

readObject

public java.lang.Object readObject()
                            throws java.lang.Exception
Wait for the reply and then return the result as an object or rethrow an exception if one occurred.
Throws:
java.lang.Exception - Any exception that occurred during the process of method invocation.

readInt

public int readInt()
            throws java.lang.Exception
Wait for the reply and then return the result as an int or rethrow an exception if one occurred.
Throws:
java.lang.Exception - Any exception that occurred during the process of method invocation.

readByte

public byte readByte()
              throws java.lang.Exception
Wait for the reply and then return the result as a byte or rethrow an exception if one occurred.
Throws:
java.lang.Exception - Any exception that occurred during the process of method invocation.

readChar

public char readChar()
              throws java.lang.Exception
Wait for the reply and then return the result as a char or rethrow an exception if one occurred.
Throws:
java.lang.Exception - Any exception that occurred during the process of method invocation.

readBoolean

public boolean readBoolean()
                    throws java.lang.Exception
Wait for the reply and then return the result as a boolean or rethrow an exception if one occurred.
Throws:
java.lang.Exception - Any exception that occurred during the process of method invocation.

readFloat

public float readFloat()
                throws java.lang.Exception
Wait for the reply and then return the result as a float or rethrow an exception if one occurred.
Throws:
java.lang.Exception - Any exception that occurred during the process of method invocation.

readDouble

public double readDouble()
                  throws java.lang.Exception
Wait for the reply and then return the result as a double or rethrow an exception if one occurred.
Throws:
java.lang.Exception - Any exception that occurred during the process of method invocation.

readLong

public long readLong()
              throws java.lang.Exception
Wait for the reply and then return the result as a long or rethrow an exception if one occurred.
Throws:
java.lang.Exception - Any exception that occurred during the process of method invocation.

readShort

public short readShort()
                throws java.lang.Exception
Wait for the reply and then return the result as a short or rethrow an exception if one occurred.
Throws:
java.lang.Exception - Any exception that occurred during the process of method invocation.

getArgs

public java.lang.Object[] getArgs()
Return the arguments.

isAvailable

public boolean isAvailable()
Return true if the reply has arrived.

isException

public boolean isException()
                    throws TimeoutException
Wait for the reply and then return true if it is an exception.
Throws:
TimeoutException - This invocation has timed out.

getException

public java.lang.Exception getException()
                                 throws TimeoutException
Wait for the reply and then return the exception or null if the method succeeded.
Throws:
TimeoutException - This invocation has timed out.

addResultListener

public void addResultListener(ResultListener listener)
Add the specified listener to my set of result listeners.
Parameters:
listener - The listener to add.

removeResultListener

public void removeResultListener(ResultListener listener)
Remove the specified listener from my set of result listeners.
Parameters:
listener - The listener to remove.

getTimeout

public long getTimeout()
Return my timeout value in milliseconds.

ObjectSpace Inc.

(c) Copyright 1997-1999 ObjectSpace, Inc.
14850 Quorum Drive, Suite 500
Dallas, Texas 75240