org.scale7.cassandra.pelops.spring
Class CachePerNodePoolFactoryBean

java.lang.Object
  extended by org.scale7.cassandra.pelops.spring.CachePerNodePoolFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<IThriftPool>, org.springframework.beans.factory.InitializingBean

Deprecated.

@Deprecated
public class CachePerNodePoolFactoryBean
extends Object
implements org.springframework.beans.factory.FactoryBean<IThriftPool>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean

Used to initialize a Pelops pool that honors Spring's context life cycle. Using this class ensures that the dependency graph that's managed by Spring won't attempt to use Pelops when it isn't available.

To use it add the following to your context file:
 <bean id="pelopsPool" class="org.scale7.cassandra.pelops.spring.CachePerNodePoolFactoryBean">
      <property name="cluster">
          <bean class="org.scale7.cassandra.pelops.Cluster">
              <constructor-arg index="0" type="java.lang.String" value="${digitalpigeon.cassandra.host}" />
              <constructor-arg index="1" type="int" value="${digitalpigeon.cassandra.port}" />
          </bean>
      </property>
      <property name="keyspace" value="keyspace" />
 </bean>
 

NOTE: If you intend to use this class you'll need to bypass the static convenience methods on Pelops.

Inject the instance of IThriftPool created by this factory bean into your application code and use it's method directly.

For example:
 private IThriftPool pool;
 
 public void doStuff() {
     Selector selector = pool.createSelector();
     ...
 }
 


Constructor Summary
CachePerNodePoolFactoryBean()
          Deprecated.  
 
Method Summary
 void afterPropertiesSet()
          Deprecated. Initializes the Pelops pool.
 void destroy()
          Deprecated. Shuts down the Pelops pool.
 Cluster getCluster()
          Deprecated.  
 String getKeyspace()
          Deprecated.  
 IThriftPool getObject()
          Deprecated. .
 Class<?> getObjectType()
          Deprecated. .
 OperandPolicy getOperandPolicy()
          Deprecated.  
 CachePerNodePool.Policy getPoolPolicy()
          Deprecated.  
 boolean isSingleton()
          Deprecated. .
 void setCluster(Cluster cluster)
          Deprecated.  
 void setKeyspace(String keyspace)
          Deprecated.  
 void setOperandPolicy(OperandPolicy operandPolicy)
          Deprecated.  
 void setPoolPolicy(CachePerNodePool.Policy poolPolicy)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachePerNodePoolFactoryBean

public CachePerNodePoolFactoryBean()
Deprecated. 
Method Detail

getObject

public IThriftPool getObject()
                      throws Exception
Deprecated. 
.

Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean<IThriftPool>
Returns:
the pool
Throws:
Exception

getObjectType

public Class<?> getObjectType()
Deprecated. 
.

Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean<IThriftPool>
Returns:
IThriftPool

isSingleton

public boolean isSingleton()
Deprecated. 
.

Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean<IThriftPool>
Returns:
true

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Deprecated. 
Initializes the Pelops pool.

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception - if an error occurs

destroy

public void destroy()
             throws Exception
Deprecated. 
Shuts down the Pelops pool.

Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
Exception - if an error occurs
See Also:
org.scale7.cassandra.pelops.pool.IThriftPool#shutdown()}

getCluster

public Cluster getCluster()
Deprecated. 

setCluster

public void setCluster(Cluster cluster)
Deprecated. 

getKeyspace

public String getKeyspace()
Deprecated. 

setKeyspace

public void setKeyspace(String keyspace)
Deprecated. 

getPoolPolicy

public CachePerNodePool.Policy getPoolPolicy()
Deprecated. 

setPoolPolicy

public void setPoolPolicy(CachePerNodePool.Policy poolPolicy)
Deprecated. 

getOperandPolicy

public OperandPolicy getOperandPolicy()
Deprecated. 

setOperandPolicy

public void setOperandPolicy(OperandPolicy operandPolicy)
Deprecated. 


Copyright © 2011. All Rights Reserved.