net.dataforte.cassandra.pool
Class DataSourceProxy

java.lang.Object
  extended by net.dataforte.cassandra.pool.DataSourceProxy
Direct Known Subclasses:
DataSource

public class DataSourceProxy
extends Object

The DataSource proxy lets us implements methods that don't exist in the current CassandraThriftDataSource interface but might be methods that are part of a future CassandraThriftDataSource interface.

Author:
Tristan Tarrant

Field Summary
protected  ConnectionPool pool
           
protected  PoolConfiguration poolProperties
           
 
Constructor Summary
DataSourceProxy(PoolConfiguration poolProperties)
           
 
Method Summary
 void close()
           
 void close(boolean all)
           
 ConnectionPool createPool()
          Sets up the connection pool, by creating a pooling driver.
 org.apache.cassandra.thrift.Cassandra.Client getConnection()
           
 ConnectionPool getPool()
           
 PoolConfiguration getPoolProperties()
           
 int getPoolSize()
           
 void releaseConnection(org.apache.cassandra.thrift.Cassandra.Client connection)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pool

protected volatile ConnectionPool pool

poolProperties

protected PoolConfiguration poolProperties
Constructor Detail

DataSourceProxy

public DataSourceProxy(PoolConfiguration poolProperties)
Method Detail

getPoolProperties

public PoolConfiguration getPoolProperties()

createPool

public ConnectionPool createPool()
                          throws org.apache.thrift.TException
Sets up the connection pool, by creating a pooling driver.

Returns:
Driver
Throws:
org.apache.thrift.TException

getConnection

public org.apache.cassandra.thrift.Cassandra.Client getConnection()
                                                           throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException

releaseConnection

public void releaseConnection(org.apache.cassandra.thrift.Cassandra.Client connection)

getPool

public ConnectionPool getPool()
                       throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException

close

public void close()

close

public void close(boolean all)

getPoolSize

public int getPoolSize()
                throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.