public class PVAChannelHandler extends MultiplexedChannelHandler<Object,gov.aps.jca.event.MonitorEvent>
Modifier and Type | Field and Description |
---|---|
protected org.epics.pvData.monitor.MonitorRequester |
monitorRequester |
Constructor and Description |
---|
PVAChannelHandler(String channelName,
org.epics.ca.impl.remote.Context pvaContext,
short priority) |
Modifier and Type | Method and Description |
---|---|
void |
addMonitor(ChannelHandlerReadSubscription subscription)
Used by the data source to add a read request on the channel managed
by this handler.
|
void |
connect()
Used by the handler to open the connection.
|
void |
disconnect()
Used by the handler to close the connection.
|
protected DataSourceTypeAdapter<Object,gov.aps.jca.event.MonitorEvent> |
findTypeAdapter(ValueCache<?> cache,
Object connection)
Finds the right adapter to use for the particular cache given the information
of the channels in the connection payload.
|
boolean |
isConnected(Object obj)
Determines from the payload whether the channel is connected or not.
|
void |
write(Object newValue,
ChannelWriteCallback callback)
Implements a write operation.
|
addWriter, getConnectionPayload, getLastMessagePayload, getReadUsageCounter, getUsageCounter, getWriteUsageCounter, isConnected, processConnection, processMessage, removeMonitor, removeWrite, reportExceptionToAllReadersAndWriters
getChannelName, getProperties
protected final org.epics.pvData.monitor.MonitorRequester monitorRequester
public PVAChannelHandler(String channelName, org.epics.ca.impl.remote.Context pvaContext, short priority)
public void addMonitor(ChannelHandlerReadSubscription subscription)
MultiplexedChannelHandler
addMonitor
in class MultiplexedChannelHandler<Object,gov.aps.jca.event.MonitorEvent>
subscription
- the data required for a subscriptionpublic void connect()
MultiplexedChannelHandler
connect
in class MultiplexedChannelHandler<Object,gov.aps.jca.event.MonitorEvent>
public void disconnect()
MultiplexedChannelHandler
disconnect
in class MultiplexedChannelHandler<Object,gov.aps.jca.event.MonitorEvent>
public void write(Object newValue, ChannelWriteCallback callback)
MultiplexedChannelHandler
write
in class MultiplexedChannelHandler<Object,gov.aps.jca.event.MonitorEvent>
newValue
- new value to be writtencallback
- called when done or on errorpublic boolean isConnected(Object obj)
MultiplexedChannelHandler
By default, this uses the usage counter to determine whether it's connected or not. One should override this to use the actual connection payload to check whether the actual protocol connection has been established.
isConnected
in class MultiplexedChannelHandler<Object,gov.aps.jca.event.MonitorEvent>
obj
- the connection payloadprotected DataSourceTypeAdapter<Object,gov.aps.jca.event.MonitorEvent> findTypeAdapter(ValueCache<?> cache, Object connection)
MultiplexedChannelHandler
DataSourceTypeSupport
as
a good first implementation.findTypeAdapter
in class MultiplexedChannelHandler<Object,gov.aps.jca.event.MonitorEvent>
cache
- the cache that will store the dataconnection
- the connection payloadCopyright © 2012. All Rights Reserved.