Main Page | Features | Central Services | csv-Files | Types | Transfer | Access | API-C | API-VB/ActiveX | API-Java | Examples | Downloads
Public Member Functions | Static Public Member Functions
de.desy.tine.server.equipment.TEquipmentModuleFactory Class Reference

Equipment module factory. More...

List of all members.

Public Member Functions

int setSystemAlias (String alias, String name)
 Sets a system alias pair.
int SetFreeBlocksAlarmThreshold (String path, long minFreeBlocks)
 Add given path to the automatic alarm generation tables for low disk space.
void setSendSingleDelivery (boolean value)
 Sets ability to handle synchronous requests in an 'express' manner.
boolean getSendSingleDelivery ()
 Gets the current setting for the ability to handle synchronous requests in an 'express' manner.
int registerCycleTrigger (TCycleTrigger trigger)
 Registers a cycle trigger callback dispatch function.

Static Public Member Functions

static void setServerWaiting (boolean value)
 A server can be toggled in and out of a waiting state with this method.
static void setRenewalLength (short value)
 A server can explicitly set the contract subscription renewal length with this call.

Detailed Description

Equipment module factory.

The equipment module factory maintains a list of registered equipment modules in a running TINE server process. It manages all access and scheduling of the associated dispatch and property handlers as well as local history and alarm access.

Author:
duval
duval

Member Function Documentation

boolean de.desy.tine.server.equipment.TEquipmentModuleFactory.getSendSingleDelivery ( )

Gets the current setting for the ability to handle synchronous requests in an 'express' manner.

If set to 'true' (default) then incoming synchronous requests are handled immediately without scanning an collating the current contract table

Returns:
the current setting
int de.desy.tine.server.equipment.TEquipmentModuleFactory.registerCycleTrigger ( TCycleTrigger  trigger)

Registers a cycle trigger callback dispatch function.

If a CYCLER is running in a server's context, then the server will receive 'Cycle Number' events scheduled by the designated CYCLER server. The cycle number will make use of the 'System Data Stamp' to tag all data sets obtained from the server. A server can also register a trigger function dispatch routine (or routines) to be called when a 'Cycle Number' event occurs. The dispatch routines will be called prior to setting the 'System Stamp' to the new Cycle Number, which will be set following the execution of all dispatch routines. Optionally, the server can provide a property (or list of properties) to be scheduled following the dispatch execution. This will ensure that such properties will be called immediately following dispatch execution AND contain the most recent Cycle Number as the 'System Data Stamp'.

Parameters:
triggeris a reference to the dispatch handler to be called when a new cycle number arrives.
Returns:
0 upon success or TErrorList.already_assigned

Example:

  class MyCycleTrigger implements TCycleTrigger
  {
    long ts = 0;
    public void update(int cycleNumber, int status)
    {
      long tts = System.currentTimeMillis();
      if (ts == tts)
      { // 2 updates within the same millisecond ? (are there 2 CYCLERs?)
        return;
      }
      ts = tts;
      DbgLog.log("update","received cycle number : "+cycleNumber+" <"+status+">");
      // do something useful?  (maybe hardware IO)
    } 
  }
  private void initializeDeviceServer()
  {
    sineEqpModule = new SineEquipmentModule("SINEQM",(SineDevice[])sineDeviceSet.toArray(new SineDevice[0]));
    sineEqpModule.registerCycleTrigger(new MyCycleTrigger());
    // can alternatively be registered directly with the equipment module factory (e.g.):
    // TEquipmentModuleFactory.getInstance().registerCycleTrigger(new MyCycleTrigger());
    // Other iniatialization stuff omitted ...
    // ...
  }
int de.desy.tine.server.equipment.TEquipmentModuleFactory.SetFreeBlocksAlarmThreshold ( String  path,
long  minFreeBlocks 
)

Add given path to the automatic alarm generation tables for low disk space.

A server can instruct the local alarm subsystem to automatically generate low disk space warnings and alarms by making use of this method.

Parameters:
pathis the path containing the disk drive or device mount which is to be monitored for available disk space
minFreeBlocksis the minimum number of free blocks (1000 byte units) which must be available. If the available disk space goes below this value a 'warn_disk_space' alarm is issued. If the available disk space goes below 10 percent of this value a 'low_disk_space' alarm is issued.
Returns:
0 upon success or a TINE error code.

For example:

TEquipmentModuleFactory.getInstance().SetFreeBlocksAlarmThreshold("L:/history", 50000000L);

will cause disk space alarms to occur if the drive "L:" (windows system) shows fewer than 50000000 blocks (i.e. 50000000000 bytes) available.

static void de.desy.tine.server.equipment.TEquipmentModuleFactory.setRenewalLength ( short  value) [static]

A server can explicitly set the contract subscription renewal length with this call.

Subscriptions generally have a set duration length of 60 at 'normal' polling intervals, which is periodically renewed by the client. Under some circumstances (e.g. the server expects 'CM_EVENT' acquisition mode and knows that the event interval is small) the server will want to explicitly set the duration length to some larger value.

Parameters:
valueis the desired contact subscription renewal length
void de.desy.tine.server.equipment.TEquipmentModuleFactory.setSendSingleDelivery ( boolean  value)

Sets ability to handle synchronous requests in an 'express' manner.

If set to 'true' (default) then incoming synchronous requests are handled immediately without scanning an collating the current contract table

Parameters:
valueis the desired setting (default = true)
See also:
getSendSingleDelivery()
static void de.desy.tine.server.equipment.TEquipmentModuleFactory.setServerWaiting ( boolean  value) [static]

A server can be toggled in and out of a waiting state with this method.

During initialization it might be prudent to set the waiting state to 'true' until all initialization has been completed and the server is ready to server, at which point the waiting state can then be set to 'false'.

If the server is in a waiting state, all requests will receive the error code 'not initialized' as the link status.

Parameters:
valueis the wait state.
int de.desy.tine.server.equipment.TEquipmentModuleFactory.setSystemAlias ( String  alias,
String  name 
)

Sets a system alias pair.

An alias can be established for any registered property or device via this method call.

Parameters:
aliasis an alias name which can be used for the registered device or property given.
nameis the targeted registered device or property for which an alias is desired.
Returns:
0 if successful or a tine error code.

The documentation for this class was generated from the following file: