ilog.cpl.datasource
Class IlpDefaultDataSourceManager

java.lang.Object
  extended by ilog.cpl.datasource.IlpDefaultDataSourceManager
All Implemented Interfaces:
IlpDataSourceManager, IlpMutableDataSourceManager

public class IlpDefaultDataSourceManager
extends Object
implements IlpMutableDataSourceManager

Defines a default implementation for the data source manager.

This default implementation maintains a collection of data sources. They are referenced through weak references that do not prevent garbage collection.

Since:
JTGO 3.0
See Also:
IlpDataSourceLoggers.ilog_cpl_datasource

Constructor Summary
IlpDefaultDataSourceManager()
          Creates a new data source manager.
 
Method Summary
 void addDataSource(IlpDataSource aDataSource)
          Adds a data source to this manager.
 void addDataSourceManagerListener(DataSourceManagerListener listener)
          Adds a listener to data source manager events.
 Collection 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlpDefaultDataSourceManager

public IlpDefaultDataSourceManager()
Creates a new data source manager.

Method Detail

getDataSources

public Collection getDataSources()
Returns the data sources created in the context of this data source manager.

Specified by:
getDataSources in interface IlpDataSourceManager
Returns:
A Collection containing the known data sources.
See Also:
IlpDataSource

hasDataSource

public boolean hasDataSource(IlpDataSource aDataSource)
Returns true if the given data source belongs to this manager.

Specified by:
hasDataSource in interface IlpDataSourceManager
Parameters:
aDataSource - The data source being checked.
Returns:
true if the data source belongs to the manager.
Throws:
IllegalArgumentException - if the given data source is invalid.

addDataSource

public void addDataSource(IlpDataSource aDataSource)
Adds a data source to this manager.

Specified by:
addDataSource in interface IlpMutableDataSourceManager
Parameters:
aDataSource - The data source being added.

removeDataSource

public void removeDataSource(IlpDataSource aDataSource)
Removes a data source from this manager.

Specified by:
removeDataSource in interface IlpMutableDataSourceManager
Parameters:
aDataSource - The data source to be removed.

addDataSourceManagerListener

public void addDataSourceManagerListener(DataSourceManagerListener listener)
Adds a listener to data source manager events.

The listener will receive DataSourceManagerEvents whenever a datasource 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.

Specified by:
addDataSourceManagerListener in interface IlpMutableDataSourceManager
Since:
JTGO 4.0
See Also:
addDataSource(ilog.cpl.datasource.IlpDataSource), removeDataSource(ilog.cpl.datasource.IlpDataSource)

removeDataSourceManagerListener

public void removeDataSourceManagerListener(DataSourceManagerListener listener)
Removes the given listener from data source manager events.

Specified by:
removeDataSourceManagerListener in interface IlpMutableDataSourceManager
Since:
JTGO 4.0


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.