Package xal.ca
Class MonitorCache
java.lang.Object
xal.ca.MonitorCache
Connect to, monitor and cache a channel's monitor events.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classHandle connection eventsprotected classHandle monitor events -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Channelthe channel to wrapprotected final ConnectionListenerlistener to handle connection eventsprotected final IEventSinkValTimeProxy which forwards monitor events to registered listeners.protected ChannelTimeRecordlatest monitor eventprotected final MessageCenterMessage center for dispatching monitor events to registered listeners.protected Monitora channel monitorprotected final IEventSinkValTimelistener to handle monitor events -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMonitorListener(IEventSinkValTime listener) Register the listener to receive IEventSinkValTime events from the monitorvoiddispose()Dispose of this wrapper's resources.Get the channel.Get the latest record.booleanDetermine if the channel is connected.voidremoveMonitorListener(IEventSinkValTime listener) Remove the listener from receiving IEventSinkValTime events from this monitorvoidRequest a connection and start the monitor upon connection.
-
Field Details
-
messageCenter
Message center for dispatching monitor events to registered listeners. -
eventProxy
Proxy which forwards monitor events to registered listeners. -
channel
the channel to wrap -
connectionHandler
listener to handle connection events -
monitorEventHandler
listener to handle monitor events -
monitor
a channel monitor -
latestRecord
latest monitor event
-
-
Constructor Details
-
MonitorCache
Constructor- Parameters:
channel- to monitor
-
-
Method Details
-
dispose
public void dispose()Dispose of this wrapper's resources. -
addMonitorListener
Register the listener to receive IEventSinkValTime events from the monitor- Parameters:
listener- to receive events
-
removeMonitorListener
Remove the listener from receiving IEventSinkValTime events from this monitor- Parameters:
listener- to remove from receiving events
-
requestMonitor
public void requestMonitor()Request a connection and start the monitor upon connection. -
getChannel
Get the channel.- Returns:
- wrapped channel
-
isConnected
public boolean isConnected()Determine if the channel is connected.- Returns:
- true if the channel is connected and false if not
-
getLatestRecord
Get the latest record.- Returns:
- latest record
-