|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.epics.pvmanager.DataSource
public abstract class DataSource
A source for data that is going to be processed by the PVManager. PVManager can work with more than one source at a time. Support for each different source can be added by external libraries.
Constructor Summary | |
---|---|
DataSource(boolean writeable)
Creates a new data source. |
Method Summary | |
---|---|
void |
close()
Closes the DataSource and the resources associated with it. |
void |
concludeWrite(WriteBuffer writeBuffer,
ExceptionHandler exceptionHandler)
Releases the resources associated with the given write buffer. |
void |
connect(DataRecipe recipe)
Connects to a set of channels based on the given recipe. |
protected abstract ChannelHandler |
createChannel(java.lang.String channelName)
Creates a channel handler for the given name. |
void |
disconnect(DataRecipe recipe)
Disconnects the set of channels given by the recipe. |
java.util.Map<java.lang.String,ChannelHandler> |
getChannels()
Returns the channel handlers for this data source. |
boolean |
isWriteable()
Returns true whether the channels of this data source can be written to. |
void |
prepareWrite(WriteBuffer writeBuffer,
ExceptionHandler exceptionHandler)
Prepares the channels defined in the write buffer for writes. |
void |
write(WriteBuffer writeBuffer,
java.lang.Runnable callback,
ExceptionHandler exceptionHandler)
Writes the contents in the given write buffers to the channels of this data sources. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataSource(boolean writeable)
writeable
- whether the data source implements write operationsMethod Detail |
---|
public boolean isWriteable()
protected abstract ChannelHandler createChannel(java.lang.String channelName)
channelName
- the name for a new channel
public void connect(DataRecipe recipe)
The data source must update the value caches relative to each channel. Before updating any cache, it must lock the collector relative to that cache and after any update it must notify the collector.
recipe
- the instructions for the data connectionpublic void disconnect(DataRecipe recipe)
The disconnect call is guaranteed to be given the same object, so that the recipe itself can be used as a key in a map to retrieve the list of resources needed to be closed.
recipe
- the instructions for the data connectionpublic void prepareWrite(WriteBuffer writeBuffer, ExceptionHandler exceptionHandler)
If these are channels over the network, it will create the network connections with the underlying libraries.
writeBuffer
- the buffer that will contain the write dataexceptionHandler
- where to report the exceptionspublic void concludeWrite(WriteBuffer writeBuffer, ExceptionHandler exceptionHandler)
Will close network channels and deallocate memory needed.
writeBuffer
- the buffer that will no longer be usedexceptionHandler
- where to report the exceptionspublic void write(WriteBuffer writeBuffer, java.lang.Runnable callback, ExceptionHandler exceptionHandler)
The write buffer need to be first prepared with prepareWrite(org.epics.pvmanager.WriteBuffer, org.epics.pvmanager.ExceptionHandler)
and then cleaned up with concludeWrite(org.epics.pvmanager.WriteBuffer, org.epics.pvmanager.ExceptionHandler)
.
writeBuffer
- the buffer containing the data to writecallback
- function to call when the write is concludedexceptionHandler
- where to report the exceptionspublic java.util.Map<java.lang.String,ChannelHandler> getChannels()
public void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |