ch.ethz.iks.r_osgi.messages
Class RemoteCallResultMessage

java.lang.Object
  extended by ch.ethz.iks.r_osgi.messages.RemoteOSGiMessage
      extended by ch.ethz.iks.r_osgi.messages.RemoteCallResultMessage

public final class RemoteCallResultMessage
extends RemoteOSGiMessage

MethodResultMessage is used to return the result of a method invocation to the invoking remote peer.

Since:
0.1
Author:
Jan S. Rellermeyer, ETH Zurich

Field Summary
 
Fields inherited from class ch.ethz.iks.r_osgi.messages.RemoteOSGiMessage
DELIVER_BUNDLE, DELIVER_BUNDLES, DELIVER_SERVICE, LEASE, LEASE_UPDATE, REMOTE_CALL, REMOTE_CALL_RESULT, REMOTE_EVENT, REQUEST_BUNDLE, REQUEST_DEPENDENCIES, REQUEST_SERVICE, STREAM_REQUEST, STREAM_RESULT, TIME_OFFSET, xid
 
Constructor Summary
RemoteCallResultMessage()
          creates a new MethodResultMessage from InvokeMethodMessage and set the exception.
 
Method Summary
 boolean causedException()
          did the method invocation cause an exception ?
 java.lang.Throwable getException()
          get the exception.
 java.lang.Object getResult()
          get the result object.
 void setException(java.lang.Throwable t)
          set the exception.
 void setResult(java.lang.Object result)
          set the result.
 java.lang.String toString()
          String representation for debug outputs.
 void writeBody(java.io.ObjectOutputStream out)
          write the body of the message to a stream.
 
Methods inherited from class ch.ethz.iks.r_osgi.messages.RemoteOSGiMessage
getFuncID, getXID, parse, readBytes, readStringArray, send, setXID, writeBytes, writeStringArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteCallResultMessage

public RemoteCallResultMessage()
creates a new MethodResultMessage from InvokeMethodMessage and set the exception.

Method Detail

writeBody

public void writeBody(java.io.ObjectOutputStream out)
               throws java.io.IOException
write the body of the message to a stream.

Specified by:
writeBody in class RemoteOSGiMessage
Parameters:
out - the ObjectOutputStream.
Throws:
java.io.IOException - in case of IO failures.
See Also:
ch.ethz.iks.r_osgi.messages.RemoteOSGiMessage#getBody()

causedException

public boolean causedException()
did the method invocation cause an exception ?

Returns:
true, if an exception has been thrown on the remote side. In this case, the exception can be retrieved through the getException method.

getResult

public java.lang.Object getResult()
get the result object.

Returns:
the return value of the invoked message.

setResult

public void setResult(java.lang.Object result)
set the result.

Parameters:
result - the result.

getException

public java.lang.Throwable getException()
get the exception.

Returns:
the exception or null if non was thrown.

setException

public void setException(java.lang.Throwable t)
set the exception.

Parameters:
t - the exception.

toString

public java.lang.String toString()
String representation for debug outputs.

Overrides:
toString in class java.lang.Object
Returns:
a string representation.
See Also:
Object.toString()


Copyright © 2009 IKS, ETH Zurich. All Rights Reserved.