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

java.lang.Object
  extended by edu.stanford.hci.r3.actions.remote.ActionReceiver

public class ActionReceiver
extends java.lang.Object

A daemon that sits and waits for actions to come in over the wire. It then invokes those actions.

This software is distributed under the BSD License.


Field Summary
static java.lang.String CONFIG_FILE_KEY
          Read our trusted senders from this config file (see Configuration.java).
static java.lang.String CONFIG_FILE_VALUE
           
static int DEFAULT_JAVA_PORT
          Will listen on this port for Java XML objects.
static int DEFAULT_PLAINTEXT_PORT
          Will listen on this port for text commands.
 
Constructor Summary
ActionReceiver(int tcpipPort, ClientServerType type)
          Will only accept actions from the localhost.
ActionReceiver(int tcpipPort, ClientServerType type, java.lang.String... trusted)
           
 
Method Summary
 void addActionHandler(ActionHandler handler)
          Add another listener that handles received actions.
 java.lang.String getHostAddress()
           
 java.lang.String getHostName()
           
 void setConnectionListener(ActionReceiverConnectionListener listener)
           
static void startDaemons()
          Unlike the pen servers, it's probably OK to start both a java and text server...
static void startDaemons(int tcpipPortJava, int tcpipPortPlainText)
           
 void stopDaemon()
          Tell the server to stop sending actions.
static void stopDaemons()
          Kill one or both servers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_FILE_KEY

public static final java.lang.String CONFIG_FILE_KEY
Read our trusted senders from this config file (see Configuration.java).

See Also:
Constant Field Values

CONFIG_FILE_VALUE

public static final java.lang.String CONFIG_FILE_VALUE
See Also:
Constant Field Values

DEFAULT_JAVA_PORT

public static final int DEFAULT_JAVA_PORT
Will listen on this port for Java XML objects.

See Also:
Constant Field Values

DEFAULT_PLAINTEXT_PORT

public static final int DEFAULT_PLAINTEXT_PORT
Will listen on this port for text commands.

See Also:
Constant Field Values
Constructor Detail

ActionReceiver

public ActionReceiver(int tcpipPort,
                      ClientServerType type)
Will only accept actions from the localhost.

Parameters:
type -
tcpipPortPlainText -

ActionReceiver

public ActionReceiver(int tcpipPort,
                      ClientServerType type,
                      java.lang.String... trusted)
Parameters:
trusted - a list of IPs, DNSs, or (todo) subnets that we trust...
Method Detail

startDaemons

public static void startDaemons()
Unlike the pen servers, it's probably OK to start both a java and text server...


startDaemons

public static void startDaemons(int tcpipPortJava,
                                int tcpipPortPlainText)
Parameters:
tcpipPortJava -
tcpipPortPlainText -

stopDaemons

public static void stopDaemons()
Kill one or both servers.


addActionHandler

public void addActionHandler(ActionHandler handler)
Add another listener that handles received actions.

Parameters:
handler -

getHostAddress

public java.lang.String getHostAddress()
Returns:

getHostName

public java.lang.String getHostName()
Returns:

setConnectionListener

public void setConnectionListener(ActionReceiverConnectionListener listener)
Parameters:
listener -

stopDaemon

public void stopDaemon()
Tell the server to stop sending actions.


Copyright 2006 Stanford University