public class IlpDefaultDataSourceManager extends Object implements IlpMutableDataSourceManager
This default implementation maintains a collection of data sources. They are referenced through weak references that do not prevent garbage collection.
IlpDataSourceLoggers.ilog_cpl_datasource
Constructor and Description |
---|
IlpDefaultDataSourceManager()
Creates a new data source manager.
|
Modifier and Type | Method and Description |
---|---|
void |
addDataSource(IlpDataSource aDataSource)
Adds a data source to this manager.
|
void |
addDataSourceManagerListener(DataSourceManagerListener listener)
Adds a listener to data source manager events.
|
Collection<IlpDataSource> |
getDataSources()
Returns the data sources created in the context of this data source manager.
|
boolean |
hasDataSource(IlpDataSource aDataSource)
Returns
true if the given data source belongs to this manager. |
void |
removeDataSource(IlpDataSource aDataSource)
Removes a data source from this manager.
|
void |
removeDataSourceManagerListener(DataSourceManagerListener listener)
Removes the given listener from data source manager events.
|
public IlpDefaultDataSourceManager()
public Collection<IlpDataSource> getDataSources()
getDataSources
in interface IlpDataSourceManager
Collection
containing the known data sources.IlpDataSource
public boolean hasDataSource(IlpDataSource aDataSource)
true
if the given data source belongs to this manager.hasDataSource
in interface IlpDataSourceManager
aDataSource
- The data source being checked.true
if the data source belongs to the manager.IllegalArgumentException
- if the given data source is invalid.public void addDataSource(IlpDataSource aDataSource)
addDataSource
in interface IlpMutableDataSourceManager
aDataSource
- The data source being added.public void removeDataSource(IlpDataSource aDataSource)
removeDataSource
in interface IlpMutableDataSourceManager
aDataSource
- The data source to be removed.public void addDataSourceManagerListener(DataSourceManagerListener listener)
The listener will receive DataSourceManagerEvent
s whenever a
data source is added or removed from this manager, through the use of methods
addDataSource
and removeDataSource
.
This data source manager implementation does not prevent data sources from being garbage collected. When a data source is removed through the garbage collection process, notifications are not sent to the listeners.
addDataSourceManagerListener
in interface IlpMutableDataSourceManager
addDataSource(ilog.cpl.datasource.IlpDataSource)
,
removeDataSource(ilog.cpl.datasource.IlpDataSource)
public void removeDataSourceManagerListener(DataSourceManagerListener listener)
removeDataSourceManagerListener
in interface IlpMutableDataSourceManager
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.