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)
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.
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.
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 : ???
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).
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.