public interface HashedDataSourceCluster extends DataSourceComponent
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ROLE
The name of the role for convenience
|
| Modifier and Type | Method and Description |
|---|---|
int |
getClusterSize()
Returns the number of DataSources in the cluster.
|
java.sql.Connection |
getConnectionForHashCode(int hashCode)
Gets a Connection to a database given a hash code.
|
java.sql.Connection |
getConnectionForHashObject(java.lang.Object hashObject)
Gets a Connection to a database given a hash object.
|
java.sql.Connection |
getConnectionForIndex(int index)
Gets a Connection to a database given an index.
|
int |
getIndexForHashCode(int hashCode)
Gets the index which will be resolved for a given hashCode.
|
int |
getIndexForHashObject(java.lang.Object hashObject)
Gets the index which will be resolved for a given hashCode.
|
getConnectionint getClusterSize()
java.sql.Connection getConnectionForHashObject(java.lang.Object hashObject)
throws java.sql.SQLException
hashObject - Object whose hashCode will be used to select which of the Clusted
DataSources will be provide a Connection.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.SQLExceptionjava.sql.Connection getConnectionForHashCode(int hashCode)
throws java.sql.SQLException
hashCode - HashCode which will be used to select which of the Clusted
DataSources will be provide a Connection.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.SQLExceptionjava.sql.Connection getConnectionForIndex(int index)
throws java.sql.SQLException
index - Index of the DataSource for which a connection is to be returned.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.SQLExceptionint getIndexForHashObject(java.lang.Object hashObject)
hashObject - Object whose hashCode will be used to select which of the Clusted
DataSources will be provide a Connection.int getIndexForHashCode(int hashCode)
hashCode - HashCode which will be used to select which of the Clusted
DataSources will be provide a Connection.