|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.aps.epics.jca.Context
The class representing a CA Context.
A Context controls all IO operations and the circuits thru which Channels will be created and connected. Since CA 3.14 an application can create more than one context, thus ehancing IO control and Channels managment. It is also possible for the application to specify how asynchronous callbacks will be provided by a context.
Two differents mode are possible:
ENABLE_PREEMPTIVE_CALLBACK : The callbacks are controled by independant threads. The application
does not need to call pendEvent() to process pending event.
DISABLE_PREEMPTIVE_CALLBACK: The callbacks are controled by the application itself which
need to call pendEvent() to process pending events.
In earlier CA version, only on context using the DISABLE_PREEMPTIVE_CALLBACK mode is allowed.
The Context class also offers two different thread control mode.
THREAD_CTRL_EXTERNAL: in this mode only the thread that created the Context (and all
others that have registered with the Context) are allowed to perform
operations.
THREAD_CTRL_INTERNAL: in this mode the Context uses its own internal thread to perform
operations, thus allowing any thread in the application to access the Context.
For complexity reasons uses THREAD_CTRL_EXTERNAL mode in simple application
or in application where you want to control which threads will access the Context.
Ca,
CaConstants| Field Summary | |
protected static java.util.HashMap |
_contextMap
|
| Constructor Summary | |
Context()
|
|
| Method Summary | |
abstract void |
attachCurrentThread()
|
gov.aps.epics.jca.Channel |
createChannel(java.lang.String name)
Create a new Channel using this context to access a process variable. |
abstract gov.aps.epics.jca.Channel |
createChannel(java.lang.String name,
gov.aps.epics.jca.ConnectionListener l)
Create a new Channel using this context to access a process variable with a ConnectionListener to receive ConnectionEvent from the newly created Channel. |
abstract void |
destroy()
Destroys the Context and clear all associated ressources. |
void |
dispose()
|
abstract void |
flushIO()
|
abstract int |
getCallbackMode()
Returns the Context's callback mode. |
java.lang.String |
getCallbackModeString()
Returns a String representing the Context's callback mode. |
abstract gov.aps.epics.jca.ContextExceptionListener |
getContextExceptionListener()
Returns the ContextExceptionListener registered with the Context. |
static gov.aps.epics.jca.Context[] |
getContextList()
Returns all created Contexts. |
abstract gov.aps.epics.jca.ContextMessageListener |
getContextMessageListener()
Returns the ContextMessageListener registered with the Context. |
abstract java.lang.String |
getName()
Returns the name of the Context. |
abstract int |
getThreadCtrlMode()
Returns the Context's thread control mode. |
java.lang.String |
getThreadCtrlModeString()
Returns a String representing the Context's thread control mode. |
protected static gov.aps.epics.jca.Context |
lookupContext(java.lang.String name)
|
abstract void |
pendEvent(double time)
Process all pending events. |
abstract void |
pendIO(double timeout)
Process all pending IO operations. |
abstract void |
poll()
|
void |
printInfo()
Prints detailed information about the Context to the standard output stream. |
void |
printInfo(java.io.PrintStream out)
Prints detailed information about the Context to the specified output stream. |
protected static void |
registerContext(gov.aps.epics.jca.Context c)
|
abstract void |
setContextExceptionListener(gov.aps.epics.jca.ContextExceptionListener l)
Sets the ContextExceptionListener which will receive ContextExceptionEvents from this Context. |
abstract void |
setContextMessageListener(gov.aps.epics.jca.ContextMessageListener l)
Sets the ContextMessageListener which will receive ContextMessageEvents from this Context. |
abstract boolean |
testIO()
Tests if there are some pending IO requests. |
protected static void |
unregisterContext(gov.aps.epics.jca.Context c)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static java.util.HashMap _contextMap
| Constructor Detail |
public Context()
| Method Detail |
public void printInfo()
public void printInfo(java.io.PrintStream out)
out - the output stream.protected static void registerContext(gov.aps.epics.jca.Context c)
protected static void unregisterContext(gov.aps.epics.jca.Context c)
protected static gov.aps.epics.jca.Context lookupContext(java.lang.String name)
public static gov.aps.epics.jca.Context[] getContextList()
public void dispose()
public abstract java.lang.String getName()
public abstract int getThreadCtrlMode()
CaConstantspublic java.lang.String getThreadCtrlModeString()
CaConstantspublic abstract int getCallbackMode()
CaConstantspublic java.lang.String getCallbackModeString()
CaConstantspublic abstract gov.aps.epics.jca.ContextMessageListener getContextMessageListener()
public abstract void setContextMessageListener(gov.aps.epics.jca.ContextMessageListener l)
throws CaException
l - the ContextMessageListener.
CaExceptionpublic abstract gov.aps.epics.jca.ContextExceptionListener getContextExceptionListener()
public abstract void setContextExceptionListener(gov.aps.epics.jca.ContextExceptionListener l)
throws CaException
l - the ContextExceptionListener.
CaException
public abstract void destroy()
throws CaException
CaException
public gov.aps.epics.jca.Channel createChannel(java.lang.String name)
throws CaException
name - the process variable to connect to.
CaException
public abstract gov.aps.epics.jca.Channel createChannel(java.lang.String name,
gov.aps.epics.jca.ConnectionListener l)
throws CaException
name - the process variable to connect to.l - the ConnectionListener.
CaException - is thrown if the Context has been destroyed.
public abstract void pendIO(double timeout)
throws CaException
timeout - the timeout limit.
CaException - is thrown if all the IO couldn't be processed.
CaException - is thrown if the Context has been destroyed.
public abstract boolean testIO()
throws CaException
CaException
public abstract void pendEvent(double time)
throws CaException
time - the time during which the Context will process events.
CaException
public abstract void poll()
throws CaException
CaException
public abstract void flushIO()
throws CaException
CaException
public abstract void attachCurrentThread()
throws CaException
CaException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||