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 intaccessRightsChannel access rights.protected ArrayListaccessRightsListenersList of access rights listeners.protected booleanallowCreationAllow reconnection flag.protected booleancanceledCancelation status.protected intchannelIDClient channel ID.protected ArrayListconnectionListenersList of connection listeners.protected Channel.ConnectionStateconnectionStateConnection status.protected CAJContextcontextContext.protected intelementCountData type element count.protected booleanlastReportedConnectionStateLast reported connection status.protected MapmonitorsMap of channels (keys are CIDs).protected StringnameChannel name.protected shortpriorityProcess priority.protected intreferencesReference counting.protected MapresponseRequestsList of all channels pending requests.protected intsearchTriesNumber of channel search tries.protected intsequenceNumberIOIO sequence number.protected intserverChannelIDServer channel ID.protected booleansyncConnectionSync.protected AtomicReferencetimerIdRefprotected CATransporttransportServer transport.protected DBRTypetypeChannel 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 protectedCAJChannel(CAJContext context, int channelID, String name, ConnectionListener listener, short priority)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacquire()Increment reference.voidaddAccessRightsListener(AccessRightsListener l)Adds a AccessRightsListener which will be notified of the access rights's changes of this Channel.voidaddConnectionListener(ConnectionListener l)Adds a ConnectionListener which will be notified of the connection state's changes of this Channel.voidaddConnectionListenerAndFireIfConnected(ConnectionListener l)MonitoraddMonitor(DBRType type, int count, int mask, MonitorListener l)Adds a monitor to this Channel.voidcancel()Called when connecton completed (successfully or not).voidconnectionCompleted(int sid, short typeCode, int elementCount)Called when channel created succeeded on the server.booleancreateChannel(CATransport transport, int sid, short typeCode, int elementCount)Create a channel, i.e.voidcreateChannelFailed()Create channel failed.voiddestroy()Clear the ressources used by this channel.voiddestroy(boolean force)voiddestroyChannel(boolean force)Actual destory method, to be calledCAJContext.voiddisconnect(boolean initiateSearch)Disconnected notification.booleangenerateSearchRequestMessage(Transport transport, ByteBuffer buffer)Send search message.DBRget(DBR preallocatedDBR, DBRType type, int count)DBRget(DBRType type, int count)Synchronously Reads a specified number of elements of a specified type from this Channel.voidget(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.intgetChannelID()Get client channel ID.ConnectionListener[]getConnectionListeners()Returns the ConnectionListeners registered with this channel.Channel.ConnectionStategetConnectionState()Returns the connection state of this channel.ContextgetContext()Returns the context which created this channel.intgetElementCount()Returns the element count of this channel.DBRTypegetFieldType()Returns the DBR type of this Channel.StringgetHostName()NOTE: synchronization guarantees thattransportis non-nullandstate == CONNECTED.StringgetName()Returns the name of this channel.shortgetPriority()Get process priority.booleangetReadAccess()Returns whether read operations are allowed on this Channel.intgetSearchTries()Get number of search tried for this channel.intgetServerChannelID()Get SID.ObjectgetTimerId()CATransportgetTransport()Get transport used by this channel.booleangetWriteAccess()Returns whether write operations are allowed on this Channel.voidinitiateSearch()Initiate search (connect) procedure.voidissueCreateChannelRequest()voidprintInfo(PrintStream out)Prints details information about this Channel to the specified output stream.voidput(byte[] value)Synchronously writes an array to this Channel.voidput(byte[] value, PutListener l)Asynchronously writes an array to this Channel.voidput(double[] value)Synchronously writes an array to this Channel.voidput(double[] value, PutListener l)Asynchronously writes an array to this Channel.voidput(float[] value)Synchronously writes an array to this Channel.voidput(float[] value, PutListener l)Asynchronously writes an array to this Channel.voidput(int[] value)Synchronously writes an array to this Channel.voidput(int[] value, PutListener l)Asynchronously writes an array to this Channel.voidput(short[] value)Synchronously writes an array to this Channel.voidput(short[] value, PutListener l)Asynchronously writes an array to this Channel.voidput(DBRType type, int count, Object value)Put value.voidput(DBRType type, int count, Object value, PutListener l)Put value.voidput(String[] value)Synchronously writes an array to this Channel.voidput(String[] value, PutListener l)Asynchronously writes an array to this Channel.voidputACKS(Severity severity)Synchronously writes an Alarm Acknowledge Severity value to this Channel.voidputACKS(Severity severity, PutListener l)Asynchronously writes an Alarm Acknowledge Severity value to this Channel.voidputACKT(boolean value)Synchronously writes an Alarm Acknowledge Transient value to this Channel.voidputACKT(boolean value, PutListener l)Asynchronously writes an Alarm Acknowledge Transient value to this Channel.voidregisterResponseRequest(ResponseRequest responseRequest)Register a response request.voidremoveAccessRightsListener(AccessRightsListener l)Removes a AccessRightsListener which will be notified of the access rights's changes of this Channel.voidremoveConnectionListener(ConnectionListener l)Removes a ConnectionListener .voidsetAccessRights(int accessRights)Set access rights.voidsetTimerId(Object timerId)voidtimeout()StringtoString()voidtransportChanged()Notification of network change (server restarted).voidtransportClosed()Notification of forcefully closed transport.voidtransportResponsive(Transport transport)Notification of responsive transport (e.g.voidtransportUnresponsive()Notification of unresponsive transport (e.g.voidunregisterResponseRequest(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,elementCountmight not be valid, this depends on protocol revision.- Parameters:
transport- CA transport implementation.sid- sidtypeCode- type codeelementCount- element count- Returns:
trueif 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 IllegalStateExceptionCalled when channel created succeeded on the server.sidmight not be valid, this depends on protocol revision.- Parameters:
sid- sidtypeCode- type codeelementCount- element count- Throws:
IllegalStateException- IllegalStateException
-
destroy
public void destroy() throws CAException, IllegalStateExceptionDescription copied from class:ChannelClear the ressources used by this channel. No further access should be made to a channel after it has been destroyed.- Specified by:
destroyin 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, IOExceptionActual 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:TransportClientNotification of forcefully closed transport.- Specified by:
transportClosedin interfaceTransportClient- See Also:
TransportClient.transportClosed()
-
transportChanged
public void transportChanged()
Description copied from interface:TransportClientNotification of network change (server restarted).- Specified by:
transportChangedin interfaceTransportClient- See Also:
TransportClient.transportChanged()
-
transportResponsive
public void transportResponsive(Transport transport)
Description copied from interface:TransportClientNotification of responsive transport (e.g. heartbeat detected again), called to discardtransportUnresponsivenotification.- Specified by:
transportResponsivein interfaceTransportClient- Parameters:
transport- responsive transport.- See Also:
TransportClient.transportResponsive(com.cosylab.epics.caj.impl.Transport)
-
transportUnresponsive
public void transportUnresponsive()
Description copied from interface:TransportClientNotification of unresponsive transport (e.g. no heartbeat detected) .- Specified by:
transportUnresponsivein interfaceTransportClient- See Also:
TransportClient.transportUnresponsive()
-
getConnectionListeners
public ConnectionListener[] getConnectionListeners() throws IllegalStateException
Description copied from class:ChannelReturns the ConnectionListeners registered with this channel.- Specified by:
getConnectionListenersin 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:ChannelAdds a ConnectionListener which will be notified of the connection state's changes of this Channel.- Specified by:
addConnectionListenerin 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:ChannelRemoves a ConnectionListener .- Specified by:
removeConnectionListenerin 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:ChannelReturns the AccessRightsListeners registered with this channel.- Specified by:
getAccessRightsListenersin 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:ChannelAdds a AccessRightsListener which will be notified of the access rights's changes of this Channel.- Specified by:
addAccessRightsListenerin 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:ChannelRemoves a AccessRightsListener which will be notified of the access rights's changes of this Channel.- Specified by:
removeAccessRightsListenerin 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:ChannelReturns the name of this channel.- Specified by:
getNamein 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:ChannelReturns the DBR type of this Channel.- Specified by:
getFieldTypein 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 IllegalStateExceptionDescription copied from class:ChannelReturns the element count of this channel.- Specified by:
getElementCountin 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:ChannelReturns the connection state of this channel.- Specified by:
getConnectionStatein 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 thattransportis non-nullandstate == CONNECTED.- Specified by:
getHostNamein 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 IllegalStateExceptionDescription copied from class:ChannelReturns whether read operations are allowed on this Channel.- Specified by:
getReadAccessin 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 IllegalStateExceptionDescription copied from class:ChannelReturns whether write operations are allowed on this Channel.- Specified by:
getWriteAccessin 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, IllegalStateExceptionDescription copied from class:ChannelSynchronously writes an array to this Channel.- Specified by:
putin 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, IllegalStateExceptionDescription copied from class:ChannelAsynchronously writes an array to this Channel.- Specified by:
putin 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, IllegalStateExceptionDescription copied from class:ChannelSynchronously writes an array to this Channel.- Specified by:
putin 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, IllegalStateExceptionDescription copied from class:ChannelAsynchronously writes an array to this Channel.- Specified by:
putin 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, IllegalStateExceptionDescription copied from class:ChannelSynchronously writes an array to this Channel.- Specified by:
putin 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, IllegalStateExceptionDescription copied from class:ChannelAsynchronously writes an array to this Channel.- Specified by:
putin 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, IllegalStateExceptionDescription copied from class:ChannelSynchronously writes an array to this Channel.- Specified by:
putin 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, IllegalStateExceptionDescription copied from class:ChannelAsynchronously writes an array to this Channel.- Specified by:
putin 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, IllegalStateExceptionDescription copied from class:ChannelSynchronously writes an array to this Channel.- Specified by:
putin 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, IllegalStateExceptionDescription copied from class:ChannelAsynchronously writes an array to this Channel.- Specified by:
putin 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:ChannelSynchronously writes an array to this Channel.- Specified by:
putin 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:ChannelAsynchronously writes an array to this Channel.- Specified by:
putin 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:ChannelAsynchronously writes an Alarm Acknowledge Severity value to this Channel.- Specified by:
putACKSin 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:ChannelSynchronously writes an Alarm Acknowledge Severity value to this Channel.- Specified by:
putACKSin 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, IllegalStateExceptionDescription copied from class:ChannelAsynchronously writes an Alarm Acknowledge Transient value to this Channel.- Specified by:
putACKTin classChannel- Parameters:
value- the value,trueequals YES andfalseequals 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, IllegalStateExceptionDescription copied from class:ChannelSynchronously writes an Alarm Acknowledge Transient value to this Channel.- Specified by:
putACKTin classChannel- Parameters:
value- the value,trueequals YES andfalseequals 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:ChannelSynchronously Reads a specified number of elements of a specified type from this Channel.- Specified by:
getin 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:
CAExceptionIllegalStateException
-
get
public void get(DBRType type, int count, GetListener l) throws CAException, IllegalStateException
Description copied from class:ChannelAsynchronously reads a specified number of elements of a specified type from this Channel- Specified by:
getin 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:ChannelAdds a monitor to this Channel.- Specified by:
addMonitorin 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:ChannelReturns the context which created this channel.- Specified by:
getContextin 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:ChannelPrints details information about this Channel to the specified output stream.- Overrides:
printInfoin 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()
-
-