context.arch.enactor.server
Class EnactorXMLServer

java.lang.Object
  extended bycontext.arch.enactor.server.EnactorXMLServer
All Implemented Interfaces:
java.lang.Runnable

public class EnactorXMLServer
extends java.lang.Object
implements java.lang.Runnable

An XML server that tunnels all enactor events through sockets to clients, using XML to translate DataObjects to a language-independent serialized format. As client connections are created, each client becomes an EnactorListener to the Enactor passed into the server constructor. In this sense a server represents a single enactor. Different enactors use different servers and so have different addresses and ports. The specific protocol used for XML is compatible with the Macromedia Flash XMLSocket. Also, the EnactorXMLServer responds with HTML information about the Enactor when it receives HTTP GET requests. So, the one server on the single port acts as both an XML server and as a simple HTTP server.

Author:
newbergr

Constructor Summary
EnactorXMLServer(Enactor e, int port)
           
 
Method Summary
protected  java.lang.String getDataDictionary()
          This should at some point programmatically build an XML document that is then formatted in the browser via XSL.
 Enactor getEnactor()
           
protected  void handleSetParameter(DataObject dobject)
          takes a set parameter message sent by a client and sets the appropriate enactor parameter.
 void run()
          when the thread is started, the server begins to listen on its port and continually accepts new clients.
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnactorXMLServer

public EnactorXMLServer(Enactor e,
                        int port)
Method Detail

getEnactor

public Enactor getEnactor()

start

public void start()

run

public void run()
when the thread is started, the server begins to listen on its port and continually accepts new clients.

Specified by:
run in interface java.lang.Runnable

handleSetParameter

protected void handleSetParameter(DataObject dobject)
takes a set parameter message sent by a client and sets the appropriate enactor parameter.


getDataDictionary

protected java.lang.String getDataDictionary()
This should at some point programmatically build an XML document that is then formatted in the browser via XSL. For now, just returns HTML. TODO: improve data dictionary

Returns:
String HTML-formatted data dictionary