DODS 7.1 API

org.enhydra.dods.jts
Class LocalContextFactory

java.lang.Object
  extended by org.enhydra.dods.jts.LocalContextFactory
All Implemented Interfaces:
javax.naming.spi.InitialContextFactory

public class LocalContextFactory
extends java.lang.Object
implements javax.naming.spi.InitialContextFactory

LocalContextFactory

Version:
0.23
Author:
V.Puskas, J.P. Rojas

Field Summary
static java.lang.String DSNAMES_PARAM_NAME
          Name of the system property whose value determines what datasources to create.
static java.lang.String PROVIDERS2START_PARAM_NAME
          Name of the system property whose value determines which transaction manager implementation to start and use.
 
Constructor Summary
LocalContextFactory()
           
 
Method Summary
 javax.naming.Context getInitialContext(java.util.Hashtable properties)
           
static void main(java.lang.String[] args)
           
static javax.naming.Context setup(java.lang.String datasourceNames)
          An utility method, to override (or ignore absence of) system properties.
static javax.naming.Context setup(java.lang.String providers2start, java.lang.String datasourceNames)
          An utility method, to override (or ignore absence of) system properties.
static void shutdown()
          An utility method to allow providers clean all resources allocated during startup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROVIDERS2START_PARAM_NAME

public static java.lang.String PROVIDERS2START_PARAM_NAME
Name of the system property whose value determines which transaction manager implementation to start and use.

If value isn't recognized (one of jotm, jbossts), no transaction manager will be started. Name of the system property whose value determines which datasource pool implementation to use.

If value isn't xapool no pool will be started.


DSNAMES_PARAM_NAME

public static java.lang.String DSNAMES_PARAM_NAME
Name of the system property whose value determines what datasources to create.

Value should be comma-separated list of names. Each name is than used to load a property file to initialize datasource.

Constructor Detail

LocalContextFactory

public LocalContextFactory()
Method Detail

setup

public static javax.naming.Context setup(java.lang.String datasourceNames)
                                  throws javax.naming.NamingException
An utility method, to override (or ignore absence of) system properties. It'll make jotm and xapool choices. You still have to provide list of datasource names.

Parameters:
datasourceNames - comma-separated list of datasource names (properties file following .properties will be loaded), or path to a properties file with that config.
Returns:
initialized Context
Throws:
javax.naming.NamingException

shutdown

public static void shutdown()
                     throws javax.naming.NamingException
An utility method to allow providers clean all resources allocated during startup.

Throws:
javax.naming.NamingException

setup

public static javax.naming.Context setup(java.lang.String providers2start,
                                         java.lang.String datasourceNames)
                                  throws javax.naming.NamingException
An utility method, to override (or ignore absence of) system properties. It won't make any choice.

You have to provide transaction manager name, pool implementation name and a list of datasource names.

Parameters:
providers2start - comma separated list of provider names to start
datasourceNames - comma-separated list of datasource names
Returns:
initialized Context
Throws:
javax.naming.NamingException

getInitialContext

public javax.naming.Context getInitialContext(java.util.Hashtable properties)
                                       throws javax.naming.NamingException
Specified by:
getInitialContext in interface javax.naming.spi.InitialContextFactory
Throws:
javax.naming.NamingException

main

public static void main(java.lang.String[] args)
                 throws javax.naming.NamingException
Throws:
javax.naming.NamingException

DODS 7.1 API