multivalent.net
Class RemoteControl
java.lang.Object
multivalent.VObject
multivalent.Behavior
multivalent.net.RemoteControl
- All Implemented Interfaces:
- java.lang.Runnable
- public class RemoteControl
- extends Behavior
- implements java.lang.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 $
Method Summary |
void |
restore(ESISNode n,
java.util.Map<java.lang.String,java.lang.Object> attr,
Layer layer)
When browser destroyed, release port. |
void |
run()
Listens on socket, send semantic event to browser.... |
Methods inherited from class multivalent.Behavior |
buildAfter, buildBefore, checkRep, clipboardAfter, clipboardBefore, createUI, destroy, eventAfter, eventBefore, formatAfter, formatBefore, getBrowser, getDocument, getInstance, getInstance, getLayer, getLogger, getName, getPreference, getRoot, isEditable, paintAfter, paintBefore, putPreference, redo, restoreChildren, save, semanticEventAfter, semanticEventBefore, setName, toString, undo |
Methods inherited from class multivalent.VObject |
attrEntrySetIterator, attrKeysIterator, clearAttributes, getAttr, getAttr, getAttributes, getGlobal, getValue, hasAttributes, putAttr, removeAttr, setAttributes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ATTR_PORT
public static final java.lang.String ATTR_PORT
- Attribute to pass port number.
- See Also:
- Constant Field Values
PORT_DEFAULT
public static final int PORT_DEFAULT
- See Also:
- Constant Field Values
RemoteControl
public RemoteControl()
run
public void run()
- Listens on socket, send semantic event to browser....
- Specified by:
run
in interface java.lang.Runnable
restore
public void restore(ESISNode n,
java.util.Map<java.lang.String,java.lang.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);
}
- Overrides:
restore
in class Behavior