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, setProcessMessageOnReconnect
getChannelName
public 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.Requester
public void message(String message, org.epics.pvdata.pv.MessageType messageType)
message
in interface org.epics.pvdata.pv.Requester
public static Level toLoggerLevel(org.epics.pvdata.pv.MessageType messageType)
messageType
- pvData message type.public void connect()
MultiplexedChannelHandler
connect
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.ChannelRequester
public void channelStateChange(org.epics.pvaccess.client.Channel channel, org.epics.pvaccess.client.Channel.ConnectionState connectionState)
channelStateChange
in interface org.epics.pvaccess.client.ChannelRequester
public void getDone(org.epics.pvdata.pv.Status status, org.epics.pvdata.pv.Field field)
getDone
in interface org.epics.pvaccess.client.GetFieldRequester
public boolean isConnected(PVAChannelHandler channel)
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<PVAChannelHandler,org.epics.pvdata.pv.PVStructure>
channel
- the connection payloadprotected boolean isWriteConnected(PVAChannelHandler channel)
MultiplexedChannelHandler
By 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>
public Map<String,Object> getProperties()
ChannelHandler
getProperties
in class ChannelHandler
public void disconnect()
MultiplexedChannelHandler
disconnect
in class MultiplexedChannelHandler<PVAChannelHandler,org.epics.pvdata.pv.PVStructure>
public void write(Object newValue, ChannelWriteCallback callback)
ChannelHandler
write
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.ChannelPutRequester
public void putDone(org.epics.pvdata.pv.Status status, org.epics.pvaccess.client.ChannelPut channePut)
putDone
in interface org.epics.pvaccess.client.ChannelPutRequester
public 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.ChannelPutRequester
protected PVATypeAdapter findTypeAdapter(ValueCache<?> cache, PVAChannelHandler connection)
MultiplexedChannelHandler
DataSourceTypeSupport
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)
ChannelHandler
addReader
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.MonitorRequester
public void monitorEvent(org.epics.pvdata.monitor.Monitor monitor)
monitorEvent
in interface org.epics.pvdata.monitor.MonitorRequester
public void unlisten(org.epics.pvdata.monitor.Monitor monitor)
unlisten
in interface org.epics.pvdata.monitor.MonitorRequester
Copyright © 2010–2015. All rights reserved.