Package com.cosylab.epics.caj
Class CAJChannel
- java.lang.Object
-
- gov.aps.jca.Channel
-
- com.cosylab.epics.caj.CAJChannel
-
- All Implemented Interfaces:
TransportClient
public class CAJChannel extends Channel implements TransportClient
Implementation of CAJ JCAChannel
.- Version:
- $id$
- Author:
- Matej Sekoranja
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gov.aps.jca.Channel
Channel.ConnectionState
-
-
Field Summary
Fields Modifier and Type Field Description protected int
accessRights
Channel access rights.protected ArrayList
accessRightsListeners
List of access rights listeners.protected boolean
allowCreation
Allow reconnection flag.protected boolean
canceled
Cancelation status.protected int
channelID
Client channel ID.protected ArrayList
connectionListeners
List of connection listeners.protected Channel.ConnectionState
connectionState
Connection status.protected CAJContext
context
Context.protected int
elementCount
Data type element count.protected boolean
lastReportedConnectionState
Last reported connection status.protected Map
monitors
Map of channels (keys are CIDs).protected String
name
Channel name.protected short
priority
Process priority.protected int
references
Reference counting.protected Map
responseRequests
List of all channels pending requests.protected int
searchTries
Number of channel search tries.protected int
sequenceNumberIO
IO sequence number.protected int
serverChannelID
Server channel ID.protected boolean
syncConnection
Sync.protected AtomicReference
timerIdRef
protected CATransport
transport
Server transport.protected DBRType
type
Channel data type.-
Fields inherited from class gov.aps.jca.Channel
CLOSED, CONNECTED, DISCONNECTED, NEVER_CONNECTED, PRIORITY_ARCHIVE, PRIORITY_DEFAULT, PRIORITY_LINKS_DB, PRIORITY_MAX, PRIORITY_MIN, PRIORITY_OPI
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CAJChannel(CAJContext context, int channelID, String name, ConnectionListener listener, short priority)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acquire()
Increment reference.void
addAccessRightsListener(AccessRightsListener l)
Adds a AccessRightsListener which will be notified of the access rights's changes of this Channel.void
addConnectionListener(ConnectionListener l)
Adds a ConnectionListener which will be notified of the connection state's changes of this Channel.void
addConnectionListenerAndFireIfConnected(ConnectionListener l)
Monitor
addMonitor(DBRType type, int count, int mask, MonitorListener l)
Adds a monitor to this Channel.void
cancel()
Called when connecton completed (successfully or not).void
connectionCompleted(int sid, short typeCode, int elementCount)
Called when channel created succeeded on the server.boolean
createChannel(CATransport transport, int sid, short typeCode, int elementCount)
Create a channel, i.e.void
createChannelFailed()
Create channel failed.void
destroy()
Clear the ressources used by this channel.void
destroy(boolean force)
void
destroyChannel(boolean force)
Actual destory method, to be calledCAJContext
.void
disconnect(boolean initiateSearch)
Disconnected notification.boolean
generateSearchRequestMessage(Transport transport, ByteBuffer buffer)
Send search message.DBR
get(DBR preallocatedDBR, DBRType type, int count)
DBR
get(DBRType type, int count)
Synchronously Reads a specified number of elements of a specified type from this Channel.void
get(DBRType type, int count, GetListener l)
Asynchronously reads a specified number of elements of a specified type from this ChannelAccessRightsListener[]
getAccessRightsListeners()
Returns the AccessRightsListeners registered with this channel.int
getChannelID()
Get client channel ID.ConnectionListener[]
getConnectionListeners()
Returns the ConnectionListeners registered with this channel.Channel.ConnectionState
getConnectionState()
Returns the connection state of this channel.Context
getContext()
Returns the context which created this channel.int
getElementCount()
Returns the element count of this channel.DBRType
getFieldType()
Returns the DBR type of this Channel.String
getHostName()
NOTE: synchronization guarantees thattransport
is non-null
andstate == CONNECTED
.String
getName()
Returns the name of this channel.short
getPriority()
Get process priority.boolean
getReadAccess()
Returns whether read operations are allowed on this Channel.int
getSearchTries()
Get number of search tried for this channel.int
getServerChannelID()
Get SID.Object
getTimerId()
CATransport
getTransport()
Get transport used by this channel.boolean
getWriteAccess()
Returns whether write operations are allowed on this Channel.void
initiateSearch()
Initiate search (connect) procedure.void
issueCreateChannelRequest()
void
printInfo(PrintStream out)
Prints details information about this Channel to the specified output stream.void
put(byte[] value)
Synchronously writes an array to this Channel.void
put(byte[] value, PutListener l)
Asynchronously writes an array to this Channel.void
put(double[] value)
Synchronously writes an array to this Channel.void
put(double[] value, PutListener l)
Asynchronously writes an array to this Channel.void
put(float[] value)
Synchronously writes an array to this Channel.void
put(float[] value, PutListener l)
Asynchronously writes an array to this Channel.void
put(int[] value)
Synchronously writes an array to this Channel.void
put(int[] value, PutListener l)
Asynchronously writes an array to this Channel.void
put(short[] value)
Synchronously writes an array to this Channel.void
put(short[] value, PutListener l)
Asynchronously writes an array to this Channel.void
put(DBRType type, int count, Object value)
Put value.void
put(DBRType type, int count, Object value, PutListener l)
Put value.void
put(String[] value)
Synchronously writes an array to this Channel.void
put(String[] value, PutListener l)
Asynchronously writes an array to this Channel.void
putACKS(Severity severity)
Synchronously writes an Alarm Acknowledge Severity value to this Channel.void
putACKS(Severity severity, PutListener l)
Asynchronously writes an Alarm Acknowledge Severity value to this Channel.void
putACKT(boolean value)
Synchronously writes an Alarm Acknowledge Transient value to this Channel.void
putACKT(boolean value, PutListener l)
Asynchronously writes an Alarm Acknowledge Transient value to this Channel.void
registerResponseRequest(ResponseRequest responseRequest)
Register a response request.void
removeAccessRightsListener(AccessRightsListener l)
Removes a AccessRightsListener which will be notified of the access rights's changes of this Channel.void
removeConnectionListener(ConnectionListener l)
Removes a ConnectionListener .void
setAccessRights(int accessRights)
Set access rights.void
setTimerId(Object timerId)
void
timeout()
String
toString()
void
transportChanged()
Notification of network change (server restarted).void
transportClosed()
Notification of forcefully closed transport.void
transportResponsive(Transport transport)
Notification of responsive transport (e.g.void
transportUnresponsive()
Notification of unresponsive transport (e.g.void
unregisterResponseRequest(ResponseRequest responseRequest)
-
-
-
Field Detail
-
channelID
protected int channelID
Client channel ID.
-
context
protected CAJContext context
Context.
-
name
protected String name
Channel name.
-
accessRights
protected int accessRights
Channel access rights.
-
priority
protected short priority
Process priority.
-
lastReportedConnectionState
protected boolean lastReportedConnectionState
Last reported connection status.
-
connectionState
protected Channel.ConnectionState connectionState
Connection status.
-
type
protected DBRType type
Channel data type.
-
elementCount
protected int elementCount
Data type element count.
-
connectionListeners
protected ArrayList connectionListeners
List of connection listeners.
-
accessRightsListeners
protected ArrayList accessRightsListeners
List of access rights listeners.
-
syncConnection
protected boolean syncConnection
Sync. connection (i.e. w/ callback) flag.
-
sequenceNumberIO
protected int sequenceNumberIO
IO sequence number.
-
monitors
protected Map monitors
Map of channels (keys are CIDs). Lazy initialization used, since not all channel will have monitors.
-
responseRequests
protected Map responseRequests
List of all channels pending requests.
-
searchTries
protected int searchTries
Number of channel search tries.
-
allowCreation
protected boolean allowCreation
Allow reconnection flag.
-
references
protected int references
Reference counting.
-
transport
protected CATransport transport
Server transport.
-
serverChannelID
protected int serverChannelID
Server channel ID.
-
canceled
protected volatile boolean canceled
Cancelation status.
-
timerIdRef
protected final AtomicReference timerIdRef
-
-
Constructor Detail
-
CAJChannel
protected CAJChannel(CAJContext context, int channelID, String name, ConnectionListener listener, short priority) throws CAException
Constructor.- Parameters:
context
- CAJContextchannelID
- Client channel IDname
- Channel namelistener
- ConnectionListenerpriority
- Process priority- Throws:
CAException
- JCA Exception
-
-
Method Detail
-
createChannel
public boolean createChannel(CATransport transport, int sid, short typeCode, int elementCount)
Create a channel, i.e. submit create channel request to the server. This method is called after search is complete.sid
,typeCode
,elementCount
might not be valid, this depends on protocol revision.- Parameters:
transport
- CA transport implementation.sid
- sidtypeCode
- type codeelementCount
- element count- Returns:
true
if real create channel request needs to be sent to the server.
-
issueCreateChannelRequest
public void issueCreateChannelRequest()
-
cancel
public void cancel()
Called when connecton completed (successfully or not).- See Also:
ResponseRequest.cancel()
-
timeout
public void timeout()
- See Also:
ResponseRequest.timeout()
-
createChannelFailed
public void createChannelFailed()
Create channel failed.
-
connectionCompleted
public void connectionCompleted(int sid, short typeCode, int elementCount) throws IllegalStateException
Called when channel created succeeded on the server.sid
might not be valid, this depends on protocol revision.- Parameters:
sid
- sidtypeCode
- type codeelementCount
- element count- Throws:
IllegalStateException
- IllegalStateException
-
destroy
public void destroy() throws CAException, IllegalStateException
Description copied from class:Channel
Clear the ressources used by this channel. No further access should be made to a channel after it has been destroyed.- Specified by:
destroy
in classChannel
- Throws:
IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)CAException
- See Also:
Channel.destroy()
-
destroy
public void destroy(boolean force) throws CAException, IllegalStateException
- Parameters:
force
- force destruction regardless of reference count- Throws:
CAException
- JCA ExceptionIllegalStateException
- illegal state exception- See Also:
Channel.destroy()
-
acquire
public void acquire()
Increment reference.
-
destroyChannel
public void destroyChannel(boolean force) throws CAException, IllegalStateException, IOException
Actual destory method, to be calledCAJContext
.- Parameters:
force
- force destruction regardless of reference count- Throws:
CAException
- JCA ExceptionIllegalStateException
- method has been invoked at an illegal or inappropriate timeIOException
- I/O exception
-
disconnect
public void disconnect(boolean initiateSearch)
Disconnected notification.- Parameters:
initiateSearch
- flag to indicate if searching (connect) procedure should be initiated
-
initiateSearch
public void initiateSearch()
Initiate search (connect) procedure.
-
generateSearchRequestMessage
public boolean generateSearchRequestMessage(Transport transport, ByteBuffer buffer)
Send search message.- Parameters:
transport
- transport to be used when sendingbuffer
- buffer to be filled- Returns:
- success status.
-
transportClosed
public void transportClosed()
Description copied from interface:TransportClient
Notification of forcefully closed transport.- Specified by:
transportClosed
in interfaceTransportClient
- See Also:
TransportClient.transportClosed()
-
transportChanged
public void transportChanged()
Description copied from interface:TransportClient
Notification of network change (server restarted).- Specified by:
transportChanged
in interfaceTransportClient
- See Also:
TransportClient.transportChanged()
-
transportResponsive
public void transportResponsive(Transport transport)
Description copied from interface:TransportClient
Notification of responsive transport (e.g. heartbeat detected again), called to discardtransportUnresponsive
notification.- Specified by:
transportResponsive
in interfaceTransportClient
- Parameters:
transport
- responsive transport.- See Also:
TransportClient.transportResponsive(com.cosylab.epics.caj.impl.Transport)
-
transportUnresponsive
public void transportUnresponsive()
Description copied from interface:TransportClient
Notification of unresponsive transport (e.g. no heartbeat detected) .- Specified by:
transportUnresponsive
in interfaceTransportClient
- See Also:
TransportClient.transportUnresponsive()
-
getConnectionListeners
public ConnectionListener[] getConnectionListeners() throws IllegalStateException
Description copied from class:Channel
Returns the ConnectionListeners registered with this channel.- Specified by:
getConnectionListeners
in classChannel
- Returns:
- an array containing the ConnectionListeners.
- Throws:
IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.getConnectionListeners()
-
addConnectionListener
public void addConnectionListener(ConnectionListener l) throws CAException, IllegalStateException
Description copied from class:Channel
Adds a ConnectionListener which will be notified of the connection state's changes of this Channel.- Specified by:
addConnectionListener
in classChannel
- Parameters:
l
- the ConnectionListener to register.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.addConnectionListener(gov.aps.jca.event.ConnectionListener)
-
addConnectionListenerAndFireIfConnected
public void addConnectionListenerAndFireIfConnected(ConnectionListener l) throws CAException, IllegalStateException
- Parameters:
l
- ConnectionListener- Throws:
CAException
- JCA ExceptionIllegalStateException
- if ConnectionListener is null or the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.addConnectionListener(gov.aps.jca.event.ConnectionListener)
-
removeConnectionListener
public void removeConnectionListener(ConnectionListener l) throws CAException, IllegalStateException
Description copied from class:Channel
Removes a ConnectionListener .- Specified by:
removeConnectionListener
in classChannel
- Parameters:
l
- the ConnectionListener to remove.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.removeConnectionListener(gov.aps.jca.event.ConnectionListener)
-
getAccessRightsListeners
public AccessRightsListener[] getAccessRightsListeners() throws IllegalStateException
Description copied from class:Channel
Returns the AccessRightsListeners registered with this channel.- Specified by:
getAccessRightsListeners
in classChannel
- Returns:
- an array containing the AccessRightsListeners.
- Throws:
IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.getAccessRightsListeners()
-
addAccessRightsListener
public void addAccessRightsListener(AccessRightsListener l) throws CAException, IllegalStateException
Description copied from class:Channel
Adds a AccessRightsListener which will be notified of the access rights's changes of this Channel.- Specified by:
addAccessRightsListener
in classChannel
- Parameters:
l
- the ConnectionListener to register.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.addAccessRightsListener(gov.aps.jca.event.AccessRightsListener)
-
removeAccessRightsListener
public void removeAccessRightsListener(AccessRightsListener l) throws CAException, IllegalStateException
Description copied from class:Channel
Removes a AccessRightsListener which will be notified of the access rights's changes of this Channel.- Specified by:
removeAccessRightsListener
in classChannel
- Parameters:
l
- the ConnectionListener to remove.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.removeAccessRightsListener(gov.aps.jca.event.AccessRightsListener)
-
setAccessRights
public void setAccessRights(int accessRights)
Set access rights.- Parameters:
accessRights
- access rights to set
-
getName
public String getName() throws IllegalStateException
Description copied from class:Channel
Returns the name of this channel.- Specified by:
getName
in classChannel
- Returns:
- the name of this Channel.
- Throws:
IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.getName()
-
getFieldType
public DBRType getFieldType() throws IllegalStateException
Description copied from class:Channel
Returns the DBR type of this Channel.- Specified by:
getFieldType
in classChannel
- Returns:
- the DBR type.
- Throws:
IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.getFieldType()
-
getElementCount
public int getElementCount() throws IllegalStateException
Description copied from class:Channel
Returns the element count of this channel.- Specified by:
getElementCount
in classChannel
- Returns:
- the element count.
- Throws:
IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.getElementCount()
-
getConnectionState
public Channel.ConnectionState getConnectionState() throws IllegalStateException
Description copied from class:Channel
Returns the connection state of this channel.- Specified by:
getConnectionState
in classChannel
- Returns:
- the ConnectionState value.
- Throws:
IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.getConnectionState()
-
getHostName
public String getHostName() throws IllegalStateException
NOTE: synchronization guarantees thattransport
is non-null
andstate == CONNECTED
.- Specified by:
getHostName
in classChannel
- Returns:
- the hostname.
- Throws:
IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.getHostName()
-
getReadAccess
public boolean getReadAccess() throws IllegalStateException
Description copied from class:Channel
Returns whether read operations are allowed on this Channel.- Specified by:
getReadAccess
in classChannel
- Returns:
- true is read operations are allowed, false otherwise.
- Throws:
IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.getReadAccess()
-
getWriteAccess
public boolean getWriteAccess() throws IllegalStateException
Description copied from class:Channel
Returns whether write operations are allowed on this Channel.- Specified by:
getWriteAccess
in classChannel
- Returns:
- true is write operations are allowed, false otherwise.
- Throws:
IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.getWriteAccess()
-
put
public void put(byte[] value) throws CAException, IllegalStateException
Description copied from class:Channel
Synchronously writes an array to this Channel.- Specified by:
put
in classChannel
- Parameters:
value
- the value.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.put(byte[])
-
put
public void put(byte[] value, PutListener l) throws CAException, IllegalStateException
Description copied from class:Channel
Asynchronously writes an array to this Channel.- Specified by:
put
in classChannel
- Parameters:
value
- the value.l
- the PutListener to notify when the request has been completed.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.put(byte[], gov.aps.jca.event.PutListener)
-
put
public void put(short[] value) throws CAException, IllegalStateException
Description copied from class:Channel
Synchronously writes an array to this Channel.- Specified by:
put
in classChannel
- Parameters:
value
- the value.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.put(short[])
-
put
public void put(short[] value, PutListener l) throws CAException, IllegalStateException
Description copied from class:Channel
Asynchronously writes an array to this Channel.- Specified by:
put
in classChannel
- Parameters:
value
- the value.l
- the PutListener to notify when the request has been completed.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.put(short[], gov.aps.jca.event.PutListener)
-
put
public void put(int[] value) throws CAException, IllegalStateException
Description copied from class:Channel
Synchronously writes an array to this Channel.- Specified by:
put
in classChannel
- Parameters:
value
- the value.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.put(int[])
-
put
public void put(int[] value, PutListener l) throws CAException, IllegalStateException
Description copied from class:Channel
Asynchronously writes an array to this Channel.- Specified by:
put
in classChannel
- Parameters:
value
- the value.l
- the PutListener to notify when the request has been completed.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.put(int[], gov.aps.jca.event.PutListener)
-
put
public void put(float[] value) throws CAException, IllegalStateException
Description copied from class:Channel
Synchronously writes an array to this Channel.- Specified by:
put
in classChannel
- Parameters:
value
- the value.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.put(float[])
-
put
public void put(float[] value, PutListener l) throws CAException, IllegalStateException
Description copied from class:Channel
Asynchronously writes an array to this Channel.- Specified by:
put
in classChannel
- Parameters:
value
- the value.l
- the PutListener to notify when the request has been completed.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.put(float[], gov.aps.jca.event.PutListener)
-
put
public void put(double[] value) throws CAException, IllegalStateException
Description copied from class:Channel
Synchronously writes an array to this Channel.- Specified by:
put
in classChannel
- Parameters:
value
- the value.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.put(double[])
-
put
public void put(double[] value, PutListener l) throws CAException, IllegalStateException
Description copied from class:Channel
Asynchronously writes an array to this Channel.- Specified by:
put
in classChannel
- Parameters:
value
- the value.l
- the PutListener to notify when the request has been completed.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.put(double[], gov.aps.jca.event.PutListener)
-
put
public void put(String[] value) throws CAException, IllegalStateException
Description copied from class:Channel
Synchronously writes an array to this Channel.- Specified by:
put
in classChannel
- Parameters:
value
- the value.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.put(java.lang.String[])
-
put
public void put(String[] value, PutListener l) throws CAException, IllegalStateException
Description copied from class:Channel
Asynchronously writes an array to this Channel.- Specified by:
put
in classChannel
- Parameters:
value
- the value.l
- the PutListener to notify when the request has been completed.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.put(java.lang.String[], gov.aps.jca.event.PutListener)
-
putACKS
public void putACKS(Severity severity, PutListener l) throws CAException, IllegalStateException
Description copied from class:Channel
Asynchronously writes an Alarm Acknowledge Severity value to this Channel.- Specified by:
putACKS
in classChannel
- Parameters:
severity
- to acknowledge.l
- the PutListener to notify when the request has been completed.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.putACKS(gov.aps.jca.dbr.Severity, gov.aps.jca.event.PutListener)
-
putACKS
public void putACKS(Severity severity) throws CAException, IllegalStateException
Description copied from class:Channel
Synchronously writes an Alarm Acknowledge Severity value to this Channel.- Specified by:
putACKS
in classChannel
- Parameters:
severity
- to acknowledge.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.putACKS(gov.aps.jca.dbr.Severity)
-
putACKT
public void putACKT(boolean value, PutListener l) throws CAException, IllegalStateException
Description copied from class:Channel
Asynchronously writes an Alarm Acknowledge Transient value to this Channel.- Specified by:
putACKT
in classChannel
- Parameters:
value
- the value,true
equals YES andfalse
equals NO.l
- the PutListener to notify when the request has been completed.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.putACKT(boolean, gov.aps.jca.event.PutListener)
-
putACKT
public void putACKT(boolean value) throws CAException, IllegalStateException
Description copied from class:Channel
Synchronously writes an Alarm Acknowledge Transient value to this Channel.- Specified by:
putACKT
in classChannel
- Parameters:
value
- the value,true
equals YES andfalse
equals NO.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.putACKT(boolean)
-
get
public DBR get(DBRType type, int count) throws CAException, IllegalStateException
Description copied from class:Channel
Synchronously Reads a specified number of elements of a specified type from this Channel.- Specified by:
get
in classChannel
- Parameters:
type
- the DBR type to read.count
- the number of element to read.- Returns:
- the channel's value.
- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.get(gov.aps.jca.dbr.DBRType, int)
-
get
public DBR get(DBR preallocatedDBR, DBRType type, int count) throws CAException, IllegalStateException
- Throws:
CAException
IllegalStateException
-
get
public void get(DBRType type, int count, GetListener l) throws CAException, IllegalStateException
Description copied from class:Channel
Asynchronously reads a specified number of elements of a specified type from this Channel- Specified by:
get
in classChannel
- Parameters:
type
- the DBR type.count
- the number of element to read.l
- the GetListener to notify when the request has been completed.- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.get(gov.aps.jca.dbr.DBRType, int, gov.aps.jca.event.GetListener)
-
put
public void put(DBRType type, int count, Object value) throws CAException, IllegalStateException
Put value.- Parameters:
type
- DBRTypecount
- countvalue
- value to be put- Throws:
CAException
- JCA ExceptionIllegalStateException
- No channel transport available, channel disconnected.
-
put
public void put(DBRType type, int count, Object value, PutListener l) throws CAException, IllegalStateException
Put value.- Parameters:
type
- DBRTypecount
- data countvalue
- value to putl
- PutListener- Throws:
CAException
- JCA ExceptionIllegalStateException
- No channel transport available, channel disconnected.
-
addMonitor
public Monitor addMonitor(DBRType type, int count, int mask, MonitorListener l) throws CAException, IllegalStateException
Description copied from class:Channel
Adds a monitor to this Channel.- Specified by:
addMonitor
in classChannel
- Parameters:
type
- the monitor's type.count
- the monitor's element count.mask
- the mask value indicating when the listener need to be notified.l
- a MonitorListener to be notified when the value/log/alarm changed.- Returns:
- the Monitor object representing this monitor.
- Throws:
CAException
- if a Channel Exception occured while performing this operation.IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.addMonitor(gov.aps.jca.dbr.DBRType, int, int, gov.aps.jca.event.MonitorListener)
-
getChannelID
public int getChannelID()
Get client channel ID.- Returns:
- client channel ID.
-
getContext
public Context getContext() throws IllegalStateException
Description copied from class:Channel
Returns the context which created this channel.- Specified by:
getContext
in classChannel
- Returns:
- the context
- Throws:
IllegalStateException
- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.getContext()
-
printInfo
public void printInfo(PrintStream out) throws IllegalStateException
Description copied from class:Channel
Prints details information about this Channel to the specified output stream.- Overrides:
printInfo
in classChannel
- Parameters:
out
- the output stream.- Throws:
IllegalStateException
- See Also:
Channel.printInfo(java.io.PrintStream)
-
getTransport
public CATransport getTransport()
Get transport used by this channel.- Returns:
- transport used by this channel.
-
getServerChannelID
public int getServerChannelID()
Get SID.- Returns:
- SID.
-
registerResponseRequest
public void registerResponseRequest(ResponseRequest responseRequest)
Register a response request.- Parameters:
responseRequest
- response request to register.
-
unregisterResponseRequest
public void unregisterResponseRequest(ResponseRequest responseRequest)
-
getSearchTries
public int getSearchTries()
Get number of search tried for this channel.- Returns:
- number of search tried for this channel.
-
getPriority
public short getPriority()
Get process priority.- Returns:
- process priority.
-
setTimerId
public void setTimerId(Object timerId)
-
getTimerId
public Object getTimerId()
-
-