jca
Class PV

java.lang.Object
  |
  +--jca.PV

public class PV
extends java.lang.Object

This class define an object to access a channel access process variable.

See Also:
Ca, Monitor

Field Summary
static int CLOSED
           
static int CONN
           
static int DBE_ALARM
           
static int DBE_LOG
           
static int DBE_VALUE
           
static int NEVER_CONN
           
static int PREV_CONN
           
 
Constructor Summary
PV(java.lang.String name)
          Creates a PV and connect it to the specified channel access process variable.
PV(java.lang.String name, java.lang.Object puser)
          Creates a PV and connect it to the specified channel access process variable.
PV(java.lang.String name, java.lang.Object puser, ConnectionListener l)
          Creates a PV and connect it to the specified channel access process variable.
 
Method Summary
 Monitor addMonitor(DBR ivalue, MonitorListener l, java.lang.Object arg, int mask)
          Add a monitor to the PV.
 void clear()
          Disconnect the PV from the channel access variable and clear all the events associated with this PV.
 int elementCount()
          Return the native element count of the PV.
 int fieldType()
          Return the native type of the PV.
 void get(DBR ivalue)
          Synchronously get a DBR Object from the PV.
 void get(DBR ivalue, GetListener l, java.lang.Object arg)
          Asynchronously get a DBR object from the PV.
 java.lang.String hostName()
          Return the host name of the PV.
 int id()
          Return the PV id.
 java.lang.String name()
          Return the name of the PV.
 java.lang.Object puser()
          Return the user Object associated with this PV.
 void puser(java.lang.Object arg)
          Change the user Object associated with this PV.
 void put(byte ivalue)
          Synchronously put a byte value into the PV.
 void put(byte[] ivalue)
          Synchronously put an array of byte into the PV.
 void put(byte[] ivalue, PutListener l, java.lang.Object arg)
          Asynchronously put an array of byte into the PV.
 void put(byte ivalue, PutListener l, java.lang.Object arg)
          Asynchronously put a byte into the PV.
 void put(DBR ivalue)
          Synchronously put a DBR object into the PV.
 void put(DBR ivalue, PutListener l, java.lang.Object arg)
          Asynchronously put a DBR object into the PV.
 void put(double ivalue)
          Synchronously put a double value into the PV.
 void put(double[] ivalue)
          Synchronously put an array of double into the PV.
 void put(double[] ivalue, PutListener l, java.lang.Object arg)
          Asynchronously put an array of double into the PV.
 void put(double ivalue, PutListener l, java.lang.Object arg)
          Asynchronously put a double into the PV.
 void put(float ivalue)
          Synchronously put a float value into the PV.
 void put(float[] ivalue)
          Synchronously put an array of float into the PV.
 void put(float[] ivalue, PutListener l, java.lang.Object arg)
          Asynchronously put an array of float into the PV.
 void put(float ivalue, PutListener l, java.lang.Object arg)
          Asynchronously put a float into the PV.
 void put(int ivalue)
          Synchronously put an int value into the PV.
 void put(int[] ivalue)
          Synchronously put an array of int into the PV.
 void put(int[] ivalue, PutListener l, java.lang.Object arg)
          Asynchronously put an array of int into the PV.
 void put(int ivalue, PutListener l, java.lang.Object arg)
          Asynchronously put a int into the PV.
 void put(short ivalue)
          Synchronously put a short value into the PV.
 void put(short[] ivalue)
          Synchronously put an array of short into the PV.
 void put(short[] ivalue, PutListener l, java.lang.Object arg)
          Asynchronously put an array of short into the PV.
 void put(short ivalue, PutListener l, java.lang.Object arg)
          Asynchronously put a short into the PV.
 void put(java.lang.String ivalue)
          Synchronously put a String into the PV.
 void put(java.lang.String ivalue, PutListener l, java.lang.Object arg)
          Asynchronously put a String into the PV.
 boolean readAccess()
          Return true if the PV has read access.
 void setConnectionListener(ConnectionListener l)
          Changes the Connectionlistener attached to the PV.
 int state()
          Return the state of the PV.
 boolean writeAccess()
          Return true if the PV has write access.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEVER_CONN

public static final int NEVER_CONN

PREV_CONN

public static final int PREV_CONN

CONN

public static final int CONN

CLOSED

public static final int CLOSED

DBE_VALUE

public static final int DBE_VALUE

DBE_LOG

public static final int DBE_LOG

DBE_ALARM

public static final int DBE_ALARM
Constructor Detail

PV

public PV(java.lang.String name)
Creates a PV and connect it to the specified channel access process variable. The connection request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO or Ca.pendEvent function is called.
Parameters:
name - The name of the process variable to connect to.

PV

public PV(java.lang.String name,
          java.lang.Object puser)
Creates a PV and connect it to the specified channel access process variable. The connection request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO or Ca.pendEvent function is called.
Parameters:
name - The name of the process variable to connect to.
puser - A user defined object to attach to the pv.

PV

public PV(java.lang.String name,
          java.lang.Object puser,
          ConnectionListener l)
Creates a PV and connect it to the specified channel access process variable. The connection request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO or Ca.pendEvent function is called.
Parameters:
name - The name of the process variable to connect to.
puser - A user defined object to attach to the pv.
l - A ConnectionListener to notify whenever the connection state of the PV change.
Method Detail

setConnectionListener

public void setConnectionListener(ConnectionListener l)
                           throws BadPVException
Changes the Connectionlistener attached to the PV.
Parameters:
l - the Connectionlistener to be notify of state change. Set it to null to avoid being notified.

clear

public void clear()
           throws BadPVException
Disconnect the PV from the channel access variable and clear all the events associated with this PV.

id

public int id()
Return the PV id. Each PV has its own id.

fieldType

public int fieldType()
              throws BadPVException
Return the native type of the PV.

elementCount

public int elementCount()
                 throws BadPVException
Return the native element count of the PV.

name

public java.lang.String name()
                      throws BadPVException
Return the name of the PV.

puser

public java.lang.Object puser()
                       throws BadPVException
Return the user Object associated with this PV.

puser

public void puser(java.lang.Object arg)
           throws BadPVException
Change the user Object associated with this PV.

state

public int state()
          throws BadPVException
Return the state of the PV.

hostName

public java.lang.String hostName()
                          throws BadPVException
Return the host name of the PV.

readAccess

public boolean readAccess()
                   throws BadPVException
Return true if the PV has read access.

writeAccess

public boolean writeAccess()
                    throws BadPVException
Return true if the PV has write access.

put

public void put(DBR ivalue)
         throws BadTypeException,
                BadCountException,
                PutFailException
Synchronously put a DBR object into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The DBR Objectto send.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.
See Also:
DBR

put

public void put(java.lang.String ivalue)
         throws BadTypeException,
                BadCountException,
                PutFailException
Synchronously put a String into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The String to send.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.

put

public void put(short ivalue)
         throws BadTypeException,
                BadCountException,
                PutFailException
Synchronously put a short value into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The short value to send.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.

put

public void put(short[] ivalue)
         throws BadTypeException,
                BadCountException,
                PutFailException
Synchronously put an array of short into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The array of short to send.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.

put

public void put(float ivalue)
         throws BadTypeException,
                BadCountException,
                PutFailException
Synchronously put a float value into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The float value to send.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.

put

public void put(float[] ivalue)
         throws BadTypeException,
                BadCountException,
                PutFailException
Synchronously put an array of float into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The array of float to send.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.

put

public void put(byte ivalue)
         throws BadTypeException,
                BadCountException,
                PutFailException
Synchronously put a byte value into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The byte value to send.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.

put

public void put(byte[] ivalue)
         throws BadTypeException,
                BadCountException,
                PutFailException
Synchronously put an array of byte into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The array of byte to send.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.

put

public void put(int ivalue)
         throws BadTypeException,
                BadCountException,
                PutFailException
Synchronously put an int value into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The int value to send.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.

put

public void put(int[] ivalue)
         throws BadTypeException,
                BadCountException,
                PutFailException
Synchronously put an array of int into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The array of int to send.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.

put

public void put(double ivalue)
         throws BadTypeException,
                BadCountException,
                PutFailException
Synchronously put a double value into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The double value to send.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.

put

public void put(double[] ivalue)
         throws BadTypeException,
                BadCountException,
                PutFailException
Synchronously put an array of double into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The array of double to send.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.

put

public void put(DBR ivalue,
                PutListener l,
                java.lang.Object arg)
         throws BadTypeException,
                BadCountException,
                PutFailException
Asynchronously put a DBR object into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The DBR Object to send.
l - The PutListener to notify when the put has completed
arg - An object to pass to the listener.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.
See Also:
DBR, PutListener

put

public void put(java.lang.String ivalue,
                PutListener l,
                java.lang.Object arg)
         throws BadTypeException,
                BadCountException,
                PutFailException
Asynchronously put a String into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The String to send.
l - The PutListener to notify when the put has completed
arg - An object to pass to the listener.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.
See Also:
PutListener

put

public void put(short ivalue,
                PutListener l,
                java.lang.Object arg)
         throws BadTypeException,
                BadCountException,
                PutFailException
Asynchronously put a short into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The short value to send.
l - The PutListener to notify when the put has completed
arg - An object to pass to the listener.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.
See Also:
PutListener

put

public void put(short[] ivalue,
                PutListener l,
                java.lang.Object arg)
         throws BadTypeException,
                BadCountException,
                PutFailException
Asynchronously put an array of short into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The array of short to send.
l - The PutListener to notify when the put has completed
arg - An object to pass to the listener.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.
See Also:
PutListener

put

public void put(float ivalue,
                PutListener l,
                java.lang.Object arg)
         throws BadTypeException,
                BadCountException,
                PutFailException
Asynchronously put a float into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The float to send.
l - The PutListener to notify when the put has completed
arg - An object to pass to the listener.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.
See Also:
PutListener

put

public void put(float[] ivalue,
                PutListener l,
                java.lang.Object arg)
         throws BadTypeException,
                BadCountException,
                PutFailException
Asynchronously put an array of float into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The array of short to send.
l - The PutListener to notify when the put has completed
arg - An object to pass to the listener.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.
See Also:
PutListener

put

public void put(byte ivalue,
                PutListener l,
                java.lang.Object arg)
         throws BadTypeException,
                BadCountException,
                PutFailException
Asynchronously put a byte into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The byte to send.
l - The PutListener to notify when the put has completed
arg - An object to pass to the listener.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.
See Also:
PutListener

put

public void put(byte[] ivalue,
                PutListener l,
                java.lang.Object arg)
         throws BadTypeException,
                BadCountException,
                PutFailException
Asynchronously put an array of byte into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The byte to send.
l - The PutListener to notify when the put has completed
arg - An object to pass to the listener.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.
See Also:
PutListener

put

public void put(int ivalue,
                PutListener l,
                java.lang.Object arg)
         throws BadTypeException,
                BadCountException,
                PutFailException
Asynchronously put a int into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The int to send.
l - The PutListener to notify when the put has completed
arg - An object to pass to the listener.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.
See Also:
PutListener

put

public void put(int[] ivalue,
                PutListener l,
                java.lang.Object arg)
         throws BadTypeException,
                BadCountException,
                PutFailException
Asynchronously put an array of int into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The array of int to send.
l - The PutListener to notify when the put has completed
arg - An object to pass to the listener.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.
See Also:
PutListener

put

public void put(double ivalue,
                PutListener l,
                java.lang.Object arg)
         throws BadTypeException,
                BadCountException,
                PutFailException
Asynchronously put a double into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The double to send.
l - The PutListener to notify when the put has completed
arg - An object to pass to the listener.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.
See Also:
PutListener

put

public void put(double[] ivalue,
                PutListener l,
                java.lang.Object arg)
         throws BadTypeException,
                BadCountException,
                PutFailException
Asynchronously put an array of double into the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The array of double to send.
l - The PutListener to notify when the put has completed
arg - An object to pass to the listener.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
PutFailException - The put operation failled.
See Also:
PutListener

get

public void get(DBR ivalue)
         throws BadTypeException,
                BadCountException,
                GetFailException
Synchronously get a DBR Object from the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The DBR Object requested.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
GetFailException - The get operation failled.
See Also:
DBR

get

public void get(DBR ivalue,
                GetListener l,
                java.lang.Object arg)
         throws BadTypeException,
                BadCountException,
                GetFailException
Asynchronously get a DBR object from the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The DBR Object requested.
l - The GetListener to notify when the get has completed
arg - An object to pass to the listener.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
GetFailException - The get operation failled.
See Also:
DBR, GetListener

addMonitor

public Monitor addMonitor(DBR ivalue,
                          MonitorListener l,
                          java.lang.Object arg,
                          int mask)
                   throws BadTypeException,
                          BadCountException,
                          MonitorFailException
Add a monitor to the PV. The request is queued and not forwarded to the IOC until one of Ca.flushIO, Ca.pendIO, Ca.pendEvent is called.
Parameters:
ivalue - The DBR Object requested.
l - The GetListener to notify when the get has completed
arg - An object to pass to the listener.
mask - The mask of the monitor. It can be a combination of Monitor.VALUE, Monitor.LOG, Monitor.ALARM.
Returns:
A Monitor object that can be used to clear the monitor.
Throws:
BadTypeException - The DBR is of an invalid type for the PV.
BadCountException - The DBR has an invalid element count for the PV.
MonitorFailException - The add monitor operation failled.
See Also:
DBR, GetListener, Monitor