Package gov.aps.jca
Class Channel
- java.lang.Object
-
- gov.aps.jca.Channel
-
- Direct Known Subclasses:
CAJChannel
public abstract class Channel extends Object
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); }- See Also:
Context
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classChannel.ConnectionStateEnumeration class representing the Channel's connection state.
-
Field Summary
Fields Modifier and Type Field Description static Channel.ConnectionStateCLOSEDChannel has been closed and destroyed.static Channel.ConnectionStateCONNECTEDChannel is connected.static Channel.ConnectionStateDISCONNECTEDChannel is disconnected.static Channel.ConnectionStateNEVER_CONNECTEDChannel has never been connected.static shortPRIORITY_ARCHIVEArchive priority.static shortPRIORITY_DEFAULTDefault priority.static shortPRIORITY_LINKS_DBDB links priority.static shortPRIORITY_MAXMaximal priority.static shortPRIORITY_MINMinimal priority.static shortPRIORITY_OPIOPI priority.
-
Constructor Summary
Constructors Constructor Description Channel()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidaddAccessRightsListener(AccessRightsListener l)Adds a AccessRightsListener which will be notified of the access rights's changes of this Channel.abstract voidaddConnectionListener(ConnectionListener l)Adds a ConnectionListener which will be notified of the connection state's changes of this Channel.MonitoraddMonitor(int mask)Add a monitor to this channel using the channel's native DBR type and count.MonitoraddMonitor(int mask, MonitorListener l)Add a monitor to this channel using the channel's native DBR type and count.MonitoraddMonitor(DBRType type, int count, int mask)Add a monitor to this channel.abstract MonitoraddMonitor(DBRType type, int count, int mask, MonitorListener l)Adds a monitor to this Channel.protected voidcheckMonitorSize(DBRType type, int count, int maxArrayBytes)Checks whether the size of this monitor is greater than maxArrayBytes, and throws an exception if it is.abstract voiddestroy()Clear the ressources used by this channel.voiddispose()DBRget()Synchronously reads this Channel's value using the native DBR type and count.DBRget(int count)Synchronously Reads a specified number elements from this Channel value using the native DBR type.voidget(int count, GetListener l)Asynchronously Reads a specified number from this Channel's value using the native DBR type.abstract DBRget(DBRType type, int count)Synchronously Reads a specified number of elements of a specified type from this Channel.abstract voidget(DBRType type, int count, GetListener l)Asynchronously reads a specified number of elements of a specified type from this Channelvoidget(GetListener l)Asynchronously reads this Channel's value using the native DBR type and count.abstract AccessRightsListener[]getAccessRightsListeners()Returns the AccessRightsListeners registered with this channel.abstract ConnectionListener[]getConnectionListeners()Returns the ConnectionListeners registered with this channel.abstract Channel.ConnectionStategetConnectionState()Returns the connection state of this channel.abstract ContextgetContext()Returns the context which created this channel.abstract intgetElementCount()Returns the element count of this channel.abstract DBRTypegetFieldType()Returns the DBR type of this Channel.abstract StringgetHostName()Returns the Channel's hostname.abstract StringgetName()Returns the name of this channel.abstract booleangetReadAccess()Returns whether read operations are allowed on this Channel.abstract booleangetWriteAccess()Returns whether write operations are allowed on this Channel.voidprintInfo()Prints details information about this Channel to the standard output stream.voidprintInfo(PrintStream out)Prints details information about this Channel to the specified output stream.voidput(byte value)Synchronously writes a value to this Channel.abstract voidput(byte[] value)Synchronously writes an array to this Channel.abstract voidput(byte[] value, PutListener l)Asynchronously writes an array to this Channel.voidput(byte value, PutListener l)Asynchronously writes a value to this Channel.voidput(double value)Synchronously writes a value to this Channel.abstract voidput(double[] value)Synchronously writes an array to this Channel.abstract voidput(double[] value, PutListener l)Asynchronously writes an array to this Channel.voidput(double value, PutListener l)Asynchronously writes a value to this Channel.voidput(float value)Synchronously writes a value to this Channel.abstract voidput(float[] value)Synchronously writes an array to this Channel.abstract voidput(float[] value, PutListener l)Asynchronously writes an array to this Channel.voidput(float value, PutListener l)Asynchronously writes a value to this Channel.voidput(int value)Synchronously writes a value to this Channel.abstract voidput(int[] value)Synchronously writes an array to this Channel.abstract voidput(int[] value, PutListener l)Asynchronously writes an array to this Channel.voidput(int value, PutListener l)Asynchronously writes a value to this Channel.voidput(short value)Synchronously writes a value to this Channel.abstract voidput(short[] value)Synchronously writes an array to this Channel.abstract voidput(short[] value, PutListener l)Asynchronously writes an array to this Channel.voidput(short value, PutListener l)Asynchronously writes a value to this Channel.voidput(String value)Synchronously writes a value to this Channel.abstract voidput(String[] value)Synchronously writes an array to this Channel.abstract voidput(String[] value, PutListener l)Asynchronously writes an array to this Channel.voidput(String value, PutListener l)Asynchronously writes a value to this Channel.abstract voidputACKS(Severity severity)Synchronously writes an Alarm Acknowledge Severity value to this Channel.abstract voidputACKS(Severity severity, PutListener l)Asynchronously writes an Alarm Acknowledge Severity value to this Channel.abstract voidputACKT(boolean value)Synchronously writes an Alarm Acknowledge Transient value to this Channel.abstract voidputACKT(boolean value, PutListener l)Asynchronously writes an Alarm Acknowledge Transient value to this Channel.abstract voidremoveAccessRightsListener(AccessRightsListener l)Removes a AccessRightsListener which will be notified of the access rights's changes of this Channel.abstract voidremoveConnectionListener(ConnectionListener l)Removes a ConnectionListener .
-
-
-
Field Detail
-
NEVER_CONNECTED
public static final Channel.ConnectionState NEVER_CONNECTED
Channel has never been connected.
-
DISCONNECTED
public static final Channel.ConnectionState DISCONNECTED
Channel is disconnected.
-
CONNECTED
public static final Channel.ConnectionState CONNECTED
Channel is connected.
-
CLOSED
public static final Channel.ConnectionState CLOSED
Channel has been closed and destroyed.
-
PRIORITY_MIN
public static final short PRIORITY_MIN
Minimal priority.- See Also:
- Constant Field Values
-
PRIORITY_MAX
public static final short PRIORITY_MAX
Maximal priority.- See Also:
- Constant Field Values
-
PRIORITY_DEFAULT
public static final short PRIORITY_DEFAULT
Default priority.- See Also:
- Constant Field Values
-
PRIORITY_LINKS_DB
public static final short PRIORITY_LINKS_DB
DB links priority.- See Also:
- Constant Field Values
-
PRIORITY_ARCHIVE
public static final short PRIORITY_ARCHIVE
Archive priority.- See Also:
- Constant Field Values
-
PRIORITY_OPI
public static final short PRIORITY_OPI
OPI priority.- See Also:
- Constant Field Values
-
-
Method Detail
-
getContext
public abstract Context getContext() throws IllegalStateException
Returns the context which created this channel.- Returns:
- the context
- Throws:
IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
destroy
public abstract void destroy() throws CAException, IllegalStateExceptionClear the ressources used by this channel. No further access should be made to a channel after it has been destroyed.- Throws:
IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)CAException
-
getConnectionListeners
public abstract ConnectionListener[] getConnectionListeners() throws IllegalStateException
Returns the ConnectionListeners registered with this channel.- Returns:
- an array containing the ConnectionListeners.
- Throws:
IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
addConnectionListener
public abstract void addConnectionListener(ConnectionListener l) throws CAException, IllegalStateException
Adds a ConnectionListener which will be notified of the connection state's changes of this Channel.- Parameters:
l- the ConnectionListener to register.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
removeConnectionListener
public abstract void removeConnectionListener(ConnectionListener l) throws CAException, IllegalStateException
Removes a ConnectionListener .- Parameters:
l- the ConnectionListener to remove.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
getAccessRightsListeners
public abstract AccessRightsListener[] getAccessRightsListeners() throws IllegalStateException
Returns the AccessRightsListeners registered with this channel.- Returns:
- an array containing the AccessRightsListeners.
- Throws:
IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
addAccessRightsListener
public abstract void addAccessRightsListener(AccessRightsListener l) throws CAException, IllegalStateException
Adds a AccessRightsListener which will be notified of the access rights's changes of this Channel.- Parameters:
l- the ConnectionListener to register.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
removeAccessRightsListener
public abstract void removeAccessRightsListener(AccessRightsListener l) throws CAException, IllegalStateException
Removes a AccessRightsListener which will be notified of the access rights's changes of this Channel.- Parameters:
l- the ConnectionListener to remove.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
getName
public abstract String getName() throws IllegalStateException
Returns the name of this channel.- Returns:
- the name of this Channel.
- Throws:
IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
getFieldType
public abstract DBRType getFieldType() throws IllegalStateException
Returns the DBR type of this Channel.- Returns:
- the DBR type.
- Throws:
IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
DBR
-
getElementCount
public abstract int getElementCount() throws IllegalStateExceptionReturns the element count of this channel.- Returns:
- the element count.
- Throws:
IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
getConnectionState
public abstract Channel.ConnectionState getConnectionState() throws IllegalStateException
Returns the connection state of this channel.- Returns:
- the ConnectionState value.
- Throws:
IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Channel.ConnectionState
-
getHostName
public abstract String getHostName() throws IllegalStateException
Returns the Channel's hostname.- Returns:
- the hostname.
- Throws:
IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
getReadAccess
public abstract boolean getReadAccess() throws IllegalStateExceptionReturns whether read operations are allowed on this Channel.- Returns:
- true is read operations are allowed, false otherwise.
- Throws:
IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
getWriteAccess
public abstract boolean getWriteAccess() throws IllegalStateExceptionReturns whether write operations are allowed on this Channel.- Returns:
- true is write operations are allowed, false otherwise.
- Throws:
IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public void put(byte value) throws CAException, IllegalStateExceptionSynchronously writes a value to this Channel.- Parameters:
value- the value.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public void put(byte value, PutListener l) throws CAException, IllegalStateExceptionAsynchronously writes a value to this Channel.- Parameters:
value- the value.l- the PutListener to notify when the request has been completed.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public void put(short value) throws CAException, IllegalStateExceptionSynchronously writes a value to this Channel.- Parameters:
value- the value.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public void put(short value, PutListener l) throws CAException, IllegalStateExceptionAsynchronously writes a value to this Channel.- Parameters:
value- the value.l- the PutListener to notify when the request has been completed.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public void put(int value) throws CAException, IllegalStateExceptionSynchronously writes a value to this Channel.- Parameters:
value- the value.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public void put(int value, PutListener l) throws CAException, IllegalStateExceptionAsynchronously writes a value to this Channel.- Parameters:
value- the value.l- the PutListener to notify when the request has been completed.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public void put(float value) throws CAException, IllegalStateExceptionSynchronously writes a value to this Channel.- Parameters:
value- the value.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public void put(float value, PutListener l) throws CAException, IllegalStateExceptionAsynchronously writes a value to this Channel.- Parameters:
value- the value.l- the PutListener to notify when the request has been completed.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public void put(double value) throws CAException, IllegalStateExceptionSynchronously writes a value to this Channel.- Parameters:
value- the value.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public void put(double value, PutListener l) throws CAException, IllegalStateExceptionAsynchronously writes a value to this Channel.- Parameters:
value- the value.l- the PutListener to notify when the request has been completed.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public void put(String value) throws CAException, IllegalStateException
Synchronously writes a value to this Channel.- Parameters:
value- the value.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public void put(String value, PutListener l) throws CAException, IllegalStateException
Asynchronously writes a value to this Channel.- Parameters:
value- the value.l- the PutListener to notify when the request has been completed.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public abstract void put(byte[] value) throws CAException, IllegalStateExceptionSynchronously writes an array to this Channel.- Parameters:
value- the value.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public abstract void put(byte[] value, PutListener l) throws CAException, IllegalStateExceptionAsynchronously writes an array to this Channel.- Parameters:
value- the value.l- the PutListener to notify when the request has been completed.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public abstract void put(short[] value) throws CAException, IllegalStateExceptionSynchronously writes an array to this Channel.- Parameters:
value- the value.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public abstract void put(short[] value, PutListener l) throws CAException, IllegalStateExceptionAsynchronously writes an array to this Channel.- Parameters:
value- the value.l- the PutListener to notify when the request has been completed.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public abstract void put(int[] value) throws CAException, IllegalStateExceptionSynchronously writes an array to this Channel.- Parameters:
value- the value.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public abstract void put(int[] value, PutListener l) throws CAException, IllegalStateExceptionAsynchronously writes an array to this Channel.- Parameters:
value- the value.l- the PutListener to notify when the request has been completed.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public abstract void put(float[] value) throws CAException, IllegalStateExceptionSynchronously writes an array to this Channel.- Parameters:
value- the value.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public abstract void put(float[] value, PutListener l) throws CAException, IllegalStateExceptionAsynchronously writes an array to this Channel.- Parameters:
value- the value.l- the PutListener to notify when the request has been completed.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public abstract void put(double[] value) throws CAException, IllegalStateExceptionSynchronously writes an array to this Channel.- Parameters:
value- the value.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public abstract void put(double[] value, PutListener l) throws CAException, IllegalStateExceptionAsynchronously writes an array to this Channel.- Parameters:
value- the value.l- the PutListener to notify when the request has been completed.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public abstract void put(String[] value) throws CAException, IllegalStateException
Synchronously writes an array to this Channel.- Parameters:
value- the value.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
put
public abstract void put(String[] value, PutListener l) throws CAException, IllegalStateException
Asynchronously writes an array to this Channel.- Parameters:
value- the value.l- the PutListener to notify when the request has been completed.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
putACKT
public abstract void putACKT(boolean value) throws CAException, IllegalStateExceptionSynchronously writes an Alarm Acknowledge Transient value to this Channel.- Parameters:
value- the value,trueequals YES andfalseequals NO.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
putACKT
public abstract void putACKT(boolean value, PutListener l) throws CAException, IllegalStateExceptionAsynchronously writes an Alarm Acknowledge Transient value to this Channel.- Parameters:
value- the value,trueequals YES andfalseequals NO.l- the PutListener to notify when the request has been completed.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
putACKS
public abstract void putACKS(Severity severity) throws CAException, IllegalStateException
Synchronously writes an Alarm Acknowledge Severity value to this Channel.- Parameters:
severity- to acknowledge.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
putACKS
public abstract void putACKS(Severity severity, PutListener l) throws CAException, IllegalStateException
Asynchronously writes an Alarm Acknowledge Severity value to this Channel.- Parameters:
severity- to acknowledge.l- the PutListener to notify when the request has been completed.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
get
public DBR get() throws CAException, IllegalStateException
Synchronously reads this Channel's value using the native DBR type and count.- Returns:
- the channel's value.
- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
get
public void get(GetListener l) throws CAException, IllegalStateException
Asynchronously reads this Channel's value using the native DBR type and count.- Parameters:
l- the GetListener to notify when the request has been completed.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
get
public DBR get(int count) throws CAException, IllegalStateException
Synchronously Reads a specified number elements from this Channel value using the native DBR type.- Parameters:
count- the number of element to read.- Returns:
- the channel's value.
- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
get
public void get(int count, GetListener l) throws CAException, IllegalStateExceptionAsynchronously Reads a specified number from this Channel's value using the native DBR type.- Parameters:
count- the number of element to read.l- the GetListener to notify when the request has been completed.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
get
public abstract DBR get(DBRType type, int count) throws CAException, IllegalStateException
Synchronously Reads a specified number of elements of a specified type from this Channel.- Parameters:
type- the DBR type to read.count- the number of element to read.- Returns:
- the channel's value.
- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
get
public abstract void get(DBRType type, int count, GetListener l) throws CAException, IllegalStateException
Asynchronously reads a specified number of elements of a specified type from this Channel- Parameters:
type- the DBR type.count- the number of element to read.l- the GetListener to notify when the request has been completed.- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
addMonitor
public Monitor addMonitor(int mask) throws CAException, IllegalStateException
Add a monitor to this channel using the channel's native DBR type and count.- Parameters:
mask- the mask value indicating when the listener need to be notified.- Returns:
- the Monitor object representing this monitor.
- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
addMonitor
public Monitor addMonitor(int mask, MonitorListener l) throws CAException, IllegalStateException
Add a monitor to this channel using the channel's native DBR type and count.- Parameters:
mask- the mask value indicating when the listener need to be notified.l- a MonitorListener to be notified when the value/log/alarm changed.- Returns:
- the Monitor object representing this monitor.
- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Monitor
-
addMonitor
public Monitor addMonitor(DBRType type, int count, int mask) throws CAException, IllegalStateException
Add a monitor to this channel.- Parameters:
type- the monitor's type.count- the monitor's element count.mask- the mask value indicating when the listener need to be notified.- Returns:
- the Monitor object representing this monitor.
- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
addMonitor
public abstract Monitor addMonitor(DBRType type, int count, int mask, MonitorListener l) throws CAException, IllegalStateException
Adds a monitor to this Channel.- Parameters:
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.- Returns:
- the Monitor object representing this monitor.
- Throws:
CAException- if a Channel Exception occured while performing this operation.IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)- See Also:
Monitor
-
checkMonitorSize
protected void checkMonitorSize(DBRType type, int count, int maxArrayBytes)
Checks whether the size of this monitor is greater than maxArrayBytes, and throws an exception if it is.- Parameters:
type- type for the monitorcount- size of the monitormaxArrayBytes- maximum size of the array
-
printInfo
public void printInfo() throws IllegalStateExceptionPrints details information about this Channel to the standard output stream.- Throws:
IllegalStateException- if the channel is in no state to perform this operation (ie destroyed, etc...)
-
printInfo
public void printInfo(PrintStream out) throws IllegalStateException
Prints details information about this Channel to the specified output stream.- Parameters:
out- the output stream.- Throws:
IllegalStateException
-
dispose
public void dispose()
-
-