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.
java.nio bugs in Win32 implementation.See also CAJ project dependencies.
preemptive_callbacks are on by defaultpendEvent() does nothing but sleepSimple 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.)
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.