Search in sources :

Example 6 with RefBooleanImpl

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);
}
Also used : RefBoolean(lucee.commons.lang.types.RefBoolean) RefBooleanImpl(lucee.commons.lang.types.RefBooleanImpl) PageSource(lucee.runtime.PageSource)

Example 7 with RefBooleanImpl

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;
}
Also used : UndefinedImpl(lucee.runtime.type.scope.UndefinedImpl) RefBoolean(lucee.commons.lang.types.RefBoolean) RefBooleanImpl(lucee.commons.lang.types.RefBooleanImpl)

Example 8 with RefBooleanImpl

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;
}
Also used : DumpTable(lucee.runtime.dump.DumpTable) RefBoolean(lucee.commons.lang.types.RefBoolean) SimpleDumpData(lucee.runtime.dump.SimpleDumpData) DumpProperties(lucee.runtime.dump.DumpProperties) RefBooleanImpl(lucee.commons.lang.types.RefBooleanImpl) SimpleDumpData(lucee.runtime.dump.SimpleDumpData) DumpData(lucee.runtime.dump.DumpData) Struct(lucee.runtime.type.Struct)

Example 9 with RefBooleanImpl

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);
}
Also used : ApplicationContext(lucee.runtime.listener.ApplicationContext) RefBoolean(lucee.commons.lang.types.RefBoolean) StorageScope(lucee.runtime.type.scope.storage.StorageScope) MemoryScope(lucee.runtime.type.scope.storage.MemoryScope) RefBooleanImpl(lucee.commons.lang.types.RefBooleanImpl)

Example 10 with RefBooleanImpl

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());
    }
}
Also used : StorageScope(lucee.runtime.type.scope.storage.StorageScope) ApplicationContext(lucee.runtime.listener.ApplicationContext) StorageScope(lucee.runtime.type.scope.storage.StorageScope) MemoryScope(lucee.runtime.type.scope.storage.MemoryScope) RefBooleanImpl(lucee.commons.lang.types.RefBooleanImpl) HttpSession(javax.servlet.http.HttpSession)

Aggregations

RefBooleanImpl (lucee.commons.lang.types.RefBooleanImpl)19 RefBoolean (lucee.commons.lang.types.RefBoolean)16 Attribute (lucee.transformer.bytecode.statement.tag.Attribute)4 Expression (lucee.transformer.expression.Expression)4 TagLibTagAttr (lucee.transformer.library.tag.TagLibTagAttr)4 IOException (java.io.IOException)3 ParserString (lucee.commons.lang.ParserString)3 PageException (lucee.runtime.exp.PageException)3 Struct (lucee.runtime.type.Struct)3 ArrayList (java.util.ArrayList)2 Entry (java.util.Map.Entry)2 Resource (lucee.commons.io.res.Resource)2 Component (lucee.runtime.Component)2 PageSource (lucee.runtime.PageSource)2 ApplicationException (lucee.runtime.exp.ApplicationException)2 PageRuntimeException (lucee.runtime.exp.PageRuntimeException)2 ApplicationContext (lucee.runtime.listener.ApplicationContext)2 ColumnExpression (lucee.runtime.sql.exp.ColumnExpression)2 Expression (lucee.runtime.sql.exp.Expression)2 ValueString (lucee.runtime.sql.exp.value.ValueString)2