|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgov.aps.jca.Channel
com.cosylab.epics.caj.CAJChannel
public class CAJChannel
Implementation of CAJ JCA Channel.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class gov.aps.jca.Channel |
|---|
gov.aps.jca.Channel.ConnectionState |
| Field Summary | |
|---|---|
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 gov.aps.jca.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 ArrayFIFO |
owner
|
protected int |
ownerIndex
|
protected Object |
ownerLock
|
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 CATransport |
transport
Server transport. |
protected gov.aps.jca.dbr.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 | |
|---|---|
protected |
CAJChannel(CAJContext context,
int channelID,
String name,
gov.aps.jca.event.ConnectionListener listener,
short priority)
Constructor. |
| Method Summary | |
|---|---|
void |
acquire()
Increment reference. |
void |
addAccessRightsListener(gov.aps.jca.event.AccessRightsListener l)
|
void |
addAndSetListOwnership(ArrayFIFO newOwner,
int index)
|
void |
addConnectionListener(gov.aps.jca.event.ConnectionListener l)
|
void |
addConnectionListenerAndFireIfConnected(gov.aps.jca.event.ConnectionListener l)
|
gov.aps.jca.Monitor |
addMonitor(gov.aps.jca.dbr.DBRType type,
int count,
int mask,
gov.aps.jca.event.MonitorListener l)
|
void |
cancel()
Called when connecton completed (successfully or not). |
void |
connectionCompleted(int sid,
short typeCode,
int elementCount)
Called when channel crated succeeded on the server. |
void |
createChannel(CATransport transport,
int sid,
short typeCode,
int elementCount)
Create a channel, i.e. |
void |
createChannelFailed()
Create channel failed. |
void |
destroy()
|
void |
destroy(boolean force)
|
void |
destroyChannel(boolean force)
Actual destory method, to be called CAJContext. |
void |
disconnect(boolean initiateSearch)
Disconnected notification. |
boolean |
generateSearchRequestMessage(Transport transport,
ByteBuffer buffer)
Send search message. |
gov.aps.jca.dbr.DBR |
get(gov.aps.jca.dbr.DBR preallocatedDBR,
gov.aps.jca.dbr.DBRType type,
int count)
|
gov.aps.jca.dbr.DBR |
get(gov.aps.jca.dbr.DBRType type,
int count)
|
void |
get(gov.aps.jca.dbr.DBRType type,
int count,
gov.aps.jca.event.GetListener l)
|
gov.aps.jca.event.AccessRightsListener[] |
getAccessRightsListeners()
|
int |
getChannelID()
Get client channel ID. |
gov.aps.jca.event.ConnectionListener[] |
getConnectionListeners()
|
gov.aps.jca.Channel.ConnectionState |
getConnectionState()
|
gov.aps.jca.Context |
getContext()
|
int |
getElementCount()
|
gov.aps.jca.dbr.DBRType |
getFieldType()
|
String |
getHostName()
NOTE: synchronization guarantees that transport is non-null and state == CONNECTED. |
String |
getName()
|
int |
getOwnerIndex()
|
short |
getPriority()
Get process priority. |
boolean |
getReadAccess()
|
int |
getSearchTries()
Get number of search tried for this channel. |
int |
getServerChannelID()
Get SID. |
CATransport |
getTransport()
Get transport used by this channel. |
boolean |
getWriteAccess()
|
void |
initiateSearch()
Initiate search (connect) procedure. |
void |
printInfo(PrintStream out)
|
void |
put(byte[] value)
|
void |
put(byte[] value,
gov.aps.jca.event.PutListener l)
|
void |
put(gov.aps.jca.dbr.DBRType type,
int count,
Object value)
Put value. |
void |
put(gov.aps.jca.dbr.DBRType type,
int count,
Object value,
gov.aps.jca.event.PutListener l)
Put value. |
void |
put(double[] value)
|
void |
put(double[] value,
gov.aps.jca.event.PutListener l)
|
void |
put(float[] value)
|
void |
put(float[] value,
gov.aps.jca.event.PutListener l)
|
void |
put(int[] value)
|
void |
put(int[] value,
gov.aps.jca.event.PutListener l)
|
void |
put(short[] value)
|
void |
put(short[] value,
gov.aps.jca.event.PutListener l)
|
void |
put(String[] value)
|
void |
put(String[] value,
gov.aps.jca.event.PutListener l)
|
void |
putACKS(gov.aps.jca.dbr.Severity severity)
|
void |
putACKS(gov.aps.jca.dbr.Severity severity,
gov.aps.jca.event.PutListener l)
|
void |
putACKT(boolean value)
|
void |
putACKT(boolean value,
gov.aps.jca.event.PutListener l)
|
void |
registerResponseRequest(ResponseRequest responseRequest)
Register a response request. |
void |
removeAccessRightsListener(gov.aps.jca.event.AccessRightsListener l)
|
void |
removeAndUnsetListOwnership()
|
void |
removeConnectionListener(gov.aps.jca.event.ConnectionListener l)
|
void |
setAccessRights(int accessRights)
Set access rights. |
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)
|
void |
unsetListOwnership()
|
| Methods inherited from class gov.aps.jca.Channel |
|---|
addMonitor, addMonitor, addMonitor, checkMonitorSize, dispose, get, get, get, get, printInfo, put, put, put, put, put, put, put, put, put, put, put, put |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int channelID
protected CAJContext context
protected String name
protected int accessRights
protected short priority
protected boolean lastReportedConnectionState
protected gov.aps.jca.Channel.ConnectionState connectionState
protected gov.aps.jca.dbr.DBRType type
protected int elementCount
protected ArrayList connectionListeners
protected ArrayList accessRightsListeners
protected boolean syncConnection
protected int sequenceNumberIO
protected Map monitors
protected Map responseRequests
protected int searchTries
protected boolean allowCreation
protected int references
protected CATransport transport
protected int serverChannelID
protected volatile boolean canceled
protected Object ownerLock
protected ArrayFIFO owner
protected int ownerIndex
| Constructor Detail |
|---|
protected CAJChannel(CAJContext context,
int channelID,
String name,
gov.aps.jca.event.ConnectionListener listener,
short priority)
throws gov.aps.jca.CAException
context - name - listener -
gov.aps.jca.CAException| Method Detail |
|---|
public void createChannel(CATransport transport,
int sid,
short typeCode,
int elementCount)
sid, typeCode, elementCount might not be
valid, this depends on protocol revision.
transport - sid - typeCode - elementCount - public void cancel()
ResponseRequest.cancel()public void timeout()
ResponseRequest.timeout()public void createChannelFailed()
public void connectionCompleted(int sid,
short typeCode,
int elementCount)
throws IllegalStateException
sid might not be valid, this depends on protocol revision.
sid - typeCode - elementCount -
IllegalStateException
public void destroy()
throws gov.aps.jca.CAException,
IllegalStateException
destroy in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.destroy()
public void destroy(boolean force)
throws gov.aps.jca.CAException,
IllegalStateException
force - force destruction regardless of reference count
gov.aps.jca.CAException
IllegalStateExceptionChannel.destroy()public void acquire()
public void destroyChannel(boolean force)
throws gov.aps.jca.CAException,
IllegalStateException,
IOException
CAJContext.
force - force destruction regardless of reference count
gov.aps.jca.CAException
IllegalStateException
IOExceptionpublic void disconnect(boolean initiateSearch)
initiateSearch - flag to indicate if searching (connect) procedure should be initiatedpublic void initiateSearch()
public boolean generateSearchRequestMessage(Transport transport,
ByteBuffer buffer)
public void transportClosed()
TransportClient
transportClosed in interface TransportClientTransportClient.transportClosed()public void transportChanged()
TransportClient
transportChanged in interface TransportClientTransportClient.transportChanged()public void transportResponsive(Transport transport)
TransportClienttransportUnresponsive notification.
transportResponsive in interface TransportClienttransport - responsive transport.TransportClient.transportResponsive(com.cosylab.epics.caj.impl.Transport)public void transportUnresponsive()
TransportClient
transportUnresponsive in interface TransportClientTransportClient.transportUnresponsive()
public gov.aps.jca.event.ConnectionListener[] getConnectionListeners()
throws IllegalStateException
getConnectionListeners in class gov.aps.jca.ChannelIllegalStateExceptionChannel.getConnectionListeners()
public void addConnectionListener(gov.aps.jca.event.ConnectionListener l)
throws gov.aps.jca.CAException,
IllegalStateException
addConnectionListener in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.addConnectionListener(gov.aps.jca.event.ConnectionListener)
public void addConnectionListenerAndFireIfConnected(gov.aps.jca.event.ConnectionListener l)
throws gov.aps.jca.CAException,
IllegalStateException
gov.aps.jca.CAException
IllegalStateExceptionChannel.addConnectionListener(gov.aps.jca.event.ConnectionListener)
public void removeConnectionListener(gov.aps.jca.event.ConnectionListener l)
throws gov.aps.jca.CAException,
IllegalStateException
removeConnectionListener in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.removeConnectionListener(gov.aps.jca.event.ConnectionListener)
public gov.aps.jca.event.AccessRightsListener[] getAccessRightsListeners()
throws IllegalStateException
getAccessRightsListeners in class gov.aps.jca.ChannelIllegalStateExceptionChannel.getAccessRightsListeners()
public void addAccessRightsListener(gov.aps.jca.event.AccessRightsListener l)
throws gov.aps.jca.CAException,
IllegalStateException
addAccessRightsListener in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.addAccessRightsListener(gov.aps.jca.event.AccessRightsListener)
public void removeAccessRightsListener(gov.aps.jca.event.AccessRightsListener l)
throws gov.aps.jca.CAException,
IllegalStateException
removeAccessRightsListener in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.removeAccessRightsListener(gov.aps.jca.event.AccessRightsListener)public void setAccessRights(int accessRights)
accessRights - access rights to set
public String getName()
throws IllegalStateException
getName in class gov.aps.jca.ChannelIllegalStateExceptionChannel.getName()
public gov.aps.jca.dbr.DBRType getFieldType()
throws IllegalStateException
getFieldType in class gov.aps.jca.ChannelIllegalStateExceptionChannel.getFieldType()
public int getElementCount()
throws IllegalStateException
getElementCount in class gov.aps.jca.ChannelIllegalStateExceptionChannel.getElementCount()
public gov.aps.jca.Channel.ConnectionState getConnectionState()
throws IllegalStateException
getConnectionState in class gov.aps.jca.ChannelIllegalStateExceptionChannel.getConnectionState()
public String getHostName()
throws IllegalStateException
transport is non-null and state == CONNECTED.
getHostName in class gov.aps.jca.ChannelIllegalStateExceptionChannel.getHostName()
public boolean getReadAccess()
throws IllegalStateException
getReadAccess in class gov.aps.jca.ChannelIllegalStateExceptionChannel.getReadAccess()
public boolean getWriteAccess()
throws IllegalStateException
getWriteAccess in class gov.aps.jca.ChannelIllegalStateExceptionChannel.getWriteAccess()
public void put(byte[] value)
throws gov.aps.jca.CAException,
IllegalStateException
put in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.put(byte[])
public void put(byte[] value,
gov.aps.jca.event.PutListener l)
throws gov.aps.jca.CAException,
IllegalStateException
put in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.put(byte[], gov.aps.jca.event.PutListener)
public void put(short[] value)
throws gov.aps.jca.CAException,
IllegalStateException
put in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.put(short[])
public void put(short[] value,
gov.aps.jca.event.PutListener l)
throws gov.aps.jca.CAException,
IllegalStateException
put in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.put(short[], gov.aps.jca.event.PutListener)
public void put(int[] value)
throws gov.aps.jca.CAException,
IllegalStateException
put in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.put(int[])
public void put(int[] value,
gov.aps.jca.event.PutListener l)
throws gov.aps.jca.CAException,
IllegalStateException
put in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.put(int[], gov.aps.jca.event.PutListener)
public void put(float[] value)
throws gov.aps.jca.CAException,
IllegalStateException
put in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.put(float[])
public void put(float[] value,
gov.aps.jca.event.PutListener l)
throws gov.aps.jca.CAException,
IllegalStateException
put in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.put(float[], gov.aps.jca.event.PutListener)
public void put(double[] value)
throws gov.aps.jca.CAException,
IllegalStateException
put in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.put(double[])
public void put(double[] value,
gov.aps.jca.event.PutListener l)
throws gov.aps.jca.CAException,
IllegalStateException
put in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.put(double[], gov.aps.jca.event.PutListener)
public void put(String[] value)
throws gov.aps.jca.CAException,
IllegalStateException
put in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.put(java.lang.String[])
public void put(String[] value,
gov.aps.jca.event.PutListener l)
throws gov.aps.jca.CAException,
IllegalStateException
put in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.put(java.lang.String[], gov.aps.jca.event.PutListener)
public void putACKS(gov.aps.jca.dbr.Severity severity,
gov.aps.jca.event.PutListener l)
throws gov.aps.jca.CAException,
IllegalStateException
putACKS in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.putACKS(gov.aps.jca.dbr.Severity, gov.aps.jca.event.PutListener)
public void putACKS(gov.aps.jca.dbr.Severity severity)
throws gov.aps.jca.CAException,
IllegalStateException
putACKS in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.putACKS(gov.aps.jca.dbr.Severity)
public void putACKT(boolean value,
gov.aps.jca.event.PutListener l)
throws gov.aps.jca.CAException,
IllegalStateException
putACKT in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.putACKT(boolean, gov.aps.jca.event.PutListener)
public void putACKT(boolean value)
throws gov.aps.jca.CAException,
IllegalStateException
putACKT in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.putACKT(boolean)
public gov.aps.jca.dbr.DBR get(gov.aps.jca.dbr.DBRType type,
int count)
throws gov.aps.jca.CAException,
IllegalStateException
get in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.get(gov.aps.jca.dbr.DBRType, int)
public gov.aps.jca.dbr.DBR get(gov.aps.jca.dbr.DBR preallocatedDBR,
gov.aps.jca.dbr.DBRType type,
int count)
throws gov.aps.jca.CAException,
IllegalStateException
gov.aps.jca.CAException
IllegalStateException
public void get(gov.aps.jca.dbr.DBRType type,
int count,
gov.aps.jca.event.GetListener l)
throws gov.aps.jca.CAException,
IllegalStateException
get in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.get(gov.aps.jca.dbr.DBRType, int, gov.aps.jca.event.GetListener)
public void put(gov.aps.jca.dbr.DBRType type,
int count,
Object value)
throws gov.aps.jca.CAException,
IllegalStateException
type - count - value -
gov.aps.jca.CAException
IllegalStateException
public void put(gov.aps.jca.dbr.DBRType type,
int count,
Object value,
gov.aps.jca.event.PutListener l)
throws gov.aps.jca.CAException,
IllegalStateException
type - count - value - l -
gov.aps.jca.CAException
IllegalStateException
public gov.aps.jca.Monitor addMonitor(gov.aps.jca.dbr.DBRType type,
int count,
int mask,
gov.aps.jca.event.MonitorListener l)
throws gov.aps.jca.CAException,
IllegalStateException
addMonitor in class gov.aps.jca.Channelgov.aps.jca.CAException
IllegalStateExceptionChannel.addMonitor(gov.aps.jca.dbr.DBRType, int, int, gov.aps.jca.event.MonitorListener)public int getChannelID()
public gov.aps.jca.Context getContext()
throws IllegalStateException
getContext in class gov.aps.jca.ChannelIllegalStateExceptionChannel.getContext()
public void printInfo(PrintStream out)
throws IllegalStateException
printInfo in class gov.aps.jca.ChannelIllegalStateExceptionChannel.printInfo(java.io.PrintStream)public CATransport getTransport()
public int getServerChannelID()
public void registerResponseRequest(ResponseRequest responseRequest)
responseRequest - response request to register.public void unregisterResponseRequest(ResponseRequest responseRequest)
public int getSearchTries()
public short getPriority()
public void unsetListOwnership()
public void addAndSetListOwnership(ArrayFIFO newOwner,
int index)
public void removeAndUnsetListOwnership()
public final int getOwnerIndex()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||