edu.stanford.hci.r3.actions.remote
Class ActionMessenger

java.lang.Object
  extended by edu.stanford.hci.r3.actions.remote.ActionMessenger
Direct Known Subclasses:
ActionJavaObjectXMLMessenger, ActionPlainTextMessenger

public abstract class ActionMessenger
extends java.lang.Object

Given an R3Action, the messenger will package it up and send it across the wire, so that the receiver can perform the designated action.

This software is distributed under the BSD License.


Field Summary
protected static java.lang.String LINE_SEPARATOR
          The OS-specific newline string.
 
Constructor Summary
ActionMessenger(java.net.Socket s)
           
 
Method Summary
 void destroy()
          Clean up resources.
abstract  byte[] getMessage(R3Action action)
          Get the byte array to send across the socket.
 void sendAction(R3Action action)
          Sends the bytes over the wire.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_SEPARATOR

protected static final java.lang.String LINE_SEPARATOR
The OS-specific newline string.

Constructor Detail

ActionMessenger

public ActionMessenger(java.net.Socket s)
Parameters:
s -
Method Detail

destroy

public void destroy()
Clean up resources.


getMessage

public abstract byte[] getMessage(R3Action action)
Get the byte array to send across the socket.

Parameters:
action -
Returns:

sendAction

public void sendAction(R3Action action)
Sends the bytes over the wire.

Parameters:
action -

Copyright 2006 Stanford University