gov.aps.epics.jca
Class Ca

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

public class Ca
extends java.lang.Object
implements CaConstants


Field Summary
 
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
Ca()
           
 
Method Summary
static gov.aps.epics.jca.Context createContext()
          Creates a new Context with a default name, preemptive callbacks disabled and an internal thread control mode.
static gov.aps.epics.jca.Context createContext(int callback)
          Creates a new Context with a default name, a specified callback mode and an internal thread control mode.
static gov.aps.epics.jca.Context createContext(int callback, int thread)
          Creates a new Context with a default name, a specified callback mode and a specified thread control mode.
static gov.aps.epics.jca.Context createContext(java.lang.String name)
          Creates a new Context with a specified name, preemptive callbacks disabled and an internal thread control mode.
static gov.aps.epics.jca.Context createContext(java.lang.String name, int callback)
          Creates a new Context with a specified name, a specified callback mode and an internal thread control mode.
static gov.aps.epics.jca.Context createContext(java.lang.String name, int callback, int thread)
          Creates a new Context with a specified name, a specified callback mode and a specified thread control mode.
static int getCallbackMode(java.lang.String callback)
          Returns the callback mode corresponding to the mode string.
static java.lang.String getCallbackModeString(gov.aps.epics.jca.Context context)
          Returns the String representing the Context's callback mode.
static java.lang.String getCallbackModeString(int callback)
          Returns the String representing the Context's callback mode.
static java.lang.String getConnectionStateString(int cs_xxx)
          Returns the String representing the CS_XXX code.
static gov.aps.epics.jca.Context[] getContextList()
          Returns the list of all contexts created .
static java.lang.String getDBRTypeString(gov.aps.epics.jca.dbr.DBR dbr)
          Returns the String representing the type of the DBR object.
static java.lang.String getDBRTypeString(int type)
          Returns the String representing the dbr type value.
static java.lang.String getECACodeMessage(int eca_message)
          Returns the String representing the ECA_XXX code.
static int getECACodeNo(int eca_message)
          Returns the message number of the ECA_XXX code.
static int getECACodeSeverity(int eca_message)
          Returns the severity value of the ECA_XXX code.
static int getModification()
          Returns the CA modification.
static java.lang.String getOPString(int ca_op)
          Returns the String representing the CA_OP code.
static java.lang.String getReleaseString()
          Returns the CA release String.
static int getRevision()
          Returns the CA revision.
static int getThreadCtrlMode(java.lang.String thread)
          Returns the thread mode corresponding to the mode string.
static java.lang.String getThreadCtrlModeString(gov.aps.epics.jca.Context context)
          Returns the String representing the Context's thread control mode.
static java.lang.String getThreadCtrlModeString(int thread)
          Returns the String representing the Context's thread control mode.
static int getVersion()
          Returns the CA version.
static java.lang.String getVersionString()
          Returns the CA version's String.
static boolean isDBE_ALARM(int mask)
          Determines wether the monitor mask includes the DBE_ALARM flag.
static boolean isDBE_LOG(int mask)
          Determines wether the monitor mask includes the DBE_LOG flag.
static boolean isDBE_VALUE(int mask)
          Determines wether the monitor mask includes the DBE_VALUE flag.
static void printInfo(gov.aps.epics.jca.Channel ch)
          Prints detailed information about the provided Channel to the standard output stream.
static void printInfo(gov.aps.epics.jca.Channel ch, java.io.PrintStream out)
          Prints detailed information about the provided Channel to the specified output stream.
static void printInfo(gov.aps.epics.jca.Context ctx)
          Prints detailed information about the provided Context to the standard output stream.
static void printInfo(gov.aps.epics.jca.Context ctx, java.io.PrintStream out)
          Prints detailed information about the provided Context to the specified output stream.
static void printInfo(gov.aps.epics.jca.dbr.DBR dbr)
          Prints detailed information about the provided DBR object to the standard output stream.
static void printInfo(gov.aps.epics.jca.dbr.DBR dbr, java.io.PrintStream out)
          Prints detailed information about the provided DBR object to the specified output stream.
static void printValue(byte[] value)
          Helper method to print an array of byte as a comma separated list to the standard output stream.
static void printValue(byte[] value, java.io.PrintStream out)
          Helper method to print an array of byte as a comma separated list to the specified output stream.
static void printValue(double[] value)
          Helper method to print an array of double as a comma separated list to the standard output stream.
static void printValue(double[] value, java.io.PrintStream out)
          Helper method to print an array of double as a comma separated list to the specified output stream.
static void printValue(float[] value)
          Helper method to print an array of float as a comma separated list to the standard output stream.
static void printValue(float[] value, java.io.PrintStream out)
          Helper method to print an array of float as a comma separated list to the specified output stream.
static void printValue(int[] value)
          Helper method to print an array of int as a comma separated list to the standard output stream.
static void printValue(int[] value, java.io.PrintStream out)
          Helper method to print an array of int as a comma separated list to the specified output stream.
static void printValue(long[] value)
          Helper method to print an array of long as a comma separated list to the standard output stream.
static void printValue(long[] value, java.io.PrintStream out)
          Helper method to print an array of long as a comma separated list to the specified output stream.
static void printValue(short[] value)
          Helper method to print an array of short as a comma separated list to the standard output stream.
static void printValue(short[] value, java.io.PrintStream out)
          Helper method to print an array of short as a comma separated list to the specified output stream.
static void printValue(java.lang.String[] value)
          Helper method to print an array of String as a comma separated list to the standard output stream.
static void printValue(java.lang.String[] value, java.io.PrintStream out)
          Helper method to print an array of String as a comma separated list to the specified output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ca

public Ca()
Method Detail

getVersion

public static int getVersion()
Returns the CA version.


getRevision

public static int getRevision()
Returns the CA revision.


getModification

public static int getModification()
Returns the CA modification.


getVersionString

public static java.lang.String getVersionString()
Returns the CA version's String.


getReleaseString

public static java.lang.String getReleaseString()
Returns the CA release String.


createContext

public static gov.aps.epics.jca.Context createContext()
                                               throws CaException
Creates a new Context with a default name, preemptive callbacks disabled and an internal thread control mode.

CaException

createContext

public static gov.aps.epics.jca.Context createContext(java.lang.String name)
                                               throws CaException
Creates a new Context with a specified name, preemptive callbacks disabled and an internal thread control mode.

Parameters:
name - the Context name.
CaException

createContext

public static gov.aps.epics.jca.Context createContext(int callback)
                                               throws CaException
Creates a new Context with a default name, a specified callback mode and an internal thread control mode.

Parameters:
callback - the callback mode: DISABLE_PREEMPTIVE_CALLBACK or ENABLE_PREEMPTIVE_CALLBACK.
CaException

createContext

public static gov.aps.epics.jca.Context createContext(java.lang.String name,
                                                      int callback)
                                               throws CaException
Creates a new Context with a specified name, a specified callback mode and an internal thread control mode.

Parameters:
name - the Context name.
callback - the callback mode: DISABLE_PREEMPTIVE_CALLBACK or ENABLE_PREEMPTIVE_CALLBACK.
CaException

createContext

public static gov.aps.epics.jca.Context createContext(int callback,
                                                      int thread)
                                               throws CaException
Creates a new Context with a default name, a specified callback mode and a specified thread control mode.

Parameters:
thread - the thread control mode: THREAD_CTRL_EXTERNAL or THREAD_CTRL_INTERNAL.
CaException

createContext

public static gov.aps.epics.jca.Context createContext(java.lang.String name,
                                                      int callback,
                                                      int thread)
                                               throws CaException
Creates a new Context with a specified name, a specified callback mode and a specified thread control mode.

Parameters:
name - the Context name.
callback - the callback mode: DISABLE_PREEMPTIVE_CALLBACK or ENABLE_PREEMPTIVE_CALLBACK.
thread - the thread control mode: THREAD_CTRL_EXTERNAL or THREAD_CTRL_INTERNAL.
Returns:
the new Context.
CaException

getContextList

public static gov.aps.epics.jca.Context[] getContextList()
Returns the list of all contexts created .


getCallbackModeString

public static java.lang.String getCallbackModeString(gov.aps.epics.jca.Context context)
Returns the String representing the Context's callback mode.

Parameters:
context - the context.
Returns:
the representing String.
See Also:
Context

getCallbackMode

public static int getCallbackMode(java.lang.String callback)
Returns the callback mode corresponding to the mode string.

Parameters:
callback - the callback mode name.
Returns:
the callback mode or -1 if the name does not correspond to a valid mode.
See Also:
Context

getCallbackModeString

public static java.lang.String getCallbackModeString(int callback)
Returns the String representing the Context's callback mode.

Parameters:
callback - the callback mode.
Returns:
the representing String.
See Also:
Context

getThreadCtrlModeString

public static java.lang.String getThreadCtrlModeString(gov.aps.epics.jca.Context context)
Returns the String representing the Context's thread control mode.

Parameters:
context - the context.
Returns:
the representing String.
See Also:
Context

getThreadCtrlMode

public static int getThreadCtrlMode(java.lang.String thread)
Returns the thread mode corresponding to the mode string.

Parameters:
thread - the thread mode name.
Returns:
the thread mode or -1 if the name does not correspond to a valid mode.
See Also:
Context

getThreadCtrlModeString

public static java.lang.String getThreadCtrlModeString(int thread)
Returns the String representing the Context's thread control mode.

Parameters:
thread - the thread control mode.
Returns:
the representing String.
See Also:
Context

printInfo

public static void printInfo(gov.aps.epics.jca.Context ctx)
Prints detailed information about the provided Context to the standard output stream.

Parameters:
ctx - the context.

printInfo

public static void printInfo(gov.aps.epics.jca.Context ctx,
                             java.io.PrintStream out)
Prints detailed information about the provided Context to the specified output stream.

Parameters:
ctx - the context.
out - the output stream.

printInfo

public static void printInfo(gov.aps.epics.jca.dbr.DBR dbr)
Prints detailed information about the provided DBR object to the standard output stream.

Parameters:
dbr - the context.

printInfo

public static void printInfo(gov.aps.epics.jca.dbr.DBR dbr,
                             java.io.PrintStream out)
Prints detailed information about the provided DBR object to the specified output stream.

Parameters:
dbr - the context.
out - the output stream.

printInfo

public static void printInfo(gov.aps.epics.jca.Channel ch)
Prints detailed information about the provided Channel to the standard output stream.


printInfo

public static void printInfo(gov.aps.epics.jca.Channel ch,
                             java.io.PrintStream out)
Prints detailed information about the provided Channel to the specified output stream.

Parameters:
out - the output stream.

getOPString

public static java.lang.String getOPString(int ca_op)
Returns the String representing the CA_OP code.

Parameters:
ca_op - the CA_OP_XXX code.
Returns:
the representing String.
See Also:
ContextExceptionEvent

getConnectionStateString

public static java.lang.String getConnectionStateString(int cs_xxx)
Returns the String representing the CS_XXX code.

Parameters:
cs_xxx - the CS_XXX code.
Returns:
the representing String.
See Also:
Channel.getState()

getECACodeSeverity

public static int getECACodeSeverity(int eca_message)
Returns the severity value of the ECA_XXX code.

Parameters:
eca_message - the ECA_XXX code.
Returns:
the severity valule. One of CA_K_XXX.
See Also:
CaConstants

getECACodeNo

public static int getECACodeNo(int eca_message)
Returns the message number of the ECA_XXX code.

Parameters:
eca_message - the ECA_XXX code.
Returns:
the message number.
See Also:
CaConstants

getECACodeMessage

public static java.lang.String getECACodeMessage(int eca_message)
Returns the String representing the ECA_XXX code.

Parameters:
eca_message - the ECA_XXX code.
Returns:
the representing String.
See Also:
CaConstants

isDBE_VALUE

public static boolean isDBE_VALUE(int mask)
Determines wether the monitor mask includes the DBE_VALUE flag.

Parameters:
mask - the mask value.
Returns:
true if the mask includes DBE_VALUE, false otherwise.
See Also:
CaConstants

isDBE_LOG

public static boolean isDBE_LOG(int mask)
Determines wether the monitor mask includes the DBE_LOG flag.

Parameters:
mask - the mask value.
Returns:
true if the mask includes DBE_LOG, false otherwise.
See Also:
CaConstants

isDBE_ALARM

public static boolean isDBE_ALARM(int mask)
Determines wether the monitor mask includes the DBE_ALARM flag.

Parameters:
mask - the mask value.
Returns:
true if the mask includes DBE_LOG, false otherwise.
See Also:
CaConstants

getDBRTypeString

public static java.lang.String getDBRTypeString(gov.aps.epics.jca.dbr.DBR dbr)
Returns the String representing the type of the DBR object.

Parameters:
dbr - the DBR object.
Returns:
the type's String.
See Also:
CaConstants

getDBRTypeString

public static java.lang.String getDBRTypeString(int type)
Returns the String representing the dbr type value.

Returns:
the type's String.
See Also:
CaConstants

printValue

public static void printValue(byte[] value)
Helper method to print an array of byte as a comma separated list to the standard output stream.

Parameters:
value - the array to print.

printValue

public static void printValue(byte[] value,
                              java.io.PrintStream out)
Helper method to print an array of byte as a comma separated list to the specified output stream.

Parameters:
value - the array to print.
out - the output stream.

printValue

public static void printValue(short[] value)
Helper method to print an array of short as a comma separated list to the standard output stream.

Parameters:
value - the array to print.

printValue

public static void printValue(short[] value,
                              java.io.PrintStream out)
Helper method to print an array of short as a comma separated list to the specified output stream.

Parameters:
value - the array to print.
out - the output stream.

printValue

public static void printValue(int[] value)
Helper method to print an array of int as a comma separated list to the standard output stream.

Parameters:
value - the array to print.

printValue

public static void printValue(int[] value,
                              java.io.PrintStream out)
Helper method to print an array of int as a comma separated list to the specified output stream.

Parameters:
value - the array to print.
out - the output stream.

printValue

public static void printValue(long[] value)
Helper method to print an array of long as a comma separated list to the standard output stream.

Parameters:
value - the array to print.

printValue

public static void printValue(long[] value,
                              java.io.PrintStream out)
Helper method to print an array of long as a comma separated list to the specified output stream.

Parameters:
value - the array to print.
out - the output stream.

printValue

public static void printValue(float[] value)
Helper method to print an array of float as a comma separated list to the standard output stream.

Parameters:
value - the array to print.

printValue

public static void printValue(float[] value,
                              java.io.PrintStream out)
Helper method to print an array of float as a comma separated list to the specified output stream.

Parameters:
value - the array to print.
out - the output stream.

printValue

public static void printValue(double[] value)
Helper method to print an array of double as a comma separated list to the standard output stream.

Parameters:
value - the array to print.

printValue

public static void printValue(double[] value,
                              java.io.PrintStream out)
Helper method to print an array of double as a comma separated list to the specified output stream.

Parameters:
value - the array to print.
out - the output stream.

printValue

public static void printValue(java.lang.String[] value)
Helper method to print an array of String as a comma separated list to the standard output stream.

Parameters:
value - the array to print.

printValue

public static void printValue(java.lang.String[] value,
                              java.io.PrintStream out)
Helper method to print an array of String as a comma separated list to the specified output stream.

Parameters:
value - the array to print.
out - the output stream.