public class RefCountedMonitor extends Object implements gov.aps.jca.event.MonitorListener
RefCountedMonitor is a monitor reference, which uses a single channel access monitor subscription for
many different listeners. This object should be created for the first requested subscription for specific channel and
of specific type. Or later creation should reference the same cached object. When all channels unsubscribe this
reference should be disposed of as well.| Constructor and Description |
|---|
RefCountedMonitor(gov.aps.jca.Channel channel,
gov.aps.jca.dbr.DBRType type,
int mask,
String name)
Creates a new reference monitor for the given channel of the given type.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMonitorListener(gov.aps.jca.event.MonitorListener listener)
Adds a listener to this monitor.
|
int |
decRefs()
Decrement reference count.
|
void |
dispose()
Dispose of this reference.
|
String |
getName() |
void |
incRefs()
Increment reference count.
|
void |
monitorChanged(gov.aps.jca.event.MonitorEvent ev) |
void |
removeMonitorListener(gov.aps.jca.event.MonitorListener listener)
Removes the listener from this reference.
|
public RefCountedMonitor(gov.aps.jca.Channel channel,
gov.aps.jca.dbr.DBRType type,
int mask,
String name)
throws gov.aps.jca.CAException
channel - the channel to subscribe totype - the data type for the subscriptionmask - the monitor maskname - the name of this reference used for cachingIllegalStateException - if creation of subscription failedgov.aps.jca.CAException - if creation of subscription failedpublic void addMonitorListener(gov.aps.jca.event.MonitorListener listener)
listener - the listener to addpublic void removeMonitorListener(gov.aps.jca.event.MonitorListener listener)
listener - the listener to removepublic void dispose()
throws gov.aps.jca.CAException
gov.aps.jca.CAException - if the monitor is still referenced by a PVpublic void incRefs()
public int decRefs()
public void monitorChanged(gov.aps.jca.event.MonitorEvent ev)
monitorChanged in interface gov.aps.jca.event.MonitorListenerpublic String getName()
Copyright © 2023 European Spallation Source. All rights reserved.