|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.aps.jca.Channel
The class representing a CA Channel.
A Channel is a link between a client (the application) and a CA process variable located on a CA server. All operations between the client and the process variable are handled by objects of this class.
The following code shows how to synchronously create a channel.
try {
JCALibrary jca= JCALibrary.getInstance();
Context ctxt= jca.createContext(JCALibrary.JNI_THREAD_SAFE);
Channel ch= ctxt.createChannel("my.Channel");
ctxt.pendIO(1.0);
... // If we're here, then the channel has been found and connected.
...
ch.destroy();
ctxt.destroy();
} catch(CAException caEx) {
System.err.println("A Error occured: "+caEx);
}
The following code shows how to asynchronously create a channel.
try {
JCALibrary jca= JCALibrary.getInstance();
Context ctxt= jca.createContext(JCALibrary.JNI_THREAD_SAFE);
Channel ch= ctxt.createChannel("my.Channel", new ConnectionListener() {
public void connectionChanged(ConnectionEvent ev) {
System.out.println("Channel is connected: "+ev.isConnected());
});
ctxt.flushIO();
... // We have no clue on whether the channel has been found and connected.
... // until the connection callback is called.
... //
ch.destroy();
ctxt.destroy();
} catch(CAException caEx) {
System.err.println("A Error occured: "+caEx);
}
Context| Nested Class Summary | |
static class |
Channel.ConnectionState
Enumeration class representing the Channel's connection state. |
| Field Summary | |
static Channel.ConnectionState |
CLOSED
Channel has been closed and destroyed. |
static Channel.ConnectionState |
CONNECTED
Channel is connected. |
static Channel.ConnectionState |
DISCONNECTED
Channel is disconnected. |
static Channel.ConnectionState |
NEVER_CONNECTED
Channel has never been connected. |
| Constructor Summary | |
Channel()
|
|
| Method Summary | |
abstract void |
addAccessRightsListener(AccessRightsListener l)
Adds a AccessRightsListener which will be notified of the access rights's changes of this Channel. |
abstract void |
addConnectionListener(ConnectionListener l)
Adds a ConnectionListener which will be notified of the connection state's changes of this Channel. |
Monitor |
addMonitor(DBRType type,
int count,
int mask)
Add a monitor to this channel. |
abstract Monitor |
addMonitor(DBRType type,
int count,
int mask,
MonitorListener l)
Adds a monitor to this Channel. |
Monitor |
addMonitor(int mask)
Add a monitor to this channel using the channel's native DBR type and count. |
Monitor |
addMonitor(int mask,
MonitorListener l)
Add a monitor to this channel using the channel's native DBR type and count. |
abstract void |
destroy()
Clear the ressources used by this channel. |
void |
dispose()
|
DBR |
get()
Synchronously reads this Channel's value using the native DBR type and count. |
abstract DBR |
get(DBRType type,
int count)
Synchronously Reads a specified number of elements of a specified type from this Channel. |
abstract void |
get(DBRType type,
int count,
GetListener l)
Asynchronously reads a specified number of elements of a specified type from this Channel |
void |
get(GetListener l)
Asynchronously reads this Channel's value using the native DBR type and count. |
DBR |
get(int count)
Synchronously Reads a specified number elements from this Channel value using the native DBR type. |
void |
get(int count,
GetListener l)
Asynchronously Reads a specified number from this Channel's value using the native DBR type. |
abstract AccessRightsListener[] |
getAccessRightsListeners()
Returns the AccessRightsListeners registered with this channel. |
abstract ConnectionListener[] |
getConnectionListeners()
Returns the ConnectionListeners registered with this channel. |
abstract Channel.ConnectionState |
getConnectionState()
Returns the connection state of this channel. |
abstract Context |
getContext()
Returns the context which created this channel. |
abstract int |
getElementCount()
Returns the element count of this channel. |
abstract DBRType |
getFieldType()
Returns the DBR type of this Channel. |
abstract java.lang.String |
getHostName()
Returns the Channel's hostname. |
abstract java.lang.String |
getName()
Returns the name of this channel. |
abstract boolean |
getReadAccess()
Returns whether read operations are allowed on this Channel. |
abstract boolean |
getWriteAccess()
Returns whether write operations are allowed on this Channel. |
void |
printInfo()
Prints details information about this Channel to the standard output stream. |
void |
printInfo(java.io.PrintStream out)
Prints details information about this Channel to the specified output stream. |
void |
put(byte value)
Synchrously writes a value to this Channel. |
abstract void |
put(byte[] value)
Synchrously writes an array to this Channel. |
abstract void |
put(byte[] value,
PutListener l)
Asynchrously writes an array to this Channel. |
void |
put(byte value,
PutListener l)
Asynchrously writes a value to this Channel. |
void |
put(double value)
Synchrously writes a value to this Channel. |
abstract void |
put(double[] value)
Synchrously writes an array to this Channel. |
abstract void |
put(double[] value,
PutListener l)
Asynchrously writes an array to this Channel. |
void |
put(double value,
PutListener l)
Asynchrously writes a value to this Channel. |
void |
put(float value)
Synchrously writes a value to this Channel. |
abstract void |
put(float[] value)
Synchrously writes an array to this Channel. |
abstract void |
put(float[] value,
PutListener l)
Asynchrously writes an array to this Channel. |
void |
put(float value,
PutListener l)
Asynchrously writes a value to this Channel. |
void |
put(int value)
Synchrously writes a value to this Channel. |
abstract void |
put(int[] value)
Synchrously writes an array to this Channel. |
abstract void |
put(int[] value,
PutListener l)
Asynchrously writes an array to this Channel. |
void |
put(int value,
PutListener l)
Asynchrously writes a value to this Channel. |
void |
put(short value)
Synchrously writes a value to this Channel. |
abstract void |
put(short[] value)
Synchrously writes an array to this Channel. |
abstract void |
put(short[] value,
PutListener l)
Asynchrously writes an array to this Channel. |
void |
put(short value,
PutListener l)
Asynchrously writes a value to this Channel. |
void |
put(java.lang.String value)
Synchrously writes a value to this Channel. |
abstract void |
put(java.lang.String[] value)
Synchrously writes an array to this Channel. |
abstract void |
put(java.lang.String[] value,
PutListener l)
Asynchrously writes an array to this Channel. |
void |
put(java.lang.String value,
PutListener l)
Asynchrously writes a value to this Channel. |
abstract void |
removeAccessRightsListener(AccessRightsListener l)
Removes a AccessRightsListener which will be notified of the access rights's changes of this Channel. |
abstract void |
removeConnectionListener(ConnectionListener l)
Removes a ConnectionListener . |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final Channel.ConnectionState NEVER_CONNECTED
public static final Channel.ConnectionState DISCONNECTED
public static final Channel.ConnectionState CONNECTED
public static final Channel.ConnectionState CLOSED
| Constructor Detail |
public Channel()
| Method Detail |
public abstract Context getContext()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void destroy()
throws CAException,
java.lang.IllegalStateException
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
CAException
public abstract ConnectionListener[] getConnectionListeners()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void addConnectionListener(ConnectionListener l)
throws CAException,
java.lang.IllegalStateException
l - the ConnectionListener to register.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void removeConnectionListener(ConnectionListener l)
throws CAException,
java.lang.IllegalStateException
l - the ConnectionListener to remove.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract AccessRightsListener[] getAccessRightsListeners()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void addAccessRightsListener(AccessRightsListener l)
throws CAException,
java.lang.IllegalStateException
l - the ConnectionListener to register.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void removeAccessRightsListener(AccessRightsListener l)
throws CAException,
java.lang.IllegalStateException
l - the ConnectionListener to remove.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract java.lang.String getName()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract DBRType getFieldType()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)DBR
public abstract int getElementCount()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract Channel.ConnectionState getConnectionState()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)Channel.ConnectionState
public abstract java.lang.String getHostName()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract boolean getReadAccess()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract boolean getWriteAccess()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public void put(byte value)
throws CAException,
java.lang.IllegalStateException
value - the value.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public void put(byte value,
PutListener l)
throws CAException,
java.lang.IllegalStateException
value - the value.l - the PutListener to notify when the request has been completed.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public void put(short value)
throws CAException,
java.lang.IllegalStateException
value - the value.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public void put(short value,
PutListener l)
throws CAException,
java.lang.IllegalStateException
value - the value.l - the PutListener to notify when the request has been completed.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public void put(int value)
throws CAException,
java.lang.IllegalStateException
value - the value.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public void put(int value,
PutListener l)
throws CAException,
java.lang.IllegalStateException
value - the value.l - the PutListener to notify when the request has been completed.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public void put(float value)
throws CAException,
java.lang.IllegalStateException
value - the value.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public void put(float value,
PutListener l)
throws CAException,
java.lang.IllegalStateException
value - the value.l - the PutListener to notify when the request has been completed.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public void put(double value)
throws CAException,
java.lang.IllegalStateException
value - the value.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public void put(double value,
PutListener l)
throws CAException,
java.lang.IllegalStateException
value - the value.l - the PutListener to notify when the request has been completed.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public void put(java.lang.String value)
throws CAException,
java.lang.IllegalStateException
value - the value.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public void put(java.lang.String value,
PutListener l)
throws CAException,
java.lang.IllegalStateException
value - the value.l - the PutListener to notify when the request has been completed.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void put(byte[] value)
throws CAException,
java.lang.IllegalStateException
value - the value.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void put(byte[] value,
PutListener l)
throws CAException,
java.lang.IllegalStateException
value - the value.l - the PutListener to notify when the request has been completed.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void put(short[] value)
throws CAException,
java.lang.IllegalStateException
value - the value.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void put(short[] value,
PutListener l)
throws CAException,
java.lang.IllegalStateException
value - the value.l - the PutListener to notify when the request has been completed.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void put(int[] value)
throws CAException,
java.lang.IllegalStateException
value - the value.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void put(int[] value,
PutListener l)
throws CAException,
java.lang.IllegalStateException
value - the value.l - the PutListener to notify when the request has been completed.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void put(float[] value)
throws CAException,
java.lang.IllegalStateException
value - the value.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void put(float[] value,
PutListener l)
throws CAException,
java.lang.IllegalStateException
value - the value.l - the PutListener to notify when the request has been completed.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void put(double[] value)
throws CAException,
java.lang.IllegalStateException
value - the value.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void put(double[] value,
PutListener l)
throws CAException,
java.lang.IllegalStateException
value - the value.l - the PutListener to notify when the request has been completed.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void put(java.lang.String[] value)
throws CAException,
java.lang.IllegalStateException
value - the value.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void put(java.lang.String[] value,
PutListener l)
throws CAException,
java.lang.IllegalStateException
value - the value.l - the PutListener to notify when the request has been completed.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public DBR get()
throws CAException,
java.lang.IllegalStateException
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public void get(GetListener l)
throws CAException,
java.lang.IllegalStateException
l - the GetListener to notify when the request has been completed.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public DBR get(int count)
throws CAException,
java.lang.IllegalStateException
count - the number of element to read.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public void get(int count,
GetListener l)
throws CAException,
java.lang.IllegalStateException
count - the number of element to read.l - the GetListener to notify when the request has been completed.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract DBR get(DBRType type,
int count)
throws CAException,
java.lang.IllegalStateException
type - the DBR type to read.count - the number of element to read.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract void get(DBRType type,
int count,
GetListener l)
throws CAException,
java.lang.IllegalStateException
type - the DBR type.count - the number of element to read.l - the GetListener to notify when the request has been completed.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public Monitor addMonitor(int mask)
throws CAException,
java.lang.IllegalStateException
mask - the mask value indicating when the listener need to be notified.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public Monitor addMonitor(int mask,
MonitorListener l)
throws CAException,
java.lang.IllegalStateException
mask - the mask value indicating when the listener need to be notified.l - a MonitorListener to be notified when the value/log/alarm changed.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)Monitor
public Monitor addMonitor(DBRType type,
int count,
int mask)
throws CAException,
java.lang.IllegalStateException
type - the monitor's type.count - the monitor's element count.mask - the mask value indicating when the listener need to be notified.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public abstract Monitor addMonitor(DBRType type,
int count,
int mask,
MonitorListener l)
throws CAException,
java.lang.IllegalStateException
type - the monitor's type.count - the monitor's element count.mask - the mask value indicating when the listener need to be notified.l - a MonitorListener to be notified when the value/log/alarm changed.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)Monitor
public void printInfo()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the channel is in no state to perform this operation (ie destroyed, etc...)
public void printInfo(java.io.PrintStream out)
throws java.lang.IllegalStateException
out - the output stream.
CAException - if a Channel Exception occured while performing this operation.
java.lang.IllegalStateExceptionpublic void dispose()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||