public final class JCALibrary extends Object
getInstance().
This object can be used to retreive all JCA configuration and version and to create new contexts.Global : The file <jre home>/lib/JCALibrary.properties defines global properties User : The file <user home>/.JCALibrary/JCALibrary.properties defines per user's properties Command Line: Properties can also be passed as command line argument using the -D switchThe command line properties take precedence over the user's properties which take precedence over the global properties.
This two implementations are using the Java Native Interface (JNI) to communicate with channel access servers. They are both accessing a JNI bridge which require a set of two special properties:JNI_THREAD_SAFEJNI_SINGLE_THREADEDCHANNEL_ACCESS_JAVA
gov.aps.jca.jni.epics.<your arch>.library.path: the path of you're epics distribution shared libraries. gov.aps.jca.jni.epics.<your arch>.caRepeater.path: the path of you're epics caRepeater executable.Note: <your arch> represent you're epics host architecture, ie win32-x86, linux-x86, solaris-sparc, etc...
| Modifier and Type | Field and Description |
|---|---|
static String |
CHANNEL_ACCESS_JAVA
Constant string representing the fully qualified class name of a 100% pure java channel access Context implementation.
|
static String |
CHANNEL_ACCESS_SERVER_JAVA
Constant string representing the fully qualified class name of a 100% pure java channel access ServerContext implementation.
|
static String |
JNI_SINGLE_THREADED
Constant string representing the fully qualified class name of a single-threaded Context implementation.
|
static String |
JNI_THREAD_SAFE
Constant string representing the fully qualified class name of a thread safe Context implementation.
|
| Modifier | Constructor and Description |
|---|---|
protected |
JCALibrary()
Construct and configure the JCALibrary.
|
| Modifier and Type | Method and Description |
|---|---|
Context |
createContext(Configuration configuration)
Create a new context instance using a Configuration object.
|
Context |
createContext(String fqn)
Create a new context instance using a fully qualified class name and using the Context's default configuration.
|
ServerContext |
createServerContext(Configuration configuration,
Server server)
Create a new server context instance using a Configuration object.
|
ServerContext |
createServerContext(String fqn,
Server server)
Create a new context instance using a fully qualified class name and using the ServerContext's default configuration.
|
static JCALibrary |
getInstance()
Getter method to the only instance of JCALibrary.
|
int |
getModification()
Getter method for the modification number.
|
String |
getProperty(String name)
Retreive a JCALibrary property.
|
String |
getProperty(String name,
String defaultValue)
Retreive a JCALibrary property with a default value.
|
boolean |
getPropertyAsBoolean(String name,
boolean defaultValue)
Retreive a JCALibrary property as a boolean with a default value.
|
double |
getPropertyAsDouble(String name,
double defaultValue)
Retreive a JCALibrary property as a double with a default value.
|
float |
getPropertyAsFloat(String name,
float defaultValue)
Retreive a JCALibrary property as a float with a default value.
|
int |
getPropertyAsInt(String name,
int defaultValue)
Retreive a JCALibrary property as an int with a default value.
|
long |
getPropertyAsLong(String name,
long defaultValue)
Retreive a JCALibrary property as a long with a default value.
|
int |
getRevision()
Getter method for the revision number.
|
int |
getVersion()
Getter method for the version number.
|
String |
getVersionString()
Getter method for the full version string.
|
void |
listProperties()
Print all JCALibrary properties to the standard output stream.
|
void |
listProperties(PrintStream out)
Print all JCALibrary properties to a specified output stream.
|
void |
printInfo()
Print some basic info about the JCALibrary to the standard output stream.
|
void |
printInfo(PrintStream out)
Print some basic info about the JCALibrary to the specified output stream.
|
String |
toString() |
public static final String JNI_THREAD_SAFE
| Using JCALibrary Properties |
|
Property name
|
Range
|
Default value
|
Description
|
| gov.aps.jca.jni.ThreadSafeContext.preemptive_callback |
true/false
|
true
|
Define whether the context should use independant threads to send request
callback notifications (events). |
| gov.aps.jca.jni.ThreadSafeContext.addr_list |
N.N.N.N N.N.N.N:P ...
|
empty string
|
A space-separated list of broadcast address for process variable name resolution. Each address must be of the form: ip.number:port or host.name:port |
| gov.aps.jca.jni.ThreadSafeContext.auto_addr_list |
true/false
|
true
|
Define whether or not the network interfaces should be discovered at runtime. |
| gov.aps.jca.jni.ThreadSafeContext.connection_timeout |
>0.1
|
30.0
|
If the context doesn't see a beacon from a server that it is connected to for connection_timeout seconds then a state-of-health message is sent to the server over TCP/IP. If this state-of-health message isn't promptly replied to then the context will assume that the server is no longer present on the network and disconnect. |
| gov.aps.jca.jni.ThreadSafeContext.beacon_period |
>0.1
|
15.0
|
Period in second between two beacon signals |
| gov.aps.jca.jni.ThreadSafeContext.repeater_port |
>5000
|
5065
|
Port number for the repeater to listen to |
| gov.aps.jca.jni.ThreadSafeContext.server_port |
>5000
|
5064
|
Port number for the server to listen to |
| gov.aps.jca.jni.ThreadSafeContext.max_array_bytes |
>=16384
|
16384
|
Length in bytes of the maximum array size that may pass through Channel Access |
| gov.aps.jca.jni.ThreadSafeContext.event_dispatcher_class |
gov.aps.jca.event.DirectEventDispatcher
|
The fully qualified class name of the event dispatcher used to dispatch callback event. This class must have a default constructor with no arguments. Check the documentation of the event dispatcher to see how to configure it. |
| Using a Configuration object |
public static final String JNI_SINGLE_THREADED
|
Property name
|
Range
|
Default value
|
Description
|
| gov.aps.jca.jni.SingleThreadedContext.preemptive_callback |
true/false
|
true
|
Define whether the context should use independant threads to send request
callback notifications (events). |
| gov.aps.jca.jni.SingleThreadedContext.addr_list |
N.N.N.N N.N.N.N:P ...
|
empty string
|
A space-separated list of broadcast address for process variable name resolution. Each address must be of the form: ip.number:port or host.name:port |
| gov.aps.jca.jni.SingleThreadedContext.auto_addr_list |
true/false
|
true
|
Define whether or not the network interfaces should be discovered at runtime. |
| gov.aps.jca.jni.SingleThreadedContext.connection_timeout |
>0.1
|
30.0
|
If the context doesn't see a beacon from a server that it is connected to for connection_timeout seconds then a state-of-health message is sent to the server over TCP/IP. If this state-of-health message isn't promptly replied to then the context will assume that the server is no longer present on the network and disconnect. |
| gov.aps.jca.jni.SingleThreadedContext.beacon_period |
>0.1
|
15.0
|
Period in second between two beacon signals |
| gov.aps.jca.jni.SingleThreadedContext.repeater_port |
>5000
|
5065
|
Port number for the repeater to listen to |
| gov.aps.jca.jni.SingleThreadedContext.server_port |
>5000
|
5064
|
Port number for the server to listen to |
| gov.aps.jca.jni.SingleThreadedContext.max_array_bytes |
>=16384
|
16384
|
Length in bytes of the maximum array size that may pass through Channel Access |
public static final String CHANNEL_ACCESS_JAVA
|
Property name
|
Range
|
Default value
|
Description
|
| com.cosylab.epics.caj.CAJContext.addr_list |
N.N.N.N N.N.N.N:P ...
|
empty string
|
A space-separated list of broadcast address for process variable name resolution. Each address must be of the form: ip.number:port or host.name:port |
| com.cosylab.epics.caj.CAJContext.auto_addr_list |
true/false
|
true
|
Define whether or not the network interfaces should be discovered at runtime. |
| com.cosylab.epics.caj.CAJContext.connection_timeout |
>0.1
|
30.0
|
If the context doesn't see a beacon from a server that it is connected to for connection_timeout seconds then a state-of-health message is sent to the server over TCP/IP. If this state-of-health message isn't promptly replied to then the context will assume that the server is no longer present on the network and disconnect. |
| com.cosylab.epics.caj.CAJContext.beacon_period |
>0.1
|
15.0
|
Period in second between two beacon signals |
| com.cosylab.epics.caj.CAJContext.repeater_port |
>5000
|
5065
|
Port number for the repeater to listen to |
| com.cosylab.epics.caj.CAJContext.server_port |
>5000
|
5064
|
Port number for the server to listen to |
| com.cosylab.epics.caj.CAJContext.max_array_bytes |
>=16384
|
16384
|
Length in bytes of the maximum array size that may pass through Channel Access |
| com.cosylab.epics.caj.impl.reactor.lf.LeaderFollowersThreadPool.thread_pool_size |
>=2
|
5
|
Number of threads to be used to process network events |
public static final String CHANNEL_ACCESS_SERVER_JAVA
|
Property name
|
Range
|
Default value
|
Description
|
| com.cosylab.epics.caj.cas.CAJServerContext.beacon_addr_list |
N.N.N.N N.N.N.N:P ...
|
com.cosylab.epics.caj.CAJContext.addr_list (empty string)
|
A space-separated list of broadcast address which to send beacons. Each address must be of the form: ip.number:port or host.name:port |
| com.cosylab.epics.caj.cas.CAJServerContext.auto_beacon_addr_list |
true/false
|
com.cosylab.epics.caj.CAJContext.auto_addr_list (true)
|
Define whether or not the network interfaces should be discovered at runtime. |
| com.cosylab.epics.caj.cas.CAJServerContext.beacon_period |
>0.1
|
com.cosylab.epics.caj.CAJContext.beacon_period (15.0)
|
Period in second between two beacon signals |
| com.cosylab.epics.caj.cas.CAJServerContext.beacon_port |
>5000
|
com.cosylab.epics.caj.CAJContext.repeater_port (5065)
|
Port number which to sends beacons |
| com.cosylab.epics.caj.cas.CAJServerContext.server_port |
>5000
|
com.cosylab.epics.caj.CAJContext.server_port (5064)
|
Port number for the server to listen to |
| com.cosylab.epics.caj.cas.CAJServerContext.ignore_addr_list |
N.N.N.N N.N.N.N:P ...
|
empty string
|
A space-separated list of addresses which name resolution request to ignore from. Each address must be of the form: ip.number:port or host.name:port |
| com.cosylab.epics.caj.cas.CAJServerContext.max_array_bytes |
>=16384
|
com.cosylab.epics.caj.CAJContext.max_array_bytes (16384)
|
Length in bytes of the maximum array size that may pass through Channel Access |
| com.cosylab.epics.caj.impl.reactor.lf.LeaderFollowersThreadPool.thread_pool_size |
>=2
|
5
|
Number of threads to be used to process network events |
public static JCALibrary getInstance()
public int getVersion()
public int getRevision()
public int getModification()
public String getVersionString()
public void printInfo()
public void printInfo(PrintStream out)
out - the output stream to send info to.public String getProperty(String name)
name - the name of the property to search for.public String getProperty(String name, String defaultValue)
name - the name of the property to search for.defaultValue - the default value to use if the property doesn't exist.public float getPropertyAsFloat(String name, float defaultValue)
name - the name of the property to search for.defaultValue - the default value to use if the property doesn't exist.public int getPropertyAsInt(String name, int defaultValue)
name - the name of the property to search for.defaultValue - the default value to use if the property doesn't exist.public boolean getPropertyAsBoolean(String name, boolean defaultValue)
name - the name of the property to search for.defaultValue - the default value to use if the property doesn't exist.public double getPropertyAsDouble(String name, double defaultValue)
name - the name of the property to search for.defaultValue - the default value to use if the property doesn't exist.public long getPropertyAsLong(String name, long defaultValue)
name - the name of the property to search for.defaultValue - the default value to use if the property doesn't exist.public void listProperties()
public void listProperties(PrintStream out)
out - the output stream to print the properties to.public Context createContext(String fqn) throws CAException
fqn - the fully qualified class name of the context to create.CAException - is thrown if the context could not be instanciated.JNI_THREAD_SAFE,
JNI_SINGLE_THREADED,
createContext(gov.aps.jca.configuration.Configuration configuration)public Context createContext(Configuration configuration) throws CAException
configuration - the Configuration object containing the Context's class name and configuration.CAException - is thrown if the context could not be instanciated.JNI_THREAD_SAFE,
JNI_SINGLE_THREADED,
Configurationpublic ServerContext createServerContext(String fqn, Server server) throws CAException
fqn - the fully qualified class name of the context to create.server - Server implementation providing ProcessVariable access (existance test and attach).CAException - is thrown if the context could not be instantiated.CHANNEL_ACCESS_SERVER_JAVA,
createServerContext(gov.aps.jca.configuration.Configuration configuration, gov.aps.jca.cas.Server server)public ServerContext createServerContext(Configuration configuration, Server server) throws CAException
configuration - the Configuration object containing the ServerContext's class name and configuration.server - Server implementation providing ProcessVariable access (existance test and attach).CAException - is thrown if the context could not be instanciated.CHANNEL_ACCESS_SERVER_JAVA,
ConfigurationCopyright © 2004-2020 EPICS. All Rights Reserved.