|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gov.aps.jca.JCALibrary
The JCALibrary class is the entry point to all JCA enabled application.
There is only one instance of this class which can be accessed by the static method getInstance()
.
This object can be used to retreive all JCA configuration and version and to create new contexts.
The JCALibrary can be configured with properties. See java.util.Properties for more details.
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_SAFE
JNI_SINGLE_THREADED
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...
Field Summary | |
static java.lang.String |
JNI_SINGLE_THREADED
Constant string representing the fully qualified class name of a single-threaded Context implementation. |
static java.lang.String |
JNI_THREAD_SAFE
Constant string representing the fully qualified class name of a thread safe Context implementation. |
Method Summary | |
Context |
createContext(Configuration configuration)
Create a new context instance using a Configuration object. |
Context |
createContext(java.lang.String fqn)
Create a new context instance using a fully qualified class name and using the Context's default configuration. |
static JCALibrary |
getInstance()
Getter method to the only instance of JCALibrary. |
int |
getModification()
Getter method for the modification number. |
java.lang.String |
getProperty(java.lang.String name)
Retreive a JCALibrary property. |
java.lang.String |
getProperty(java.lang.String name,
java.lang.String defaultValue)
Retreive a JCALibrary property with a default value. |
boolean |
getPropertyAsBoolean(java.lang.String name,
boolean defaultValue)
Retreive a JCALibrary property as a boolean with a default value. |
double |
getPropertyAsDouble(java.lang.String name,
double defaultValue)
Retreive a JCALibrary property as a double with a default value. |
float |
getPropertyAsFloat(java.lang.String name,
float defaultValue)
Retreive a JCALibrary property as a float with a default value. |
int |
getPropertyAsInt(java.lang.String name,
int defaultValue)
Retreive a JCALibrary property as an int with a default value. |
long |
getPropertyAsLong(java.lang.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. |
java.lang.String |
getVersionString()
Getter method for the full version string. |
void |
listProperties()
Print all JCALibrary properties to the standard output stream. |
void |
listProperties(java.io.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(java.io.PrintStream out)
Print some basic info about the JCALibrary to the specified output stream. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.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 java.lang.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 |
Method Detail |
public static JCALibrary getInstance()
public int getVersion()
public int getRevision()
public int getModification()
public java.lang.String getVersionString()
public void printInfo()
public void printInfo(java.io.PrintStream out)
out
- the output stream to send info to.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getProperty(java.lang.String name)
name
- the name of the property to search for.
public java.lang.String getProperty(java.lang.String name, java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.io.PrintStream out)
out
- the output stream to print the properties to.public Context createContext(java.lang.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
,
Configuration
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |