multivalent.net

Class RemoteControl

public class RemoteControl extends Behavior implements Runnable

Accept semantic events via socket listening on port. Special case: http://localhost:port/command?argument. where the default port is 5549 and command is a semantic event string name. For example, http://localhost:5549/openDocument?http://www.cs.berkeley.edu/ sent from a web browser or programming language instructs the browser to open a well-known web page. A list of semantic events and their string equivalents is available in the Javadoc constants page (look for MSG_*). At this time only semantic events with zero or one-String argument can be invoked this way.

Version: $Revision: 1.2 $ $Date: 2003/02/12 22:51:35 $

Field Summary
static StringATTR_PORT
Attribute to pass port number.
static intDEFAULT_PORT
Method Summary
voidrestore(ESISNode n, Map<String,Object> attr, Layer layer)
When browser destroyed, release port.
voidrun()
Listens on socket, send semantic event to browser....

Field Detail

ATTR_PORT

public static final String ATTR_PORT
Attribute to pass port number.

DEFAULT_PORT

public static final int DEFAULT_PORT

Method Detail

restore

public void restore(ESISNode n, Map<String,Object> attr, Layer layer)
When browser destroyed, release port. public boolean semanticEventAfter(SemanticEvent se, String msg) { if (Browser.MSG_CLOSE==msg) { // release port System.out.println("interrupt thread"); thread_.currentThread().interrupt(); // messy probably waiting on accept } return super.semanticEventAfter(se, msg); }

run

public void run()
Listens on socket, send semantic event to browser....