org.specrunner.hibernate3
Class PluginSessionFactory

java.lang.Object
  extended by org.specrunner.parameters.core.ParameterHolder
      extended by org.specrunner.plugins.core.AbstractPlugin
          extended by org.specrunner.plugins.core.AbstractPluginNamed
              extended by org.specrunner.plugins.core.AbstractPluginScoped
                  extended by org.specrunner.plugins.core.AbstractPluginValue
                      extended by org.specrunner.hibernate3.AbstractPluginFactory
                          extended by org.specrunner.hibernate3.PluginSessionFactory
All Implemented Interfaces:
IParameterHolder, IActionType, IParalelPlugin, IPlugin, ISleepPlugin, ITestPlugin, ITimedPlugin, IWaitPlugin

public class PluginSessionFactory
extends AbstractPluginFactory

Creates/recovers a SessionFactory instance and add it to the plugin global context, it can be done using three strategies:

Author:
Thiago Santos

Field Summary
protected  String configuration
          The configuration name.
static String FEATURE_CONFIGURATION
          Feature to set configuration.
static String FEATURE_FACTORY
          Feature to set session factory factory.
static String FEATURE_METHOD
          Set feature factory method name.
static String FEATURE_TYPE
          The session factory provider name.
static String SESSION_FACTORY
          Default session factory name.
 
Fields inherited from class org.specrunner.hibernate3.AbstractPluginFactory
factory, method, type
 
Fields inherited from class org.specrunner.plugins.core.AbstractPluginValue
eval, value
 
Fields inherited from class org.specrunner.plugins.core.AbstractPluginScoped
scope
 
Fields inherited from class org.specrunner.plugins.core.AbstractPluginNamed
name
 
Fields inherited from class org.specrunner.plugins.core.AbstractPlugin
FEATURE_CONDITION, FEATURE_NORMALIZED, FEATURE_NORMALIZER, FEATURE_SLEEP, FEATURE_THREADSAFE, FEATURE_TIMEOUT, FEATURE_WAIT
 
Fields inherited from class org.specrunner.parameters.core.ParameterHolder
parameters
 
Constructor Summary
PluginSessionFactory()
           
 
Method Summary
 ENext doStart(IContext context, IResultSet result)
           
 String getConfiguration()
          Gets the configuration.
static org.hibernate.SessionFactory getSessionFactory(IContext context, String name)
          Get the session factory associated to a given name in test context.
 void initialize(IContext context)
           
 void setConfiguration(String configuration)
          Sets the configuration.
 
Methods inherited from class org.specrunner.hibernate3.AbstractPluginFactory
getActionType, getFactory, getMethod, getType, setFactory, setMethod, setType
 
Methods inherited from class org.specrunner.plugins.core.AbstractPluginValue
getValue, getValue, isEval, setEval, setValue
 
Methods inherited from class org.specrunner.plugins.core.AbstractPluginScoped
getScope, saveGlobal, saveLocal, saveStrict, setScope
 
Methods inherited from class org.specrunner.plugins.core.AbstractPluginNamed
getName, setName
 
Methods inherited from class org.specrunner.plugins.core.AbstractPlugin
copy, doEnd, getCondition, getConditionModel, getNormalized, getNormalized, getNormalizer, getParent, getSleep, getSleepModel, getThreadsafe, getTimeout, getTimeoutModel, getWait, getWaitModel, setCondition, setConditionModel, setNormalized, setNormalizer, setParent, setSleep, setSleepModel, setThreadsafe, setTimeout, setTimeoutModel, setWait, setWaitModel, toString
 
Methods inherited from class org.specrunner.parameters.core.ParameterHolder
getParameters, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.specrunner.parameters.IParameterHolder
getParameters, setParameters
 

Field Detail

SESSION_FACTORY

public static final String SESSION_FACTORY
Default session factory name.

See Also:
Constant Field Values

FEATURE_CONFIGURATION

public static final String FEATURE_CONFIGURATION
Feature to set configuration.


configuration

protected String configuration
The configuration name.


FEATURE_TYPE

public static final String FEATURE_TYPE
The session factory provider name.


FEATURE_FACTORY

public static final String FEATURE_FACTORY
Feature to set session factory factory.


FEATURE_METHOD

public static final String FEATURE_METHOD
Set feature factory method name.

Constructor Detail

PluginSessionFactory

public PluginSessionFactory()
Method Detail

getConfiguration

public String getConfiguration()
Gets the configuration.

Returns:
The configuration.

setConfiguration

public void setConfiguration(String configuration)
Sets the configuration.

Parameters:
configuration - The configuration.

initialize

public void initialize(IContext context)
                throws PluginException
Specified by:
initialize in interface IPlugin
Overrides:
initialize in class AbstractPlugin
Throws:
PluginException

doStart

public ENext doStart(IContext context,
                     IResultSet result)
              throws PluginException
Specified by:
doStart in interface IPlugin
Overrides:
doStart in class AbstractPlugin
Throws:
PluginException

getSessionFactory

public static org.hibernate.SessionFactory getSessionFactory(IContext context,
                                                             String name)
                                                      throws PluginException
Get the session factory associated to a given name in test context.

Parameters:
context - The context.
name - The name.
Returns:
The session factory instance.
Throws:
PluginException - On session factory lookup errors.


Copyright © 2016. All rights reserved.