|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.epics.pvmanager.DataSource
org.epics.pvmanager.CompositeDataSource
public class CompositeDataSource
A data source that can dispatch a request to multiple different data sources.
Constructor Summary | |
---|---|
CompositeDataSource()
Creates a new CompositeDataSource. |
Method Summary | |
---|---|
void |
close()
Closes all DataSources that are registered in the composite. |
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 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. |
java.util.Map<java.lang.String,DataSource> |
getDataSources()
Returns the data sources registered to this composite data source. |
java.lang.String |
getDefaultDataSource()
Returns which data source is used if no data source is specified in the channel name. |
java.lang.String |
getDelimiter()
Returns the delimeter that divides the data source name from the channel name. |
void |
prepareWrite(WriteBuffer writeBuffer,
ExceptionHandler exceptionHandler)
Prepares the channels defined in the write buffer for writes. |
void |
putDataSource(java.lang.String name,
DataSource dataSource)
Adds/replaces the data source corresponding to the given name. |
void |
setDefaultDataSource(java.lang.String defaultDataSource)
Sets the data source to be used if the channel does not specify one explicitely. |
void |
setDelimiter(java.lang.String delimiter)
Changes the data source delimiter. |
Methods inherited from class org.epics.pvmanager.DataSource |
---|
isWriteable, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompositeDataSource()
Method Detail |
---|
public java.lang.String getDelimiter()
public void setDelimiter(java.lang.String delimiter)
delimiter
- new data source delimiter; can't be nullpublic void putDataSource(java.lang.String name, DataSource dataSource)
name
- the name of the data sourcedataSource
- the data source to add/replacepublic java.lang.String getDefaultDataSource()
public java.util.Map<java.lang.String,DataSource> getDataSources()
public void setDefaultDataSource(java.lang.String defaultDataSource)
defaultDataSource
- the default data sourcepublic void connect(DataRecipe recipe)
DataSource
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.
connect
in class DataSource
recipe
- the instructions for the data connectionpublic void disconnect(DataRecipe recipe)
DataSource
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.
disconnect
in class DataSource
recipe
- the instructions for the data connectionpublic void prepareWrite(WriteBuffer writeBuffer, ExceptionHandler exceptionHandler)
DataSource
If these are channels over the network, it will create the network connections with the underlying libraries.
prepareWrite
in class DataSource
writeBuffer
- the buffer that will contain the write dataexceptionHandler
- where to report the exceptionspublic void concludeWrite(WriteBuffer writeBuffer, ExceptionHandler exceptionHandler)
DataSource
Will close network channels and deallocate memory needed.
concludeWrite
in class DataSource
writeBuffer
- the buffer that will no longer be usedexceptionHandler
- where to report the exceptionsprotected ChannelHandler createChannel(java.lang.String channelName)
DataSource
createChannel
in class DataSource
channelName
- the name for a new channel
public void close()
close
in class DataSource
public java.util.Map<java.lang.String,ChannelHandler> getChannels()
DataSource
getChannels
in class DataSource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |