The Broker's Methods

NOTE: The information below is not correct. It describes what the method calls should look like, but they have not been changed to look like this yet.

Conventions

A message is constructed by an object identifier followed by a method name and any parameters.
The object identifier may look like:
<class>
<class>.<instanceId>
<class>.<instanceId>.<attribute>

Subscriptions

The Broker supports a concept of publications and subscriptions, whereby modules can subscribe to objects, and are then notified upon changes to those objects.

These functions work as follows. <publication> is the name of an object which one can subscribe to. 

<publication> subscribe <moduleName> <moduleData>
Result:
<subscriptionId>


<publication> cancelSubscription <subscriptionId>
Result:
none

The following calls can be made to the Broker:

StartableServer list
StartableServer add <password> <name> "<command-line>" <restart> <startTimeout>
    <stopTimeout> <email>
StartableServer.<name> stop
StartableServer.<name> start
StartableServer.<name> info
StartableServer.<name> change <newName> <newCommandLine>
StartableServer.<name>.stderr get
StartableServer.<name>.stderr subscribe
StartableServer.<name>.stdout get
StartableServer.<name>.stdout subscribe <clientName>

Connection list
Connection.<name> subscribe <clientName>
Connection.<name>.log get
Connection.<name>.log subscribe

Subscription.<id> cancel
Subscription.<id> notify
 

Our implementation of the Broker is written in Java, and should therefore run on any platform which has a Java 1.1 environment. Sun Microsystems' implementation of Java (called the Java Runtime Environment) is freely available from JavaSoft. If you wish to develop in Java, you should get the Java Development Kit (JDK) instead.

The Broker itself is a stand-alone Java program, with class SE.kth.speech.broker.Broker. It takes two parameters: the port on which it listens for incoming TCP connections, and the password used to access some restricted features (such as changing the set of startable servers.)

To use the Broker, first you must download the Java classes. Then the supplied .jar (Java Archive) files must be added to the CLASSPATH (Under UNIX, CLASSPATH is an environment variable). Under tcsh, this is done with a command like (but you will hopefully want to put the files in a better place than /tmp):

setenv CLASSPATH /tmp/broker.jar:/tmp/broker/erl.jar
Then you can start a broker like this:
java SE.kth.speech.broker.Broker 4711 guess
Where 4711 is the port of the Broker, and guess is the password.

And bring up the Broker User Interface with (you might want to replace localhost with the host name you are running the broker on):

java SE.kth.speech.broker.GUI localhost 4711
Now you can try running the Java or Tcl examples if you want.


Previous: Using the Broker from Tcl, Up: The Broker, Next: Download the Broker

© Copyright 1997 Erland Lewin and the members of the Center for Speech Technology