gov.aps.epics.jca.jni
Class JNIChannel

java.lang.Object
  |
  +--gov.aps.epics.jca.Channel
        |
        +--gov.aps.epics.jca.jni.JNIChannel
All Implemented Interfaces:
CaConstants

public class JNIChannel
extends Channel


Field Summary
protected  java.util.ArrayList _accessListenerList
           
protected  int _channelID
           
protected  java.util.ArrayList _cnxListenerList
           
protected  gov.aps.epics.jca.jni.JNIContext _jnicontext
           
protected  java.lang.String _name
           
 
Fields inherited from interface gov.aps.epics.jca.CaConstants
CA_K_ERROR, CA_K_FATAL, CA_K_INFO, CA_K_SEVERE, CA_K_SUCCESS, CA_K_WARNING, CA_M_ERROR, CA_M_LEVEL, CA_M_MSG_NO, CA_M_SEVERE, CA_M_SEVERITY, CA_M_SUCCESS, CA_OP_ADD_MONITOR, CA_OP_CLEAR_MONITOR, CA_OP_CONN_DOWN, CA_OP_CONN_UP, CA_OP_FIRST, CA_OP_GET, CA_OP_LAST, CA_OP_OTHER, CA_OP_PUT, CA_OP_SEARCH, CA_OP_STRING, CA_V_MSG_NO, CA_V_SEVERITY, CA_V_SUCCESS, CALLBACK_MODE_FIRST, CALLBACK_MODE_LAST, CALLBACK_MODE_STRING, CS_CLOSED, CS_CONN, CS_FIRST, CS_LAST, CS_NEVER_CONN, CS_PREV_CONN, CS_STRING, DBE_ALARM, DBE_LOG, DBE_VALUE, DBR_BYTE, DBR_CTRL_BYTE, DBR_CTRL_DOUBLE, DBR_CTRL_ENUM, DBR_CTRL_FLOAT, DBR_CTRL_INT, DBR_CTRL_SHORT, DBR_CTRL_STRING, DBR_DOUBLE, DBR_ENUM, DBR_FIRST, DBR_FLOAT, DBR_GR_BYTE, DBR_GR_DOUBLE, DBR_GR_FLOAT, DBR_GR_INT, DBR_GR_SHORT, DBR_GR_STRING, DBR_INT, DBR_LABELS_ENUM, DBR_LAST, DBR_PUT_ACKS, DBR_PUT_ACKT, DBR_SHORT, DBR_STRING, DBR_STS_BYTE, DBR_STS_DOUBLE, DBR_STS_ENUM, DBR_STS_FLOAT, DBR_STS_INT, DBR_STS_SHORT, DBR_STS_STRING, DBR_STSACK_STRING, DBR_TIME_BYTE, DBR_TIME_DOUBLE, DBR_TIME_ENUM, DBR_TIME_FLOAT, DBR_TIME_INT, DBR_TIME_SHORT, DBR_TIME_STRING, DBR_TYPE_STRING, DISABLE_PREEMPTIVE_CALLBACK, ECA_ADDFAIL, ECA_ALLOCMEM, ECA_ANACHRONISM, ECA_BADCHID, ECA_BADCOUNT, ECA_BADFUNCPTR, ECA_BADMASK, ECA_BADMONID, ECA_BADPRIORITY, ECA_BADSTR, ECA_BADSYNCGRP, ECA_BADTYPE, ECA_BUILDGET, ECA_CHANDESTROY, ECA_CHIDNOTFND, ECA_CHIDRETRY, ECA_CONN, ECA_DBLCHNL, ECA_DBLCLFAIL, ECA_DEFUNCT, ECA_DISCONN, ECA_DISCONNCHID, ECA_DLCKREST, ECA_EMPTYSTR, ECA_EVDISALLOW, ECA_FIRST, ECA_GETFAIL, ECA_INTERNAL, ECA_IODONE, ECA_IOINPROGRESS, ECA_ISATTACHED, ECA_LAST, ECA_MAXIOC, ECA_MESSAGE_STRING, ECA_NEEDSFP, ECA_NEWADDR, ECA_NEWCONN, ECA_NOCACTX, ECA_NOCAST, ECA_NOCHANMSG, ECA_NOCONVERT, ECA_NORDACCESS, ECA_NOREPEATER, ECA_NORMAL, ECA_NOSEARCHADDR, ECA_NOSUPPORT, ECA_NOTINSERVICE, ECA_NOTTHREADED, ECA_NOWTACCESS, ECA_OVEVFAIL, ECA_PUTCBINPROG, ECA_PUTFAIL, ECA_SERVBEHIND, ECA_SOCK, ECA_STRTOBIG, ECA_TIMEOUT, ECA_TOLARGE, ECA_UKNCHAN, ECA_UKNFIELD, ECA_UKNHOST, ECA_UKNSERV, ENABLE_PREEMPTIVE_CALLBACK, THREAD_CTRL_EXTERNAL, THREAD_CTRL_FIRST, THREAD_CTRL_INTERNAL, THREAD_CTRL_LAST, THREAD_CTRL_STRING
 
Constructor Summary
protected JNIChannel(gov.aps.epics.jca.jni.JNIContext context, java.lang.String name, gov.aps.epics.jca.ConnectionListener l)
           
 
Method Summary
 void addAccessRightsListener(gov.aps.epics.jca.AccessRightsListener l)
          Adds a AccessRightsListener which will be notified of the access rights's changes of this Channel.
 void addConnectionListener(gov.aps.epics.jca.ConnectionListener l)
          Adds a ConnectionListener which will be notified of the connection state's changes of this Channel.
 gov.aps.epics.jca.Monitor addMonitorListener(int type, int count, gov.aps.epics.jca.MonitorListener l, int mask)
          Adds a monitor to this Channel with a specified type,count and mask.
protected  void assertValidity()
           
 void destroy()
          Clear the ressources used by this channel.
 void dispose()
           
 gov.aps.epics.jca.dbr.DBR get(int type, int count)
          Reads a specified number of elements of a specified type from this Channel.
 void get(int type, int count, gov.aps.epics.jca.GetListener l)
          Reads a specified number of elements of a specified type from this Channel with a GetListener to be notified when the operation has been completed.
 gov.aps.epics.jca.AccessRightsListener[] getAccessRightsListeners()
          Returns the AccessRightsListener registered with this Channel.
 int getChannelID()
           
 gov.aps.epics.jca.ConnectionListener[] getConnectionListeners()
          Returns the ConnectionListener registered with this Channel.
 gov.aps.epics.jca.Context getContext()
          Returns the context which created this channel.
 int getElementCount()
          return the pv's element count.
 int getFieldType()
          return the pv's channel access type.
 java.lang.String getHostName()
          return the pv's hostname.
 java.lang.String getName()
          return the name of the process variable.
 boolean getReadAccess()
          return the pv's read access right.
 int getState()
          return the pv's connection state.
 boolean getWriteAccess()
          return the pv's write access right.
 void put(byte[] value)
          Writes an array to this Channel.
 void put(byte[] value, gov.aps.epics.jca.PutListener l)
          Writes an array to this Channel with a PutListener to be notified when the operation has been completed.
 void put(double[] value)
          Writes an array to this Channel.
 void put(double[] value, gov.aps.epics.jca.PutListener l)
          Writes an array to this Channel with a PutListener to be notified when the operation has been completed.
 void put(float[] value)
          Writes an array to this Channel.
 void put(float[] value, gov.aps.epics.jca.PutListener l)
          Writes an array to this Channel with a PutListener to be notified when the operation has been completed.
 void put(int[] value)
          Writes an array to this Channel.
 void put(int[] value, gov.aps.epics.jca.PutListener l)
          Writes an array to this Channel with a PutListener to be notified when the operation has been completed.
protected  void put(int type, int count, java.lang.Object value)
           
protected  void put(int type, int count, java.lang.Object value, gov.aps.epics.jca.PutListener l)
           
 void put(short[] value)
          Writes an array to this Channel.
 void put(short[] value, gov.aps.epics.jca.PutListener l)
          Writes an array to this Channel with a PutListener to be notified when the operation has been completed.
 void put(java.lang.String[] value)
          Writes an array to this Channel.
 void put(java.lang.String[] value, gov.aps.epics.jca.PutListener l)
          Writes an array to this Channel with a PutListener to be notified when the operation has been completed.
 void removeAccessRightsListener(gov.aps.epics.jca.AccessRightsListener l)
          Removes a AccessRightsListener which will be notified of the access rights's changes of this Channel.
 void removeConnectionListener(gov.aps.epics.jca.ConnectionListener l)
          Removes a ConnectionListener .
protected  void setChannelID(int channelID)
           
 
Methods inherited from class gov.aps.epics.jca.Channel
addMonitorListener, get, get, get, get, getFieldTypeString, getStateString, printInfo, 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, toString, wait, wait, wait
 

Field Detail

_jnicontext

protected gov.aps.epics.jca.jni.JNIContext _jnicontext

_channelID

protected int _channelID

_name

protected java.lang.String _name

_cnxListenerList

protected java.util.ArrayList _cnxListenerList

_accessListenerList

protected java.util.ArrayList _accessListenerList
Constructor Detail

JNIChannel

protected JNIChannel(gov.aps.epics.jca.jni.JNIContext context,
                     java.lang.String name,
                     gov.aps.epics.jca.ConnectionListener l)
Method Detail

setChannelID

protected void setChannelID(int channelID)

getContext

public gov.aps.epics.jca.Context getContext()
Description copied from class: Channel
Returns the context which created this channel.

Specified by:
getContext in class Channel

destroy

public void destroy()
             throws CaException
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 cleared.

Specified by:
destroy in class Channel
CaException

getConnectionListeners

public gov.aps.epics.jca.ConnectionListener[] getConnectionListeners()
Description copied from class: Channel
Returns the ConnectionListener registered with this Channel. Might be null.

Specified by:
getConnectionListeners in class Channel

addConnectionListener

public void addConnectionListener(gov.aps.epics.jca.ConnectionListener l)
                           throws CaException
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 class Channel
Parameters:
l - the ConnectionListener to be registered.
CaException

removeConnectionListener

public void removeConnectionListener(gov.aps.epics.jca.ConnectionListener l)
                              throws CaException
Description copied from class: Channel
Removes a ConnectionListener .

Specified by:
removeConnectionListener in class Channel
Parameters:
l - the ConnectionListener to be removed.
CaException

getAccessRightsListeners

public gov.aps.epics.jca.AccessRightsListener[] getAccessRightsListeners()
Description copied from class: Channel
Returns the AccessRightsListener registered with this Channel. Might be null.

Specified by:
getAccessRightsListeners in class Channel

addAccessRightsListener

public void addAccessRightsListener(gov.aps.epics.jca.AccessRightsListener l)
                             throws CaException
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 class Channel
Parameters:
l - the ConnectionListener to be registered.
CaException

removeAccessRightsListener

public void removeAccessRightsListener(gov.aps.epics.jca.AccessRightsListener l)
                                throws CaException
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 class Channel
Parameters:
l - the ConnectionListener to be removed.
CaException

getName

public java.lang.String getName()
return the name of the process variable.

Specified by:
getName in class Channel
Returns:
the name.
Throws:
IllegalOperationException - is thrown if the process variable has been disposed.

getFieldType

public int getFieldType()
return the pv's channel access type.

Specified by:
getFieldType in class Channel
Returns:
one of DBR_XXX type.
Throws:
IllegalOperationException - is thrown if the process variable has been disposed.
See Also:
CaConstants

getElementCount

public int getElementCount()
return the pv's element count.

Specified by:
getElementCount in class Channel
Returns:
the element count.
Throws:
IllegalOperationException - is thrown if the process variable has been disposed.

getState

public int getState()
return the pv's connection state.

Specified by:
getState in class Channel
Returns:
one of CS_XXX constants.
Throws:
IllegalOperationException - is thrown if the process variable has been disposed.
See Also:
CaConstants

getHostName

public java.lang.String getHostName()
return the pv's hostname.

Specified by:
getHostName in class Channel
Returns:
the hostname.
Throws:
IllegalOperationException - is thrown if the process variable has been disposed.

getReadAccess

public boolean getReadAccess()
return the pv's read access right.

Specified by:
getReadAccess in class Channel
Returns:
true is read operations are allowed, false otherwise.
Throws:
IllegalOperationException - is thrown if the process variable has been disposed.

getWriteAccess

public boolean getWriteAccess()
return the pv's write access right.

Specified by:
getWriteAccess in class Channel
Returns:
true is write operations are allowed, false otherwise.
Throws:
IllegalOperationException - is thrown if the process variable has been disposed.

dispose

public void dispose()

getChannelID

public int getChannelID()

put

public void put(byte[] value)
         throws CaException
Description copied from class: Channel
Writes an array to this Channel.

Specified by:
put in class Channel
Parameters:
value - the value.
CaException

put

public void put(byte[] value,
                gov.aps.epics.jca.PutListener l)
         throws CaException
Description copied from class: Channel
Writes an array to this Channel with a PutListener to be notified when the operation has been completed.

Specified by:
put in class Channel
Parameters:
value - the value.
CaException

put

public void put(short[] value)
         throws CaException
Description copied from class: Channel
Writes an array to this Channel.

Specified by:
put in class Channel
Parameters:
value - the value.
CaException

put

public void put(short[] value,
                gov.aps.epics.jca.PutListener l)
         throws CaException
Description copied from class: Channel
Writes an array to this Channel with a PutListener to be notified when the operation has been completed.

Specified by:
put in class Channel
Parameters:
value - the value.
CaException

put

public void put(int[] value)
         throws CaException
Description copied from class: Channel
Writes an array to this Channel.

Specified by:
put in class Channel
Parameters:
value - the value.
CaException

put

public void put(int[] value,
                gov.aps.epics.jca.PutListener l)
         throws CaException
Description copied from class: Channel
Writes an array to this Channel with a PutListener to be notified when the operation has been completed.

Specified by:
put in class Channel
Parameters:
value - the value.
CaException

put

public void put(float[] value)
         throws CaException
Description copied from class: Channel
Writes an array to this Channel.

Specified by:
put in class Channel
Parameters:
value - the value.
CaException

put

public void put(float[] value,
                gov.aps.epics.jca.PutListener l)
         throws CaException
Description copied from class: Channel
Writes an array to this Channel with a PutListener to be notified when the operation has been completed.

Specified by:
put in class Channel
Parameters:
value - the value.
CaException

put

public void put(double[] value)
         throws CaException
Description copied from class: Channel
Writes an array to this Channel.

Specified by:
put in class Channel
Parameters:
value - the value.
CaException

put

public void put(double[] value,
                gov.aps.epics.jca.PutListener l)
         throws CaException
Description copied from class: Channel
Writes an array to this Channel with a PutListener to be notified when the operation has been completed.

Specified by:
put in class Channel
Parameters:
value - the value.
CaException

put

public void put(java.lang.String[] value)
         throws CaException
Description copied from class: Channel
Writes an array to this Channel.

Specified by:
put in class Channel
Parameters:
value - the value.
CaException

put

public void put(java.lang.String[] value,
                gov.aps.epics.jca.PutListener l)
         throws CaException
Description copied from class: Channel
Writes an array to this Channel with a PutListener to be notified when the operation has been completed.

Specified by:
put in class Channel
Parameters:
value - the value.
CaException

put

protected void put(int type,
                   int count,
                   java.lang.Object value)
            throws CaException
CaException

put

protected void put(int type,
                   int count,
                   java.lang.Object value,
                   gov.aps.epics.jca.PutListener l)
            throws CaException
CaException

get

public gov.aps.epics.jca.dbr.DBR get(int type,
                                     int count)
                              throws CaException
Description copied from class: Channel
Reads a specified number of elements of a specified type from this Channel.

Specified by:
get in class Channel
Parameters:
count - the number of element to read.
CaException

get

public void get(int type,
                int count,
                gov.aps.epics.jca.GetListener l)
         throws CaException
Description copied from class: Channel
Reads a specified number of elements of a specified type from this Channel with a GetListener to be notified when the operation has been completed.

Specified by:
get in class Channel
Parameters:
type - the element type.
count - the number of element to read.
l - the GetListener.
CaException

addMonitorListener

public gov.aps.epics.jca.Monitor addMonitorListener(int type,
                                                    int count,
                                                    gov.aps.epics.jca.MonitorListener l,
                                                    int mask)
                                             throws CaException
Description copied from class: Channel
Adds a monitor to this Channel with a specified type,count and mask.

Specified by:
addMonitorListener in class Channel
Parameters:
type - the monitor element type.
count - the monitor element count.
l - the MonitorListener to be notified.
mask - the mask value indicating when the listener need to be notified.
Returns:
the Monitor object representing this monitor.
CaException

assertValidity

protected void assertValidity()