ch.ethz.iks.r_osgi.messages
Class StreamResultMessage

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

public final class StreamResultMessage
extends RemoteOSGiMessage

Stream result message.

Author:
Michael Duller, ETH Zurich.

Field Summary
static short RESULT_ARRAY
          result indicates array.
static short RESULT_EXCEPTION
          result indicates exception.
static short RESULT_WRITE_OK
          result indicates write operation completed successfully.
 
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
StreamResultMessage()
          creates a new StreamResultMessage.
 
Method Summary
 boolean causedException()
          did the stream operation cause an exception ?
 byte[] getData()
          get the data array.
 java.io.IOException getException()
          get the exception.
 int getLen()
          get the length.
 short getResult()
          get the result value.
 void setData(byte[] b)
          set the data array.
 void setException(java.io.IOException exception)
          set the exception.
 void setLen(int len)
          set the length.
 void setResult(short result)
          set the result value.
 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
 

Field Detail

RESULT_ARRAY

public static final short RESULT_ARRAY
result indicates array.

See Also:
Constant Field Values

RESULT_EXCEPTION

public static final short RESULT_EXCEPTION
result indicates exception.

See Also:
Constant Field Values

RESULT_WRITE_OK

public static final short RESULT_WRITE_OK
result indicates write operation completed successfully.

See Also:
Constant Field Values
Constructor Detail

StreamResultMessage

public StreamResultMessage()
creates a new StreamResultMessage.

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.impl.RemoteOSGiMessageImpl#getBody()

causedException

public boolean causedException()
did the stream operation 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 short getResult()
get the result value.

Returns:
the return value of the invoked operation.

setResult

public void setResult(short result)
set the result value.

Parameters:
result - the result.

getData

public byte[] getData()
get the data array.

Returns:
the array containing the read data.

setData

public void setData(byte[] b)
set the data array.

Parameters:
b - the array containing the read data.

getLen

public int getLen()
get the length.

Returns:
the number of bytes read.

setLen

public void setLen(int len)
set the length.

Parameters:
len - the number of bytes read.

getException

public java.io.IOException getException()
get the exception.

Returns:
the exception or null if none was thrown.

setException

public void setException(java.io.IOException exception)
set the exception.

Parameters:
exception - the exception that was thrown.

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.