Equipment module factory. More...
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. | |
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.
| 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
| 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'.
| trigger | is a reference to the dispatch handler to be called when a new cycle number arrives. |
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.
| path | is the path containing the disk drive or device mount which is to be monitored for available disk space |
| minFreeBlocks | is 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. |
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.
| value | is 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
| value | is the desired setting (default = true) |
| 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.
| value | is 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.
| alias | is an alias name which can be used for the registered device or property given. |
| name | is the targeted registered device or property for which an alias is desired. |
1.7.4