use of lucee.runtime.config.ConfigImpl in project Lucee by lucee.
the class DBUtilImpl method releaseDatasourceConnection.
public void releaseDatasourceConnection(Config config, DatasourceConnection dc) {
ConfigImpl ci = (ConfigWebImpl) ThreadLocalPageContext.getConfig(config);
ci.getDatasourceConnectionPool().releaseDatasourceConnection(dc);
}
use of lucee.runtime.config.ConfigImpl in project Lucee by lucee.
the class ProfileCollection method init.
private void init(Config config, boolean initProfiles) throws ApplicationException {
// get the video directory
Resource dir = ((ConfigImpl) config).getVideoDirectory();
// get the video.xml
Resource xml = dir.getRealResource("video.xml");
// create (if not exist) and return video xml as dom
Element video;
try {
video = getVideoXML(xml);
} catch (Exception e) {
throw new ApplicationException("can not load video xml file [" + xml + "]", Caster.toClassName(e) + ":" + e.getMessage());
}
// translate form DOM to a List of VideoProfile
if (initProfiles) {
try {
profiles = translateVideoXML(video);
} catch (PageException e) {
throw new ApplicationException("can not load profiles from video xml file [" + xml + "] a type is invalid", e.getMessage());
}
}
}
use of lucee.runtime.config.ConfigImpl in project Lucee by lucee.
the class StorageScopeDatasource method store.
@Override
public void store(PageContext pc) {
DatasourceConnection dc = null;
ConfigImpl ci = (ConfigImpl) ThreadLocalPageContext.getConfig(pc);
DatasourceConnectionPool pool = ci.getDatasourceConnectionPool();
Log log = ci.getLog("scope");
try {
// FUTURE change method interface
pc = ThreadLocalPageContext.get(pc);
DataSource ds;
if (pc != null)
ds = pc.getDataSource(datasourceName);
else
ds = ci.getDataSource(datasourceName);
dc = pool.getDatasourceConnection(null, ds, null, null);
SQLExecutor executor = SQLExecutionFactory.getInstance(dc);
executor.update(ci, cfid, appName, dc, getType(), sct, getTimeSpan(), log);
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
ScopeContext.error(log, t);
} finally {
if (dc != null)
pool.releaseDatasourceConnection(dc);
}
}
use of lucee.runtime.config.ConfigImpl in project Lucee by lucee.
the class StorageScopeFile method _loadResource.
protected static Resource _loadResource(ConfigWeb config, int type, String name, String cfid) {
ConfigImpl ci = (ConfigImpl) config;
Resource dir = type == SCOPE_CLIENT ? ci.getClientScopeDir() : ci.getSessionScopeDir();
return dir.getRealResource(getFolderName(name, cfid, true));
}
use of lucee.runtime.config.ConfigImpl in project Lucee by lucee.
the class ORMUtil method resetEngine.
/**
* @param pc
* @param force if set to false the engine is on loaded when the configuration has changed
* @throws PageException
*/
public static void resetEngine(PageContext pc, boolean force) throws PageException {
ConfigImpl config = (ConfigImpl) pc.getConfig();
config.resetORMEngine(pc, force);
}
Aggregations