PS/SL Middleware Project
Remote Device Access API

cmw.rda.server
Class DeviceServerBase

java.lang.Object
  |
  +--cmw.rda.server.DeviceServerBase
Direct Known Subclasses:
DeviceServer

public abstract class DeviceServerBase
extends java.lang.Object

The common superclass for all device servers.


Field Summary
static boolean DEBUG
          This field is used internally and applications should not change it.
 
Constructor Summary
DeviceServerBase(java.lang.String serverName)
          Constructs a device server with the specified name.
 
Method Summary
abstract  Data get(IOPoint iop, Data context)
          Returns a value at the specified I/O point.
abstract  void monitorOff(IOPoint iop, ValueChangeListener listener)
          Cancels a subscription identified by the I/O point and listener.
abstract  void monitorOn(IOPoint iop, ValueChangeListener listener)
          Starts a subscription to value at the specified I/O point.
 void runServer()
          Makes the server available for clients.
abstract  void set(IOPoint iop, Data value, Data context)
          Changes a value at the specified I/O point.
 void shutDown()
          Deactivates the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG
This field is used internally and applications should not change it.
Constructor Detail

DeviceServerBase

public DeviceServerBase(java.lang.String serverName)
Constructs a device server with the specified name. The constructor prepares all the facilities required to make the server available for clients over the network, but does not activate the communications. Access to the server can be enabled when it is fully constructed (all subclass constructors successfully completed) using the runServer method of the class.

Parameters:
serverName - the name under which the new server will be registered with the naming service when activated by the runServer call.
Method Detail

get

public abstract Data get(IOPoint iop,
                         Data context)
                  throws BadParameter,
                         IOError
Returns a value at the specified I/O point.

This method is invoked when a client executes a get operation on a device that resides at this server (see client API).

Throws:
BadParameter - if any of the call arguments has an illegal value
IOError - if an I/O error occurs.
See Also:
IOPoint

set

public abstract void set(IOPoint iop,
                         Data value,
                         Data context)
                  throws BadParameter,
                         IOError
Changes a value at the specified I/O point.

This method is invoked when a client executes a set operation on a device that resides at this server (see client API).

Throws:
BadParameter - if any of the call arguments has an illegal value
IOError - if an I/O error occurs.
See Also:
IOPoint

monitorOn

public abstract void monitorOn(IOPoint iop,
                               ValueChangeListener listener)
                        throws BadParameter
Starts a subscription to value at the specified I/O point.

This method is invoked when a client executes a monitorOn operation on a device that resides at this server (see client API).

Parameters:
iop - the I/O point identifier
listener - the "callback" object where to deliver subscription results.
Throws:
BadParameter - if the iop argument is invalid.

monitorOff

public abstract void monitorOff(IOPoint iop,
                                ValueChangeListener listener)
Cancels a subscription identified by the I/O point and listener.

runServer

public void runServer()
               throws InternalException
Makes the server available for clients.

Each device server must call this method when it is ready to accept client requests. The method registers the server with the naming service and enters event loop to receive incoming requests. The method only returns if shutDown is called on the server.

Throws:
InternalException - if the call fails due to some internal error.

shutDown

public void shutDown()
Deactivates the server. This method causes runServer() to return.

Version 1.0 August 2000
N.Trofimov