net.dataforte.cassandra.pool
Class DataSourceFactory

java.lang.Object
  extended by net.dataforte.cassandra.pool.DataSourceFactory
All Implemented Interfaces:
ObjectFactory

public class DataSourceFactory
extends Object
implements ObjectFactory


Field Summary
static String OBJECT_NAME
           
 
Constructor Summary
DataSourceFactory()
           
 
Method Summary
 CassandraThriftDataSource createDataSource(Map<String,String> properties)
          Creates and configures a DataSource instance based on the given properties.
 CassandraThriftDataSource createDataSource(Map<String,String> properties, Context context)
           
 Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment)
           
protected static Map<String,String> getProperties(String propText)
           Parse properties from the string.
static PoolConfiguration parsePoolProperties(Map<String,String> properties)
           
 void performJNDILookup(Context context, PoolConfiguration poolProperties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBJECT_NAME

public static final String OBJECT_NAME
See Also:
Constant Field Values
Constructor Detail

DataSourceFactory

public DataSourceFactory()
Method Detail

getObjectInstance

public Object getObjectInstance(Object obj,
                                Name name,
                                Context nameCtx,
                                Hashtable<?,?> environment)
                         throws Exception
Specified by:
getObjectInstance in interface ObjectFactory
Throws:
Exception

parsePoolProperties

public static PoolConfiguration parsePoolProperties(Map<String,String> properties)
                                             throws IOException
Throws:
IOException

createDataSource

public CassandraThriftDataSource createDataSource(Map<String,String> properties)
                                           throws Exception
Creates and configures a DataSource instance based on the given properties.

Parameters:
properties - the datasource configuration properties
Throws:
Exception - if an error occurs creating the data source

createDataSource

public CassandraThriftDataSource createDataSource(Map<String,String> properties,
                                                  Context context)
                                           throws Exception
Throws:
Exception

performJNDILookup

public void performJNDILookup(Context context,
                              PoolConfiguration poolProperties)

getProperties

protected static Map<String,String> getProperties(String propText)
                                           throws IOException

Parse properties from the string. Format of the string must be [propertyName=property;]*

Parameters:
propText -
Returns:
Properties
Throws:
Exception
IOException


Copyright © 2011. All Rights Reserved.