public class ChannelMonitor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected ConnectionListener |
_connectionListener
connection listener
|
protected ChannelTimeRecord |
_lastRecord
last record captured
|
protected Monitor |
_monitor
event monitor
|
protected Channel |
CHANNEL
PV channel
|
protected java.lang.Object |
EVENT_LOCK
synchronization lock
|
protected ChannelEventListener |
EVENT_PROXY
proxy for posting channel events
|
protected MessageCenter |
MESSAGE_CENTER
event message center
|
protected TripFilter |
TRIP_FILTER
trip filter
|
Constructor and Description |
---|
ChannelMonitor(java.lang.String pv,
TripFilter tripFilter)
constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addChannelEventListener(ChannelEventListener listener)
Register the listener as a receiver of channel events from the wrapped channel
|
protected void |
clearTrips()
clear the trip count
|
void |
dispose()
Dispose of the channel wrapper resources by clearing the monitor (if any) and disposing of the messaging resources.
|
Channel |
getChannel()
Get the wrapped channel.
|
ChannelTimeRecord |
getLatestRecord()
Get the latest record
|
java.lang.String |
getPV()
Get the PV for the channel being wrapped.
|
boolean |
isConnected()
Determine if the channel is connected.
|
protected void |
makeMonitor()
Create a monitor to listen for new channel records.
|
protected void |
processMonitorEvent(ChannelTimeRecord oldRecord,
ChannelTimeRecord record)
Process the new monitor event
|
void |
removeChannelEventListener(ChannelEventListener listener)
Unregister the listener as a receiver of channel events from the wrapped channel
|
void |
requestConnection()
Request that the channel be connected.
|
java.lang.String |
toString()
get a description of this channel monitor
|
protected final java.lang.Object EVENT_LOCK
protected final MessageCenter MESSAGE_CENTER
protected final ChannelEventListener EVENT_PROXY
protected final Channel CHANNEL
protected final TripFilter TRIP_FILTER
protected Monitor _monitor
protected ChannelTimeRecord _lastRecord
protected ConnectionListener _connectionListener
public ChannelMonitor(java.lang.String pv, TripFilter tripFilter)
public void addChannelEventListener(ChannelEventListener listener)
listener
- The listener to receive channel eventspublic void removeChannelEventListener(ChannelEventListener listener)
listener
- The listener to unregister from receiving channel eventspublic java.lang.String getPV()
public Channel getChannel()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isConnected()
public ChannelTimeRecord getLatestRecord()
protected void processMonitorEvent(ChannelTimeRecord oldRecord, ChannelTimeRecord record)
record
- the new record from which to get the latest value to test for a tripoldRecord
- the old record which preceeds the new recordprotected void clearTrips()
public void requestConnection()
protected void makeMonitor()
public void dispose()