use of lucee.commons.lang.types.RefBooleanImpl in project Lucee by lucee.
the class MixedAppListener method onRequest.
@Override
public void onRequest(PageContext pc, PageSource requestedPage, RequestListener rl) throws PageException {
RefBoolean isCFC = new RefBooleanImpl(false);
PageSource appPS = getApplicationPageSource(pc, requestedPage, mode, isCFC);
if (isCFC.toBooleanValue())
_onRequest(pc, requestedPage, appPS, rl);
else
ClassicAppListener._onRequest(pc, requestedPage, appPS, rl);
}
use of lucee.commons.lang.types.RefBooleanImpl in project Lucee by lucee.
the class ModernAppListener method initApplicationContext.
private ModernApplicationContext initApplicationContext(PageContextImpl pc, Component app) throws PageException {
// use existing app context
RefBoolean throwsErrorWhileInit = new RefBooleanImpl(false);
ModernApplicationContext appContext = new ModernApplicationContext(pc, app, throwsErrorWhileInit);
pc.setApplicationContext(appContext);
// scope cascading
if (pc.getRequestDialect() == CFMLEngine.DIALECT_CFML && ((UndefinedImpl) pc.undefinedScope()).getScopeCascadingType() != appContext.getScopeCascading()) {
pc.undefinedScope().initialize(pc);
}
// ORM
if (appContext.isORMEnabled()) {
boolean hasError = throwsErrorWhileInit.toBooleanValue();
if (hasError)
pc.addPageSource(app.getPageSource(), true);
try {
ORMUtil.resetEngine(pc, false);
} finally {
if (hasError)
pc.removeLastPageSource(true);
}
}
return appContext;
}
use of lucee.commons.lang.types.RefBooleanImpl in project Lucee by lucee.
the class DumpStruct method call.
public static Struct call(PageContext pc, Object object, double maxLevel, String show, String hide, double keys, boolean metainfo, boolean showUDFs, String label) {
if (show != null && "all".equalsIgnoreCase(show.trim()))
show = null;
if (hide != null && "all".equalsIgnoreCase(hide.trim()))
hide = null;
Set<String> setShow = (show != null) ? ListUtil.listToSet(show.toLowerCase(), ",", true) : null;
Set<String> setHide = (hide != null) ? ListUtil.listToSet(hide.toLowerCase(), ",", true) : null;
DumpProperties properties = new DumpProperties((int) maxLevel, setShow, setHide, (int) keys, metainfo, showUDFs);
DumpData dd = DumpUtil.toDumpData(object, pc, (int) maxLevel, properties);
if (!StringUtil.isEmpty(label)) {
DumpTable table = new DumpTable("#ffffff", "#cccccc", "#000000");
table.appendRow(1, new SimpleDumpData(label));
table.appendRow(0, dd);
dd = table;
}
RefBoolean hasReference = new RefBooleanImpl(false);
Struct sct = toStruct(dd, object, hasReference);
sct.setEL("hasReference", hasReference.toBoolean());
addMetaData(sct, object);
return sct;
}
use of lucee.commons.lang.types.RefBooleanImpl in project Lucee by lucee.
the class ScopeContext method invalidateUserScope.
public void invalidateUserScope(PageContextImpl pc, boolean migrateSessionData, boolean migrateClientData) throws PageException {
ApplicationContext appContext = pc.getApplicationContext();
RefBoolean isNew = new RefBooleanImpl();
// get in memory scopes
Map<String, Scope> clientContext = getSubMap(cfClientContexts, appContext.getName());
UserScope oldClient = (UserScope) clientContext.get(pc.getCFID());
Map<String, Scope> sessionContext = getSubMap(cfSessionContexts, appContext.getName());
UserScope oldSession = (UserScope) sessionContext.get(pc.getCFID());
// remove Scopes completly
removeCFSessionScope(pc);
removeClientScope(pc);
pc.resetIdAndToken();
if (oldSession != null)
migrate(pc, oldSession, getCFSessionScope(pc, isNew), migrateSessionData);
if (oldClient != null)
migrate(pc, oldClient, getClientScope(pc), migrateClientData);
}
use of lucee.commons.lang.types.RefBooleanImpl in project Lucee by lucee.
the class ScopeContext method removeCFSessionScope.
public void removeCFSessionScope(PageContext pc) throws PageException {
Session sess = getCFSessionScope(pc, new RefBooleanImpl());
ApplicationContext appContext = pc.getApplicationContext();
Map<String, Scope> context = getSubMap(cfSessionContexts, appContext.getName());
if (context != null) {
context.remove(pc.getCFID());
if (sess instanceof StorageScope)
((StorageScope) sess).unstore(pc.getConfig());
}
}
Aggregations