|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.epics.pvmanager.ChannelHandler<EType>
EType
- type of the connection payloadpublic abstract class ChannelHandler<EType>
Manages the connection for each channel of a data source.
Constructor Summary | |
---|---|
ChannelHandler(String channelName)
Creates a new channel handler. |
Method Summary | |
---|---|
protected void |
addMonitor(Collector<?> collector,
ValueCache<?> cache,
ExceptionHandler handler)
Used by the data source to add a read request on the channel managed by this handler. |
protected void |
addWriter(ExceptionHandler handler)
Used by the data source to prepare the channel managed by this handler for write. |
protected abstract void |
connect(ExceptionHandler handler)
Used by the handler to open the connection. |
protected abstract void |
disconnect(ExceptionHandler handler)
Used by the handler to close the connection. |
String |
getChannelName()
Returns the name of the channel. |
int |
getReadUsageCounter()
Returns how many read PVs are open on this channel. |
int |
getUsageCounter()
Returns how many read or write PVs are open on this channel. |
int |
getWriteUsageCounter()
Returns how many write PVs are open on this channel. |
abstract boolean |
isConnected()
Returns true if it is connected. |
protected void |
processValue(EType payload)
Process the payload for this channel. |
protected void |
removeMonitor(Collector<?> collector)
Used by the data source to remove a read request. |
protected void |
removeWrite(ExceptionHandler exceptionHandler)
Used by the data source to conclude writes to the channel managed by this handler. |
protected abstract boolean |
updateCache(EType event,
ValueCache<?> cache)
Used by the handler to forward values. |
protected abstract void |
write(Object newValue,
ChannelWriteCallback callback)
Implements a write operation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChannelHandler(String channelName)
channelName
- the name of the channel this handler will be responsible ofMethod Detail |
---|
public String getChannelName()
public int getUsageCounter()
public int getReadUsageCounter()
public int getWriteUsageCounter()
protected void addMonitor(Collector<?> collector, ValueCache<?> cache, ExceptionHandler handler)
collector
- collector to be notified at each updatecache
- cache to contain the new valuehandler
- to be notified in case of errorsprotected void removeMonitor(Collector<?> collector)
collector
- the collector that does not need to be notified anymoreprotected void addWriter(ExceptionHandler handler)
handler
- to be notified in case of errorsprotected void removeWrite(ExceptionHandler exceptionHandler)
exceptionHandler
- to be notified in case of errorsprotected final void processValue(EType payload)
updateCache(java.lang.Object, org.epics.pvmanager.ValueCache)
for each read monitor that was setup.
payload
- the payload of for this type of channelprotected abstract void connect(ExceptionHandler handler)
handler
- to be notified in case of errorsprotected abstract void disconnect(ExceptionHandler handler)
handler
- to be notified in case of errorsprotected abstract void write(Object newValue, ChannelWriteCallback callback)
newValue
- new value to be writtencallback
- called when done or on errorprotected abstract boolean updateCache(EType event, ValueCache<?> cache)
event
- the payloadcache
- the cache where to store the new value
public abstract boolean isConnected()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |