org.spicefactory.cinnamon.io.netconnection
Class NetConnectionMessageHolder

java.lang.Object
  extended by org.spicefactory.cinnamon.io.netconnection.NetConnectionMessageHolder
All Implemented Interfaces:
MessageHolder

public class NetConnectionMessageHolder
extends Object
implements MessageHolder

Represents a single AMF0 message sent from a Flash NetConnection instance.

Author:
Jens Halm

Constructor Summary
NetConnectionMessageHolder()
          Creates a new instance.
NetConnectionMessageHolder(String clientId, Object body)
          Creates a new instance.
 
Method Summary
 String getClientId()
          Returns the client id for this message.
 Object getMessage()
          Returns the body of the message representing the actual request or response.
 void readObject(AMFInput input, boolean request)
          Restores the content of this message from the specified input.
 void writeObject(AMFOutput output, boolean request)
          Writes the content of this message to the specified output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetConnectionMessageHolder

public NetConnectionMessageHolder()
Creates a new instance.


NetConnectionMessageHolder

public NetConnectionMessageHolder(String clientId,
                                  Object body)
Creates a new instance.

Parameters:
clientId - the client id for this message (used internally by the AMF protocol)
body - the body of the message containing the request or response
Method Detail

getClientId

public String getClientId()
Returns the client id for this message. This is used internally by the AMF protocol.

Returns:
the client id for this message

getMessage

public Object getMessage()
Returns the body of the message representing the actual request or response.

Specified by:
getMessage in interface MessageHolder
Returns:
the body of the message representing the actual request or response

readObject

public void readObject(AMFInput input,
                       boolean request)
Restores the content of this message from the specified input.

Parameters:
input - the AMF3 data to read from
request - whether this message represents a request or a response

writeObject

public void writeObject(AMFOutput output,
                        boolean request)
Writes the content of this message to the specified output.

Parameters:
output - the output to write to
request - whether this message represents a request or a response