Package gov.aps.jca

Class 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 class  Channel.ConnectionState
      Enumeration class representing the Channel's connection state.
    • Constructor Summary

      Constructors 
      Constructor Description
      Channel()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      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​(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.
      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.
      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.
      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.
      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 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.
      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 String getHostName()
      Returns the Channel's hostname.
      abstract 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​(PrintStream out)
      Prints details information about this Channel to the specified output stream.
      void put​(byte value)
      Synchronously writes a value to this Channel.
      abstract void put​(byte[] value)
      Synchronously writes an array to this Channel.
      abstract void put​(byte[] value, PutListener l)
      Asynchronously writes an array to this Channel.
      void put​(byte value, PutListener l)
      Asynchronously writes a value to this Channel.
      void put​(double value)
      Synchronously writes a value to this Channel.
      abstract void put​(double[] value)
      Synchronously writes an array to this Channel.
      abstract void put​(double[] value, PutListener l)
      Asynchronously writes an array to this Channel.
      void put​(double value, PutListener l)
      Asynchronously writes a value to this Channel.
      void put​(float value)
      Synchronously writes a value to this Channel.
      abstract void put​(float[] value)
      Synchronously writes an array to this Channel.
      abstract void put​(float[] value, PutListener l)
      Asynchronously writes an array to this Channel.
      void put​(float value, PutListener l)
      Asynchronously writes a value to this Channel.
      void put​(int value)
      Synchronously writes a value to this Channel.
      abstract void put​(int[] value)
      Synchronously writes an array to this Channel.
      abstract void put​(int[] value, PutListener l)
      Asynchronously writes an array to this Channel.
      void put​(int value, PutListener l)
      Asynchronously writes a value to this Channel.
      void put​(short value)
      Synchronously writes a value to this Channel.
      abstract void put​(short[] value)
      Synchronously writes an array to this Channel.
      abstract void put​(short[] value, PutListener l)
      Asynchronously writes an array to this Channel.
      void put​(short value, PutListener l)
      Asynchronously writes a value to this Channel.
      void put​(String value)
      Synchronously writes a value to this Channel.
      abstract void put​(String[] value)
      Synchronously writes an array to this Channel.
      abstract void put​(String[] value, PutListener l)
      Asynchronously writes an array to this Channel.
      void put​(String value, PutListener l)
      Asynchronously writes a value to this Channel.
      abstract void putACKS​(Severity severity)
      Synchronously writes an Alarm Acknowledge Severity value to this Channel.
      abstract void putACKS​(Severity severity, PutListener l)
      Asynchronously writes an Alarm Acknowledge Severity value to this Channel.
      abstract void putACKT​(boolean value)
      Synchronously writes an Alarm Acknowledge Transient value to this Channel.
      abstract void putACKT​(boolean value, PutListener l)
      Asynchronously writes an Alarm Acknowledge Transient 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 .
    • Constructor Detail

      • Channel

        public Channel()
    • 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,
                                     IllegalStateException
        Clear 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 IllegalStateException
        Returns 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...)
      • 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 IllegalStateException
        Returns 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 IllegalStateException
        Returns 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,
                        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​(byte 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 void put​(short 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​(short 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 void put​(int 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​(int 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 void put​(float 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​(float 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 void put​(double 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​(double 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 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,
                                 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​(byte[] 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...)
      • put

        public abstract void put​(short[] 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​(short[] 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...)
      • put

        public abstract void put​(int[] 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​(int[] 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...)
      • put

        public abstract void put​(float[] 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​(float[] 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...)
      • put

        public abstract void put​(double[] 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​(double[] 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...)
      • 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,
                                     IllegalStateException
        Synchronously writes an Alarm Acknowledge Transient value to this Channel.
        Parameters:
        value - the value, true equals YES and false equals 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,
                                     IllegalStateException
        Asynchronously writes an Alarm Acknowledge Transient value to this Channel.
        Parameters:
        value - the value, true equals YES and false equals 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,
                        IllegalStateException
        Asynchronously 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 monitor
        count - size of the monitor
        maxArrayBytes - maximum size of the array
      • printInfo

        public void printInfo()
                       throws IllegalStateException
        Prints 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...)
      • dispose

        public void dispose()