net.sf.farrago.session
Interface FarragoSessionFactory

All Superinterfaces:
FarragoSessionPersonalityFactory
All Known Implementing Classes:
FarragoAutoCalcRulesTest.TestDbSessionFactory, FarragoDbSessionFactory, FarragoDefaultSessionFactory, LucidDbIndexOnlySessionFactory, LucidDbSessionFactory

public interface FarragoSessionFactory
extends FarragoSessionPersonalityFactory

FarragoSessionFactory defines an interface with factory methods used to create new sessions and related objects.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/session/FarragoSessionFactory.java#24 $
Author:
John V. Sichi

Method Summary
 void applyFennelExtensionParameters(Properties map)
          Allows extensions of Farrago to add their own parameters to the Fennel configuration parameters.
 void cleanupSessions()
          Gives this factory a chance to clean up after a session has been closed.
 void defineResourceBundles(List<ResourceBundle> bundleList)
          Defines resource bundles to be used for localizing model object names.
 FarragoPluginClassLoader getPluginClassLoader()
           
 FennelCmdExecutor newFennelCmdExecutor()
          Creates a new intrepreter for Fennel commands.
 FennelTxnContext newFennelTxnContext(FarragoRepos repos, FennelDbHandle fennelDbHandle)
          Creates a new Fennel transaction context.
 FarragoSessionModelExtension newModelExtension(FarragoPluginClassLoader pluginClassLoader, FemJar femJar)
          Loads a model extension plugin instance.
 FarragoSession newReentrantSession(FarragoSession session)
          Creates a new reentrant session.
 FarragoRepos newRepos(FarragoAllocationOwner owner, boolean userRepos)
          Opens a new repositor instance.
 FarragoSession newSession(String url, Properties info)
          Creates a new session.
 FarragoSessionTxnMgr newTxnMgr()
           
 void releaseReentrantSession(FarragoSession session)
          Release a reentrant session.
 void setPluginClassLoader(FarragoPluginClassLoader pluginClassLoader)
          Sets the class loader for plugins.
 void specializedInitialization(FarragoAllocationOwner owner)
          Allows extensions of Farrago to perform their own initialization tasks.
 void specializedShutdown()
          Allows extensions of Farrago to perform their own shutdown tasks.
 
Methods inherited from interface net.sf.farrago.session.FarragoSessionPersonalityFactory
newSessionPersonality
 

Method Detail

newSession

FarragoSession newSession(String url,
                          Properties info)
Creates a new session.

Parameters:
url - (same as for JDBC connect)
info - (same as for JDBC connect)
Returns:
new session

newReentrantSession

FarragoSession newReentrantSession(FarragoSession session)
Creates a new reentrant session. The base session is cloned with a cloned copy of the base session's session variables.

Parameters:
session - the existing session on which to base the re-entrant session

releaseReentrantSession

void releaseReentrantSession(FarragoSession session)
Release a reentrant session.


newFennelCmdExecutor

FennelCmdExecutor newFennelCmdExecutor()
Creates a new intrepreter for Fennel commands.

Returns:
new interpeter

newRepos

FarragoRepos newRepos(FarragoAllocationOwner owner,
                      boolean userRepos)
Opens a new repositor instance.

Parameters:
owner - the object which should own the new repos
userRepos - true for user repos; false for system repos
Returns:
new repos instance

newFennelTxnContext

FennelTxnContext newFennelTxnContext(FarragoRepos repos,
                                     FennelDbHandle fennelDbHandle)
Creates a new Fennel transaction context.

Parameters:
repos - repos for transaction metadata access
fennelDbHandle - handle for database to access
Returns:
new context

newTxnMgr

FarragoSessionTxnMgr newTxnMgr()
Returns:
a new transaction manager

setPluginClassLoader

void setPluginClassLoader(FarragoPluginClassLoader pluginClassLoader)
Sets the class loader for plugins.

Parameters:
pluginClassLoader - classloader to use

getPluginClassLoader

FarragoPluginClassLoader getPluginClassLoader()
Returns:
plugin class loader to use

newModelExtension

FarragoSessionModelExtension newModelExtension(FarragoPluginClassLoader pluginClassLoader,
                                               FemJar femJar)
Loads a model extension plugin instance.

Parameters:
pluginClassLoader - FarragoPluginClassLoader to use to load the plugin
femJar - catalog descriptor for jar from which plugin is loaded

applyFennelExtensionParameters

void applyFennelExtensionParameters(Properties map)
Allows extensions of Farrago to add their own parameters to the Fennel configuration parameters.

Parameters:
map - a non-null, modifiable Map where configuration parameters can

specializedInitialization

void specializedInitialization(FarragoAllocationOwner owner)
Allows extensions of Farrago to perform their own initialization tasks.

Parameters:
owner - the object that should own any allocated objects

specializedShutdown

void specializedShutdown()
Allows extensions of Farrago to perform their own shutdown tasks.


cleanupSessions

void cleanupSessions()
Gives this factory a chance to clean up after a session has been closed.


defineResourceBundles

void defineResourceBundles(List<ResourceBundle> bundleList)
Defines resource bundles to be used for localizing model object names. Any resource having a name of the form "UmlXXX" will be interpreted as the localized name for UML class XXX.

Parameters:
bundleList - receives instances of ResourceBundle