public class MonitorCache
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
MonitorCache.ConnectionEventHandler
Handle connection events
|
protected class |
MonitorCache.MonitorEventHandler
Handle monitor events
|
Modifier and Type | Field and Description |
---|---|
protected Channel |
_channel
the channel to wrap
|
protected ConnectionListener |
_connectionHandler
listener to handle connection events
|
protected IEventSinkValTime |
_eventProxy
Proxy which forwards monitor events to registered listeners.
|
protected ChannelTimeRecord |
_latestRecord
latest monitor event
|
protected MessageCenter |
_messageCenter
Message center for dispatching monitor events to registered listeners.
|
protected Monitor |
_monitor
a channel monitor
|
protected IEventSinkValTime |
_monitorEventHandler
listener to handle monitor events
|
Constructor and Description |
---|
MonitorCache(Channel channel)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addMonitorListener(IEventSinkValTime listener)
Register the listener to receive IEventSinkValTime events from the monitor
|
void |
dispose()
Dispose of this wrapper's resources.
|
Channel |
getChannel()
Get the channel.
|
ChannelTimeRecord |
getLatestRecord()
Get the latest record.
|
boolean |
isConnected()
Determine if the channel is connected.
|
void |
removeMonitorListener(IEventSinkValTime listener)
Remove the listener from receiving IEventSinkValTime events from this monitor
|
void |
requestMonitor()
Request a connection and start the monitor upon connection.
|
protected final MessageCenter _messageCenter
protected final IEventSinkValTime _eventProxy
protected final Channel _channel
protected final ConnectionListener _connectionHandler
protected final IEventSinkValTime _monitorEventHandler
protected Monitor _monitor
protected volatile ChannelTimeRecord _latestRecord
public MonitorCache(Channel channel)
channel
- to monitorpublic void dispose()
public void addMonitorListener(IEventSinkValTime listener)
listener
- to receive eventspublic void removeMonitorListener(IEventSinkValTime listener)
listener
- to remove from receiving eventspublic void requestMonitor()
public Channel getChannel()
public boolean isConnected()
public ChannelTimeRecord getLatestRecord()