Creates/recovers a configuration instance and add it to the global context.
It can be done by using two strategies:
'. To allow this behavior set
threadsafe='true', or set the feature FEATURE_THREADSAFE to 'true'.
- Author:
- Thiago Santos
| Methods inherited from class org.specrunner.plugins.core.AbstractPlugin |
copy, doEnd, getCondition, getConditionModel, getNormalized, getNormalized, getParent, getSleep, getSleepModel, getThreadsafe, getTimeout, getTimeoutModel, getWait, getWaitModel, setCondition, setConditionModel, setNormalized, setParent, setSleep, setSleepModel, setThreadsafe, setTimeout, setTimeoutModel, setWait, setWaitModel, toString |
SESSION_CONFIGURATION
public static final String SESSION_CONFIGURATION
- Default configuration name.
- See Also:
- Constant Field Values
FEATURE_TYPE
public static final String FEATURE_TYPE
- Feature to set configuration provider class name.
FEATURE_FACTORY
public static final String FEATURE_FACTORY
- Feature to set configuration factory class.
FEATURE_METHOD
public static final String FEATURE_METHOD
- Feature to set method factory name.
PluginConfiguration
public PluginConfiguration()
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
setListeners
public void setListeners(org.hibernate.cfg.Configuration cfg)
- Set listeners of plugin.
- Parameters:
cfg - The configuration.
changeUrl
protected void changeUrl(IContext context,
org.hibernate.cfg.Configuration cfg)
- Change URL if thread safe is true.
- Parameters:
context - The context.cfg - The configuration.
getConfiguration
public static org.hibernate.cfg.Configuration getConfiguration(IContext context,
String name)
throws PluginException
- Gets the configuration object bound to the environment with a given name.
- Parameters:
context - The context.name - The presumed name of configuration.
- Returns:
- The configuration with the given name, if exists, otherwise the
configuration with default name, if exists, or null.
- Throws:
PluginException - On configuration lookup error.
Copyright © 2014. All rights reserved.