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: 2004/02/28 11:47:20 $
Author:
Avalon Development Team

Field Summary
static java.lang.String ROLE
          The name of the role for convenience
 
Method Summary
 int getClusterSize()
          Returns the number of DataSources in the cluster.
 java.sql.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 java.lang.String ROLE
The name of the role for convenience

Method Detail

getClusterSize

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

Returns:
size of the cluster.

getConnectionForIndex

public java.sql.Connection getConnectionForIndex(int index)
                                          throws java.sql.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.
java.sql.SQLException


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.