org.nuiton.topia
Class TopiaContextFactory

java.lang.Object
  extended by org.nuiton.topia.TopiaContextFactory

public class TopiaContextFactory
extends Object

TODO-FD20100507 : Need javadoc + translate the one on methods.

Created: 3 janv. 2006 21:19:37

Version:
$Id: TopiaContextFactory.java 2247 2011-04-15 12:50:58Z tchemit $
Author:
poussin , tchemit

Field Summary
static String CONFIG_BYTECODE_PROVIDER
           
static String CONFIG_CONNECTION_PROVIDER
           
static String CONFIG_CURRENT_SESSION_CONTEXT_CLASS
           
static String CONFIG_DEFAULT_SCHEMA
           
static String CONFIG_DIALECT
           
static String CONFIG_DRIVER
           
static String CONFIG_FORMAT_SQL
           
static String CONFIG_GENERATE_STATISTICS
           
static String CONFIG_HBM2DDL_AUTO
           
static String CONFIG_PASS
           
static String CONFIG_POOL_SIZE
           
static String CONFIG_SHOW_SQL
           
static String CONFIG_URL
           
static String CONFIG_USER
           
protected static Map<Properties,TopiaContext> contextCache
          Cache contenant tous les contexts deja créé.
 
Constructor Summary
TopiaContextFactory()
           
 
Method Summary
static TopiaContext getContext()
          Utilise par defaut le fichier de propriete TopiaContextImpl.properties
static TopiaContext getContext(Properties config)
          Methode static permettant de recuperer un context.
static List<String> getContextOpened()
          Permet de connaitre la liste des contexts encore en memoire, utile pour du debuggage.
static void removeContext(TopiaContext context)
          Used when TopiaContext root is closed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contextCache

protected static Map<Properties,TopiaContext> contextCache
Cache contenant tous les contexts deja créé.


CONFIG_DEFAULT_SCHEMA

public static final String CONFIG_DEFAULT_SCHEMA
See Also:
Constant Field Values

CONFIG_USER

public static final String CONFIG_USER
See Also:
Constant Field Values

CONFIG_PASS

public static final String CONFIG_PASS
See Also:
Constant Field Values

CONFIG_DRIVER

public static final String CONFIG_DRIVER
See Also:
Constant Field Values

CONFIG_DIALECT

public static final String CONFIG_DIALECT
See Also:
Constant Field Values

CONFIG_CONNECTION_PROVIDER

public static final String CONFIG_CONNECTION_PROVIDER
See Also:
Constant Field Values

CONFIG_BYTECODE_PROVIDER

public static final String CONFIG_BYTECODE_PROVIDER
See Also:
Constant Field Values

CONFIG_CURRENT_SESSION_CONTEXT_CLASS

public static final String CONFIG_CURRENT_SESSION_CONTEXT_CLASS
See Also:
Constant Field Values

CONFIG_GENERATE_STATISTICS

public static final String CONFIG_GENERATE_STATISTICS
See Also:
Constant Field Values

CONFIG_FORMAT_SQL

public static final String CONFIG_FORMAT_SQL
See Also:
Constant Field Values

CONFIG_HBM2DDL_AUTO

public static final String CONFIG_HBM2DDL_AUTO
See Also:
Constant Field Values

CONFIG_POOL_SIZE

public static final String CONFIG_POOL_SIZE
See Also:
Constant Field Values

CONFIG_SHOW_SQL

public static final String CONFIG_SHOW_SQL
See Also:
Constant Field Values

CONFIG_URL

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

TopiaContextFactory

public TopiaContextFactory()
Method Detail

getContextOpened

public static List<String> getContextOpened()
Permet de connaitre la liste des contexts encore en memoire, utile pour du debuggage.

Returns:
la liste des urls de connexion

removeContext

public static void removeContext(TopiaContext context)
Used when TopiaContext root is closed

Parameters:
context - closed

getContext

public static TopiaContext getContext()
                               throws TopiaNotFoundException
Utilise par defaut le fichier de propriete TopiaContextImpl.properties

Returns:
the context using the default configuration file
Throws:
TopiaNotFoundException - Si le fichier de configuration par defaut n'est pas retrouvé.

getContext

public static TopiaContext getContext(Properties config)
                               throws TopiaNotFoundException
Methode static permettant de recuperer un context. Si on donne plusieurs fois le meme objet config, on obtient la meme instance de TopiaContextImpl. Si le context qui devrait etre retourné est ferme, alors un nouveau est creer et retourné.

Parameters:
config - the configuration of the context
Returns:
Un TopiaContext ouvert
Throws:
TopiaNotFoundException - if any pb


Copyright © 2004-2011 CodeLutin. All Rights Reserved.