public class PVAChannelHandler extends MultiplexedChannelHandler<PVAChannelHandler,org.epics.pvdata.pv.PVStructure> implements org.epics.pvaccess.client.ChannelRequester, org.epics.pvaccess.client.GetFieldRequester, org.epics.pvaccess.client.ChannelPutRequester, org.epics.pvdata.monitor.MonitorRequester
| Constructor and Description |
|---|
PVAChannelHandler(String channelName,
String pvRequestString,
org.epics.pvaccess.client.ChannelProvider channelProvider,
short priority,
PVATypeSupport typeSupport) |
| Modifier and Type | Method and Description |
|---|---|
void |
addReader(ChannelHandlerReadSubscription subscription)
Used by the data source to add a read request on the channel managed
by this handler.
|
void |
channelCreated(org.epics.pvdata.pv.Status status,
org.epics.pvaccess.client.Channel channel) |
void |
channelPutConnect(org.epics.pvdata.pv.Status status,
org.epics.pvaccess.client.ChannelPut channelPut,
org.epics.pvdata.pv.Structure putStructure) |
void |
channelStateChange(org.epics.pvaccess.client.Channel channel,
org.epics.pvaccess.client.Channel.ConnectionState connectionState) |
void |
connect()
Used by the handler to open the connection.
|
static PVAChannelHandler |
create(String channelName,
org.epics.pvaccess.client.ChannelProvider channelProvider,
short priority,
PVATypeSupport typeSupport) |
void |
disconnect()
Used by the handler to close the connection.
|
protected PVATypeAdapter |
findTypeAdapter(ValueCache<?> cache,
PVAChannelHandler connection)
Finds the right adapter to use for the particular cache given the information
of the channels in the connection payload.
|
org.epics.pvaccess.client.Channel |
getChannel() |
org.epics.pvdata.pv.Field |
getChannelType() |
void |
getDone(org.epics.pvdata.pv.Status status,
org.epics.pvaccess.client.ChannelPut channelPut,
org.epics.pvdata.pv.PVStructure pvStructure,
org.epics.pvdata.misc.BitSet bitSet) |
void |
getDone(org.epics.pvdata.pv.Status status,
org.epics.pvdata.pv.Field field) |
String |
getExtractFieldName() |
Map<String,Object> |
getProperties()
Returns extra information about the channel, typically
useful for debugging.
|
String |
getRequesterName() |
boolean |
isConnected(PVAChannelHandler channel)
Determines from the payload whether the channel is connected or not.
|
protected boolean |
isWriteConnected(PVAChannelHandler channel)
Determines from the payload whether the channel can be written to.
|
void |
message(String message,
org.epics.pvdata.pv.MessageType messageType) |
void |
monitorConnect(org.epics.pvdata.pv.Status status,
org.epics.pvdata.monitor.Monitor monitor,
org.epics.pvdata.pv.Structure structure) |
void |
monitorEvent(org.epics.pvdata.monitor.Monitor monitor) |
void |
putDone(org.epics.pvdata.pv.Status status,
org.epics.pvaccess.client.ChannelPut channePut) |
static Level |
toLoggerLevel(org.epics.pvdata.pv.MessageType messageType)
Converts MessageType to Java Logging API Level.
|
String |
toString() |
void |
unlisten(org.epics.pvdata.monitor.Monitor monitor) |
void |
write(Object newValue,
ChannelWriteCallback callback)
Implements a write operation.
|
addWriter, getConnectionPayload, getLastMessagePayload, getReadUsageCounter, getUsageCounter, getWriteUsageCounter, isConnected, isWriteConnected, processConnection, processMessage, removeReader, removeWrite, reportExceptionToAllReadersAndWriters, reportExceptionToAllWriters, resetMessage, saveMessageAfterDisconnect, setProcessMessageOnDisconnect, setProcessMessageOnReconnectgetChannelNamepublic PVAChannelHandler(String channelName, String pvRequestString, org.epics.pvaccess.client.ChannelProvider channelProvider, short priority, PVATypeSupport typeSupport)
public static PVAChannelHandler create(String channelName, org.epics.pvaccess.client.ChannelProvider channelProvider, short priority, PVATypeSupport typeSupport)
public org.epics.pvaccess.client.Channel getChannel()
public org.epics.pvdata.pv.Field getChannelType()
public String getExtractFieldName()
public String getRequesterName()
getRequesterName in interface org.epics.pvdata.pv.Requesterpublic void message(String message, org.epics.pvdata.pv.MessageType messageType)
message in interface org.epics.pvdata.pv.Requesterpublic static Level toLoggerLevel(org.epics.pvdata.pv.MessageType messageType)
messageType - pvData message type.public void connect()
MultiplexedChannelHandlerconnect in class MultiplexedChannelHandler<PVAChannelHandler,org.epics.pvdata.pv.PVStructure>public void channelCreated(org.epics.pvdata.pv.Status status,
org.epics.pvaccess.client.Channel channel)
channelCreated in interface org.epics.pvaccess.client.ChannelRequesterpublic void channelStateChange(org.epics.pvaccess.client.Channel channel,
org.epics.pvaccess.client.Channel.ConnectionState connectionState)
channelStateChange in interface org.epics.pvaccess.client.ChannelRequesterpublic void getDone(org.epics.pvdata.pv.Status status,
org.epics.pvdata.pv.Field field)
getDone in interface org.epics.pvaccess.client.GetFieldRequesterpublic boolean isConnected(PVAChannelHandler channel)
MultiplexedChannelHandlerBy 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<PVAChannelHandler,org.epics.pvdata.pv.PVStructure>channel - the connection payloadprotected boolean isWriteConnected(PVAChannelHandler channel)
MultiplexedChannelHandlerBy default, this always return false. One should override this if it's implementing a write-able data source.
isWriteConnected in class MultiplexedChannelHandler<PVAChannelHandler,org.epics.pvdata.pv.PVStructure>channel - connection payload; not nullpublic Map<String,Object> getProperties()
ChannelHandlergetProperties in class ChannelHandlerpublic void disconnect()
MultiplexedChannelHandlerdisconnect in class MultiplexedChannelHandler<PVAChannelHandler,org.epics.pvdata.pv.PVStructure>public void write(Object newValue, ChannelWriteCallback callback)
ChannelHandlerwrite in class MultiplexedChannelHandler<PVAChannelHandler,org.epics.pvdata.pv.PVStructure>newValue - new value to be writtencallback - called when done or on errorpublic void channelPutConnect(org.epics.pvdata.pv.Status status,
org.epics.pvaccess.client.ChannelPut channelPut,
org.epics.pvdata.pv.Structure putStructure)
channelPutConnect in interface org.epics.pvaccess.client.ChannelPutRequesterpublic void putDone(org.epics.pvdata.pv.Status status,
org.epics.pvaccess.client.ChannelPut channePut)
putDone in interface org.epics.pvaccess.client.ChannelPutRequesterpublic void getDone(org.epics.pvdata.pv.Status status,
org.epics.pvaccess.client.ChannelPut channelPut,
org.epics.pvdata.pv.PVStructure pvStructure,
org.epics.pvdata.misc.BitSet bitSet)
getDone in interface org.epics.pvaccess.client.ChannelPutRequesterprotected PVATypeAdapter findTypeAdapter(ValueCache<?> cache, PVAChannelHandler connection)
MultiplexedChannelHandlerDataSourceTypeSupport as
a good first implementation.findTypeAdapter in class MultiplexedChannelHandler<PVAChannelHandler,org.epics.pvdata.pv.PVStructure>cache - the cache that will store the dataconnection - the connection payloadpublic void addReader(ChannelHandlerReadSubscription subscription)
ChannelHandleraddReader in class MultiplexedChannelHandler<PVAChannelHandler,org.epics.pvdata.pv.PVStructure>subscription - the data required for a subscriptionpublic void monitorConnect(org.epics.pvdata.pv.Status status,
org.epics.pvdata.monitor.Monitor monitor,
org.epics.pvdata.pv.Structure structure)
monitorConnect in interface org.epics.pvdata.monitor.MonitorRequesterpublic void monitorEvent(org.epics.pvdata.monitor.Monitor monitor)
monitorEvent in interface org.epics.pvdata.monitor.MonitorRequesterpublic void unlisten(org.epics.pvdata.monitor.Monitor monitor)
unlisten in interface org.epics.pvdata.monitor.MonitorRequesterCopyright © 2015. All rights reserved.