About Operator and SDS Services for Ninja Paths


The java.madden package consists of classes and interfaces to:

1. Make operators available via SDS (ninja.madden.SDSOperatorIF)
2. Find registered operators (ninja.madden.OpServices)
3. Get interfaces to running operators (ninja.madden.OpInfo::getOperatorStubs)
4. Start operators on new machines (ninja.madden.OpInfo::loadOperator)
 

Common Questions

How Do I Register An Operator ?

Any service will be automatically registered via SDS as an Operator if it extends the SDSOperator.java abstract base class. This interface requires the abstract method GetServiceDescription to be implemented.

The GetServiceDescription method can return an arbitrary string (perhaps XML) which the operator uses to describe parameters about itself.

The SDSOperator.java and OpServices.java modules do not require this routine to insert any text -- it is for use by the operator and they are capable of registering and distinguishing operators by themselves.
 
 

How Are Operators Identified ?

The OpServices module tracks three pieces of information about each operator:

1. The url to the machine the operator is running on (a rmi-style url)
2. The description returned by the operators GetServiceDescription parameter
3. The name of the class which implements the operator

When the OpServices::uniqueOps routine is called, it returns all of the operators with distinct class names.

The OpInfo structure allows OpServices clients to all three of the above pieces of information.
 
 

How Do I Search For An Operator ?

A number of different sets of operators can be loaded via OpServices:

1) OpServices::operators : The list of all operators running on all machines
2) OpServices::uniqueOps : The unique operators running (only operators with distinct class names are returned)
3) OpServices::opInstances : All instances of an operator with a particular name
4) OpServices::searchOperators : ???
 
 

How Can I Load An Operator On A New Machine ?


When an operator is registered via SDS, that operator must be running in the iSpace of the registering machine. This is partially an artifact of SDS, which periodically polls all registered services to make sure they are available. It also simplifies substantially the bookkeeping which OpServices has to do to keep track of uploadable operators: the only operators which can be loaded onto a new iSpace are those which are already running on some other iSpace.

When an SDSOperator is started in an iSpace, it may optionally include one parameter: an http:// style URL to a web-location where the .class file for that operator can be found. When this parameter is included, the operator is said to be "mobile", meaning it can be instantiated on any iSpace. The OpInfo::HasFileURL routine can be used to determine if a particular operator is mobile.

To start a mobile operator on a particular iSpace, the OpServices::loadOperator routine can be called with an OpInfo strucutre identifying the operator and a string indicating the hostname to upload the code onto. The host name can either be a standard ip address (xxx.xxx.xxx.xxx) or a fully qualified domain name (e.g. machine@berkeley.edu).
 

How do I receive periodic updates when operators appear/disappear from the SDS?

1) In the class you wish to have receive updates, implement the OpNotifierIF interface, with its two routines, addOperator and removeOperator.

2) Create a new OpNotifier instance, passing it a reference to an instance of the class which implements OpNotifierIF.

3) On the new OpNotfier, call run, which will start a thread that polls periodically for new operators.

As soon as run is called, a snapshot of currently running operators is made.  Then, when a new operator is registered, the addOperator routine of the OpNotifierIF implementer will be called.  Similarly, when an operator disappears, the removeOperator routine of the OpNotifierIF implemented is called.
 

This page maintained by Sam Madden -- madden@cs.berkeley.edu