org.apache.avalon.excalibur.datasource.cluster
Interface IndexedDataSourceCluster

All Superinterfaces:
Component, Configurable, DataSourceComponent, ThreadSafe
All Known Implementing Classes:
DefaultIndexedDataSourceCluster

public interface IndexedDataSourceCluster
extends DataSourceComponent

Since:
4.1
Version:
CVS $Revision: 1.4 $ $Date: 2003/02/27 15:20:56 $
Author:
Leif Mortenson

Field Summary
static String ROLE
          The name of the role for convenience
 
Method Summary
 int getClusterSize()
          Returns the number of DataSources in the cluster.
 Connection getConnectionForIndex(int index)
          Gets a Connection to a database given an index.
 
Methods inherited from interface org.apache.avalon.excalibur.datasource.DataSourceComponent
getConnection
 
Methods inherited from interface org.apache.avalon.framework.configuration.Configurable
configure
 

Field Detail

ROLE

public static final String ROLE
The name of the role for convenience

See Also:
Constant Field Values
Method Detail

getClusterSize

public int getClusterSize()
Returns the number of DataSources in the cluster.

Returns:
size of the cluster.

getConnectionForIndex

public Connection getConnectionForIndex(int index)
                                 throws SQLException
Gets a Connection to a database given an index.

Parameters:
index - Index of the DataSource for which a connection is to be returned.
Throws:
NoValidConnectionException - when there is no valid Connection wrapper available in the classloader or when the index is not valid.
NoAvailableConnectionException - when there are no more available Connections in the pool.
SQLException


Copyright © 2000-2002 Apache Jakarta Project. All Rights Reserved.