gov.sns.ca
Class Monitor

java.lang.Object
  |
  +--gov.sns.ca.Monitor
Direct Known Subclasses:
JcaMonitor

public abstract class Monitor
extends java.lang.Object

Monitor


Field Summary
static int ALARM
          The monitor is triggered when the PV alarm state change.
static int LOG
          The monitor is triggered when the PV log value change.
protected  boolean m_bolMonitoring
           
protected  int m_intMaskEvent
           
protected  Channel m_xalChan
           
static int VALUE
          The monitor is triggered when the PV value change.
 
Constructor Summary
protected Monitor(Channel chan, int intMaskEvent)
          Creates new Monitor
 
Method Summary
protected abstract  void begin()
          Start the channel monitoring
abstract  void clear()
          Stop the monitoring of PV
protected  void finalize()
          Make sure monitoring is shut down before destruction
 Channel getChannel()
          Return the associated Channel object
protected  void post(IEventSinkValStatus listener, StatusAdaptor adaptor)
          Post the value-status record to the listener.
protected  void post(IEventSinkValTime listener, TimeAdaptor adaptor)
          Post the value-status-timestamp record to the listener.
protected  void post(IEventSinkValue listener, ValueAdaptor adaptor)
          Post the value record to the listener.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALUE

public static final int VALUE
The monitor is triggered when the PV value change.

See Also:
Constant Field Values

LOG

public static final int LOG
The monitor is triggered when the PV log value change.

See Also:
Constant Field Values

ALARM

public static final int ALARM
The monitor is triggered when the PV alarm state change.

See Also:
Constant Field Values

m_bolMonitoring

protected boolean m_bolMonitoring

m_intMaskEvent

protected int m_intMaskEvent

m_xalChan

protected Channel m_xalChan
Constructor Detail

Monitor

protected Monitor(Channel chan,
                  int intMaskEvent)
           throws ConnectionException
Creates new Monitor

Parameters:
chan - Channel object to monitor
intMaskEvent - code specifying when monitor event is fired
Throws:
ConnectionException - Channel is not connected
Method Detail

clear

public abstract void clear()
Stop the monitoring of PV


getChannel

public Channel getChannel()
Return the associated Channel object

Returns:
channel being monitored

begin

protected abstract void begin()
                       throws MonitorException
Start the channel monitoring

Throws:
MonitorException - unable to setup the channel access monitor

finalize

protected void finalize()
Make sure monitoring is shut down before destruction

Overrides:
finalize in class java.lang.Object

post

protected final void post(IEventSinkValue listener,
                          ValueAdaptor adaptor)
Post the value record to the listener.

Parameters:
listener - The object receiving the monitor record.
adaptor - The adaptor to the internal data record.

post

protected final void post(IEventSinkValStatus listener,
                          StatusAdaptor adaptor)
Post the value-status record to the listener.

Parameters:
listener - The object receiving the monitor record.
adaptor - The adaptor to the internal data record.

post

protected final void post(IEventSinkValTime listener,
                          TimeAdaptor adaptor)
Post the value-status-timestamp record to the listener.

Parameters:
listener - The object receiving the monitor record.
adaptor - The adaptor to the internal data record.