ChannelFactory
provides access to tine channels, by using a common tine layer for all requests that are targeted at the same address.
More...
Public Member Functions | |
void | setValue (String address, Object value) throws ConnectionException |
Synchronously sets the value to the given property. More... | |
void | setValue (String address, Object value, TDataType outValue, int timeout) throws ConnectionException |
Synchronously sets the value to the given property. More... | |
void | setValueAsync (String address, Object value, ChannelCallback callback) throws ConnectionException |
Asynchronously sets the value to the given property. More... | |
void | setValueAsync (String address, Object value, TDataType outValue, int timeout, ChannelCallback callback) throws ConnectionException |
Asynchronously sets the value to the given property. More... | |
void | setRawValue (String address, TDataType value) throws ConnectionException |
Synchronously sets the value to the given property. More... | |
void | setRawValue (String address, TDataType value, TDataType outValue, int timeout) throws ConnectionException |
Synchronously sets the value to the given property. More... | |
void | setRawValueAsync (String address, TDataType value, ChannelCallback callback) throws ConnectionException |
Asynchronously sets the value to the given property. More... | |
void | setRawValueAsync (String address, TDataType value, TDataType outValue, int timeout, ChannelCallback callback) throws ConnectionException |
Asynchronously sets the value to the given property. More... | |
Object | getValue (String address) throws ConnectionException |
Makes a single synchronous connection to the address specified by parameters and returns the value. More... | |
Object | getValue (String address, TDataType dataOut, Object dataIn, int timeout) throws ConnectionException |
Makes a single synchronous connection to the address specified by parameters and returns the value. More... | |
Object | getValueSync (String address) throws ConnectionException |
Makes a true single synchronous connection to the address specified by parameters and returns the value. More... | |
Object | getValueSync (String address, TDataType dataOut, Object dataIn, int timeout) throws ConnectionException |
Makes a true single synchronous connection to the address specified by parameters and returns the value. More... | |
void | getValueAsync (String address, ChannelCallback callback) throws ConnectionException |
Makes an asynchronous connection to the tine property specified by the device and property. More... | |
void | getValueAsync (String address, ChannelCallback callback, Object dataIn) throws ConnectionException |
Makes an asynchronous connection to the tine property specified by the device and property. More... | |
TDataType | getRawValue (String address) throws ConnectionException |
Makes a single synchronous connection to the address specified by parameters and returns the value. More... | |
TDataType | getRawValue (String address, TFormat outFormat, int outSize, Object dataIn) throws ConnectionException |
Makes a single synchronous connection to the address specified by parameters and returns the value. More... | |
TDataType | getRawValueSync (String address) throws ConnectionException |
Makes a true single synchronous connection (TINE synchronous link) to the address specified by parameters and returns the value. More... | |
TDataType | getRawValueSync (String address, TFormat outFormat, int outSize, Object dataIn) throws ConnectionException |
Makes a true single synchronous connection (TINE synchronous link) to the address specified by parameters and returns the value. More... | |
TDataType | getRawValue (String address, TFormat outFormat, int outSize, Object dataIn, boolean synchronousCall) throws ConnectionException |
Makes a single synchronous connection to the address specified by parameters and returns the value. More... | |
Channel | getChannel (String address, ConnectionMode mode, int rate, ChannelCallback callback) throws ConnectionException |
Creates a channel that receives notifications according to the given connection mode and rate. More... | |
Channel | getChannel (String address, ConnectionMode mode, int rate, ChannelCallback callback, Object dataIn) throws ConnectionException |
Creates a channel that receives notifications according to the given connection mode and rate. More... | |
Channel | getChannel (String address, TFormat dataOutFormat, int dataOutSize, ConnectionMode mode, int rate, ChannelCallback callback) throws ConnectionException |
Creates a channel that receives notifications according to the given connection mode and rate. More... | |
Channel | getChannel (String address, TFormat dataOutFormat, int dataOutSize, Object dataIn, ConnectionMode mode, int rate, ChannelCallback callback) throws ConnectionException |
Creates a channel that receives notifications according to the given connection mode and rate. More... | |
Channel | getChannel (String address, TDataType dataOutObject, Object dataIn, ConnectionMode mode, int rate, ChannelCallback callback) throws ConnectionException |
Creates a channel that receives notifications according to the given connection mode and rate. More... | |
void | close () |
Close all active links, interrupt all running threads. | |
Static Public Member Functions | |
static synchronized ChannelFactory | getInstance () |
Static Public Attributes | |
static final String | LINK_KEEP_ALIVE_MSEC = "tine.layer.keepAlive" |
The time for how long single read links are kept alive after no longer needed. | |
static final String | MAX_KEEP_ALIVE_MSEC = "tine.layer.maxKeepAlive" |
The maximum time how long an links are opened after no longer needed. | |
ChannelFactory
provides access to tine channels, by using a common tine layer for all requests that are targeted at the same address.
Channel de.desy.tine.accesslayer.ChannelFactory.getChannel | ( | String | address, |
ConnectionMode | mode, | ||
int | rate, | ||
ChannelCallback | callback | ||
) | throws ConnectionException |
Creates a channel that receives notifications according to the given connection mode and rate.
If connection mode is CHANGE the callback will receive a notification every time the value changes, if the connection mod is POLL the callback will receive notifications at the specified rate, if the mode is single the callback will receive a single notification. The connection is created using the default data format and size.
address | the property to connect to |
mode | the connection mode |
rate | the notification rate in milliseconds |
callback | the callback to receive notifications |
ConnectionException | if there was an error establishing connection |
Referenced by de.desy.tine.accesslayer.ChannelFactory.getChannel(), de.desy.tine.accesslayer.ChannelFactory.getRawValue(), and de.desy.tine.accesslayer.ChannelFactory.getValueAsync().
Channel de.desy.tine.accesslayer.ChannelFactory.getChannel | ( | String | address, |
ConnectionMode | mode, | ||
int | rate, | ||
ChannelCallback | callback, | ||
Object | dataIn | ||
) | throws ConnectionException |
Creates a channel that receives notifications according to the given connection mode and rate.
If connection mode is CHANGE the callback will receive a notification every time the value changes, if the connection mod is POLL the callback will receive notifications at the specified rate, if the mode is single the callback will receive a single notification. The connection is created using the default data format and size.
address | the property to connect to |
mode | the connection mode |
rate | the notification rate in milliseconds |
callback | the callback to receive notifications |
dataIn | the input data for the monitor |
ConnectionException | if there was an error establishing connection |
References de.desy.tine.accesslayer.ChannelFactory.getChannel().
Channel de.desy.tine.accesslayer.ChannelFactory.getChannel | ( | String | address, |
TDataType | dataOutObject, | ||
Object | dataIn, | ||
ConnectionMode | mode, | ||
int | rate, | ||
ChannelCallback | callback | ||
) | throws ConnectionException |
Creates a channel that receives notifications according to the given connection mode and rate.
If connection mode is CHANGE the callback will receive a notification every time the value changes, if the connection mod is POLL the callback will receive notifications at the specified rate, if the mode is single the callback will receive a single notification. The connection is created using the format and size given in the dataOutObject
, which will be assigned the output value upon completion.
address | the property to connect to |
dataOutObject | the object into which the output data will be written |
dataIn | some channels require input data to successfully read their values; the data are provided by the given parameter |
mode | the connection mode |
rate | the notification rate in milliseconds |
callback | the callback to receive notifications |
ConnectionException | if there was an error establishing connection |
References de.desy.tine.accesslayer.ChannelFactory.getChannel(), and de.desy.tine.definitions.TFormat.valueOf().
Channel de.desy.tine.accesslayer.ChannelFactory.getChannel | ( | String | address, |
TFormat | dataOutFormat, | ||
int | dataOutSize, | ||
ConnectionMode | mode, | ||
int | rate, | ||
ChannelCallback | callback | ||
) | throws ConnectionException |
Creates a channel that receives notifications according to the given connection mode and rate.
If connection mode is CHANGE the callback will receive a notification every time the value changes, if the connection mod is POLL the callback will receive notifications at the specified rate, if the mode is single the callback will receive a single notification. The connection is created using the given format and size. Depending on the server, the request might fail if the format and size are not compatible.
address | the property to connect to |
dataOutFormat | the requested output format; channel will provide data in this format |
dataOutSize | the requested output size; channel will provide data of this size |
mode | the connection mode |
rate | the notification rate in milliseconds |
callback | the callback to receive notifications |
ConnectionException | if there was an error establishing connection |
References de.desy.tine.accesslayer.ChannelFactory.getChannel().
Channel de.desy.tine.accesslayer.ChannelFactory.getChannel | ( | String | address, |
TFormat | dataOutFormat, | ||
int | dataOutSize, | ||
Object | dataIn, | ||
ConnectionMode | mode, | ||
int | rate, | ||
ChannelCallback | callback | ||
) | throws ConnectionException |
Creates a channel that receives notifications according to the given connection mode and rate.
If connection mode is CHANGE the callback will receive a notification every time the value changes, if the connection mod is POLL the callback will receive notifications at the specified rate, if the mode is single the callback will receive a single notification. The connection is created using the given format and size. Depending on the server, the request might fail if the format and size are not compatible with property type.
address | the property to connect to |
dataOutFormat | the requested output format; channel will provide data in this format |
dataOutSize | the requested output size; channel will provide data of this size |
dataIn | some channels require input data to successfully read their values; the data are provided by the given parameter |
mode | the connection mode |
rate | the notification rate in milliseconds |
callback | the callback to receive notifications |
ConnectionException | if there was an error establishing connection |
References de.desy.tine.accesslayer.ChannelFactory.getChannel(), and de.desy.tine.definitions.TFormat.valueOf().
|
static |
TDataType de.desy.tine.accesslayer.ChannelFactory.getRawValue | ( | String | address | ) | throws ConnectionException |
Makes a single synchronous connection to the address specified by parameters and returns the value.
If the value read failed a ConnectionException is thrown.
device | device name to connect to |
property | property name to connect to |
ConnectionException | if connection failed |
Referenced by de.desy.tine.accesslayer.ChannelFactory.getRawValue(), and de.desy.tine.accesslayer.ChannelFactory.getRawValueSync().
TDataType de.desy.tine.accesslayer.ChannelFactory.getRawValue | ( | String | address, |
TFormat | outFormat, | ||
int | outSize, | ||
Object | dataIn | ||
) | throws ConnectionException |
Makes a single synchronous connection to the address specified by parameters and returns the value.
If the value read failed a ConnectionException is thrown.
address | property name to connect to |
outFormat | requested data out format |
outSize | requested data out size |
dataIn | input data of the read request |
mode | the connection mode used |
ConnectionException | if connection failed |
References de.desy.tine.accesslayer.ChannelFactory.getRawValue().
TDataType de.desy.tine.accesslayer.ChannelFactory.getRawValue | ( | String | address, |
TFormat | outFormat, | ||
int | outSize, | ||
Object | dataIn, | ||
boolean | synchronousCall | ||
) | throws ConnectionException |
Makes a single synchronous connection to the address specified by parameters and returns the value.
If the value read failed a ConnectionException is thrown.
address | property name to connect to |
outFormat | requested data out format |
outSize | requested data out size |
dataIn | input data of the read request |
mode | the connection mode used |
synchronousCall | true to use a synchronous TINE link or false to use asynchronous link but still blocking this thread |
ConnectionException | if connection failed |
References de.desy.tine.accesslayer.ChannelFactory.getChannel(), de.desy.tine.accesslayer.Channel.getRawValue(), de.desy.tine.accesslayer.Channel.getStatus(), de.desy.tine.accesslayer.Channel.getStatusString(), de.desy.tine.definitions.TErrorList.hasData(), and de.desy.tine.definitions.TErrorList.toString().
TDataType de.desy.tine.accesslayer.ChannelFactory.getRawValueSync | ( | String | address | ) | throws ConnectionException |
Makes a true single synchronous connection (TINE synchronous link) to the address specified by parameters and returns the value.
If the value read failed a ConnectionException is thrown.
device | device name to connect to |
property | property name to connect to |
ConnectionException | if connection failed |
References de.desy.tine.accesslayer.ChannelFactory.getRawValue().
TDataType de.desy.tine.accesslayer.ChannelFactory.getRawValueSync | ( | String | address, |
TFormat | outFormat, | ||
int | outSize, | ||
Object | dataIn | ||
) | throws ConnectionException |
Makes a true single synchronous connection (TINE synchronous link) to the address specified by parameters and returns the value.
If the value read failed a ConnectionException is thrown.
address | property name to connect to |
outFormat | requested data out format |
outSize | requested data out size |
dataIn | input data of the read request |
mode | the connection mode used |
ConnectionException | if connection failed |
References de.desy.tine.accesslayer.ChannelFactory.getRawValue().
Object de.desy.tine.accesslayer.ChannelFactory.getValue | ( | String | address | ) | throws ConnectionException |
Makes a single synchronous connection to the address specified by parameters and returns the value.
If the value read failed a ConnectionException is thrown.
address | property name to connect to |
ConnectionException | if connection failed |
Referenced by de.desy.tine.accesslayer.ChannelFactory.getValue(), and de.desy.tine.accesslayer.ChannelFactory.getValueSync().
Object de.desy.tine.accesslayer.ChannelFactory.getValue | ( | String | address, |
TDataType | dataOut, | ||
Object | dataIn, | ||
int | timeout | ||
) | throws ConnectionException |
Makes a single synchronous connection to the address specified by parameters and returns the value.
If the value read failed a ConnectionException is thrown.
address | property name to connect to |
dataout | the object to received the output data |
dataIn | input data of the read request |
timeout | the timeout in milliseconds after which the call will return terminated |
ConnectionException | if connection failed |
References de.desy.tine.accesslayer.ChannelFactory.getValue().
void de.desy.tine.accesslayer.ChannelFactory.getValueAsync | ( | String | address, |
ChannelCallback | callback | ||
) | throws ConnectionException |
Makes an asynchronous connection to the tine property specified by the device and property.
When the value is received it is forwarded to the given callback. If the connection could not be established an exception is thrown.
address | the property name |
callback | callback to receive notifications |
ConnectionException | if there was an error establishing the connection |
References de.desy.tine.accesslayer.ChannelFactory.getChannel().
void de.desy.tine.accesslayer.ChannelFactory.getValueAsync | ( | String | address, |
ChannelCallback | callback, | ||
Object | dataIn | ||
) | throws ConnectionException |
Makes an asynchronous connection to the tine property specified by the device and property.
When the value is received it is forwarded to the given callback. If the connection could not be established an exception is thrown.
address | the full property name |
dataIn | the input object of the read request |
callback | callback to receive notifications |
ConnectionException | if there was an error establishing the connection |
References de.desy.tine.accesslayer.ChannelFactory.getChannel().
Object de.desy.tine.accesslayer.ChannelFactory.getValueSync | ( | String | address | ) | throws ConnectionException |
Makes a true single synchronous connection to the address specified by parameters and returns the value.
If the value read failed a ConnectionException is thrown.
address | property name to connect to |
ConnectionException | if connection failed |
References de.desy.tine.accesslayer.ChannelFactory.getValue().
Object de.desy.tine.accesslayer.ChannelFactory.getValueSync | ( | String | address, |
TDataType | dataOut, | ||
Object | dataIn, | ||
int | timeout | ||
) | throws ConnectionException |
Makes a true single synchronous connection to the address specified by parameters and returns the value.
If the value read failed a ConnectionException is thrown.
address | property name to connect to |
dataout | the object to received the output data |
dataIn | input data of the read request |
timeout | the timeout in milliseconds after which the call will return terminated |
ConnectionException | if connection failed |
References de.desy.tine.accesslayer.ChannelFactory.getValue().
void de.desy.tine.accesslayer.ChannelFactory.setRawValue | ( | String | address, |
TDataType | value | ||
) | throws ConnectionException |
Synchronously sets the value to the given property.
Upon success method does not return anything. If the write fails an exception si thrown, describing the error.
address | the proeprty to write to |
value | the value to write |
ConnectionException | if write failed for any reason |
void de.desy.tine.accesslayer.ChannelFactory.setRawValue | ( | String | address, |
TDataType | value, | ||
TDataType | outValue, | ||
int | timeout | ||
) | throws ConnectionException |
Synchronously sets the value to the given property.
Upon success method does not return anything; however the outValue does receive the readback value. If the write fails an exception si thrown, describing the error.
address | the proeprty to write to |
value | the value to write |
outValue | the data type that will receive the readback value after write is completed |
timeout | the timeout in milliseconds |
ConnectionException | if write failed for any reason |
void de.desy.tine.accesslayer.ChannelFactory.setRawValueAsync | ( | String | address, |
TDataType | value, | ||
ChannelCallback | callback | ||
) | throws ConnectionException |
Asynchronously sets the value to the given property.
Upon completed write the callback is notified, either through ChannelCallback#writeCompleted(Object) or ChannelCallback#writeFailed(Object, int).
address | the property to connect to |
value | the value to set |
callback | the callback to be notified |
ConnectionException | if establishing the connection failed |
void de.desy.tine.accesslayer.ChannelFactory.setRawValueAsync | ( | String | address, |
TDataType | value, | ||
TDataType | outValue, | ||
int | timeout, | ||
ChannelCallback | callback | ||
) | throws ConnectionException |
Asynchronously sets the value to the given property.
Upon completed write the callback is notified, either through ChannelCallback#writeCompleted(Object) or ChannelCallback#writeFailed(Object, int). The readback value is also applied to the given outValue parameter.
address | the property to connect to |
value | the value to set |
outValue | the data type that will receive the readback value after write is completed |
timeout | the timeout in milliseconds |
callback | the callback to be notified |
ConnectionException | if establishing the connection failed |
void de.desy.tine.accesslayer.ChannelFactory.setValue | ( | String | address, |
Object | value | ||
) | throws ConnectionException |
Synchronously sets the value to the given property.
Upon success method does not return anything. If the write fails an exception si thrown, describing the error.
address | the proeprty to write to |
value | the value to write |
ConnectionException | if write failed for any reason |
void de.desy.tine.accesslayer.ChannelFactory.setValue | ( | String | address, |
Object | value, | ||
TDataType | outValue, | ||
int | timeout | ||
) | throws ConnectionException |
Synchronously sets the value to the given property.
Upon success method does not return anything, but it does read the value and applies it to the given outValue parameter (the action is atomic). If the write fails an exception is thrown, describing the error.
address | the proeprty to write to |
value | the value to write |
outValue | the data type that will receive the readback value after write is completed |
timeout | the timeout in milliseconds |
ConnectionException | if write failed for any reason |
void de.desy.tine.accesslayer.ChannelFactory.setValueAsync | ( | String | address, |
Object | value, | ||
ChannelCallback | callback | ||
) | throws ConnectionException |
Asynchronously sets the value to the given property.
Upon completed write the callback is notified, either through ChannelCallback#writeCompleted(Object) or ChannelCallback#writeFailed(Object, int).
address | the property to connect to |
value | the value to set |
callback | the callback to be notified |
ConnectionException | if establishing the connection failed |
void de.desy.tine.accesslayer.ChannelFactory.setValueAsync | ( | String | address, |
Object | value, | ||
TDataType | outValue, | ||
int | timeout, | ||
ChannelCallback | callback | ||
) | throws ConnectionException |
Asynchronously sets the value to the given property.
Upon completed write the callback is notified, either through ChannelCallback#writeCompleted(Object) or ChannelCallback#writeFailed(Object, int). The outValue also receives the readback value.
address | the property to connect to |
value | the value to set |
outValue | the data type that will receive the readback value after write is completed |
callback | the callback to be notified |
timeout | the timeout in milliseconds |
ConnectionException | if establishing the connection failed |