com.xavax.xstore.util
Class InitialContextFactory

Object
  extended byInitialContextFactory
All Implemented Interfaces:
InitialContextFactory

public class InitialContextFactory
extends Object
implements InitialContextFactory

InitialContextFactory creates an initial context for use when running outside of an application server environment without a name server. After creating an initial context, the data sources specified in the properties file are created and bound to names in the context. The name of the properties file is obtained from the ApplicationContext. The main program should set the properties in the ApplicationContext before creating an initial context. The following properties are used.

com.xavax.xstore.driver
The classname of the JDBC driver.
com.xavax.xstore.sourceList
A list of data sources to be created and bound to names in the initial context.
com.xavax.xstore.*.url
The URL for a data source (where * is the data source name).
com.xavax.xstore.*.username
The username for a data source.
com.xavax.xstore.*.password
The password for a data source.
com.xavax.xstore.*.poolSize
The maximum number of connections in the pool.


Constructor Summary
InitialContextFactory()
          Contruct an InitialContextFactory.
 
Method Summary
 Context getInitialContext(Hashtable env)
          Creates and returns an initial context.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InitialContextFactory

public InitialContextFactory()
Contruct an InitialContextFactory.

Method Detail

getInitialContext

public Context getInitialContext(Hashtable env)
                                       throws NamingException
Creates and returns an initial context. Before returning the context, any data sources specified by the sourceList property are created and bound to names in the initial context.

Specified by:
getInitialContext in interface InitialContextFactory
Parameters:
env - environment used to create the initial context.
Returns:
an initial context.
Throws:
NamingException