Users manual

Channel Access for Java (CAJ) is a 100% pure Java implementation of the EPICS Channel Access server and client library.

It is implemented as JCA pluggable implementation, therefore migration from JNI CA implementation can be achieved simply by changing one line of code.

Dependencies

  • Java 1.4.2_05 (or newer) needed, due to java.nio bugs in Win32 implementation.

  • JCA 2.3.0 or newer (since CAJ, JCAS are pluggable to JCA)

    Can be obtained from http://jca.cosylab.com/
  • Backport of Java Concurrent library 2.2 or newer (required only for Java 1.4 or older)

    Java library containing efficient versions of utility classes commonly encountered in concurrent Java programming (intergrated in Java 5).

    See: http://dcl.mathcs.emory.edu/util/backport-util-concurrent/

See also CAJ project dependencies.

Notes on implementation

  • since CAJ is pure Java, it follows Java programming design (i.e. no silly C/C++ constructs)
    • preemptive_callbacks are on by default
    • pendEvent() does nothing but sleep

Running

Simple command line to run a CAJ application:

java -cp caj-1.1.2.jar:jca-2.3.0.jar:example.jar com.cosylab.epics.caj.test.BasicExample <pv name>

(Sources are available in the source distribution of CAJ, and here to download example.jar.)

Migration from JNI CA to CAJ

Change (by example):

jca.createContext(JCALibrary.JNI_SINGLE_THREADED);
	  
    or
	  
jca.createContext(JCALibrary.JNI_THREAD_SAFE);

to

jca.createContext(JCALibrary.CHANNEL_ACCESS_JAVA);

Configuration file can be found in distribution JARs.

See JCA tutorial on configuration: http://www.aps.anl.gov/xfd/SoftDist/swBCDA/jca/2.1.2/tutorial.html.

CAJ configuration properties: http://jca.cosylab.com/apidocs/gov/aps/jca/JCALibrary.html#CHANNEL_ACCESS_JAVA.

... and you will experience much better stability and performance.