Search in sources :

Example 1 with ScopeContext

use of lucee.runtime.type.scope.ScopeContext in project Lucee by lucee.

the class GetSystemInfo method call.

public static Struct call(PageContext pc) throws PageException {
    Struct sct = new StructImpl();
    ConfigWebImpl config = (ConfigWebImpl) pc.getConfig();
    CFMLFactoryImpl factory = (CFMLFactoryImpl) config.getFactory();
    ScopeContext sc = factory.getScopeContext();
    // OperatingSystemMXBean osBean = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
    // threads/requests
    sct.put("activeRequests", factory.getActiveRequests());
    sct.put("activeThreads", factory.getActiveThreads());
    sct.put("queueRequests", config.getThreadQueue().size());
    // Datasource connections
    sct.put("activeDatasourceConnections", getConnections(config));
    // tasks
    sct.put("tasksOpen", config.getSpoolerEngine().getOpenTaskCount());
    sct.put("tasksClosed", config.getSpoolerEngine().getClosedTaskCount());
    // scopes
    sct.put("sessionCount", sc.getSessionCount());
    sct.put("clientCount", sc.getClientCount());
    sct.put("applicationContextCount", sc.getAppContextCount());
    return sct;
}
Also used : ConfigWebImpl(lucee.runtime.config.ConfigWebImpl) StructImpl(lucee.runtime.type.StructImpl) ScopeContext(lucee.runtime.type.scope.ScopeContext) CFMLFactoryImpl(lucee.runtime.CFMLFactoryImpl) Struct(lucee.runtime.type.Struct)

Example 2 with ScopeContext

use of lucee.runtime.type.scope.ScopeContext in project Lucee by lucee.

the class Surveillance method infoScopes.

private static void infoScopes(Struct web, Struct server, ConfigWeb config) throws PageException {
    ScopeContext sc = ((CFMLFactoryImpl) config.getFactory()).getScopeContext();
    DoubleStruct webScopes = new DoubleStruct();
    DoubleStruct srvScopes = new DoubleStruct();
    long s;
    s = sc.getScopesSize(Scope.SCOPE_SESSION);
    webScopes.set("session", Caster.toDouble(s));
    s = sc.getScopesSize(Scope.SCOPE_APPLICATION);
    webScopes.set("application", Caster.toDouble(s));
    s = sc.getScopesSize(Scope.SCOPE_CLUSTER);
    srvScopes.set("cluster", Caster.toDouble(s));
    s = sc.getScopesSize(Scope.SCOPE_SERVER);
    srvScopes.set("server", Caster.toDouble(s));
    s = sc.getScopesSize(Scope.SCOPE_CLIENT);
    webScopes.set("client", Caster.toDouble(s));
    web.set(KeyConstants._scopes, webScopes);
    server.set(KeyConstants._scopes, srvScopes);
}
Also used : ScopeContext(lucee.runtime.type.scope.ScopeContext) CFMLFactoryImpl(lucee.runtime.CFMLFactoryImpl) DoubleStruct(lucee.runtime.type.DoubleStruct)

Example 3 with ScopeContext

use of lucee.runtime.type.scope.ScopeContext in project Lucee by lucee.

the class ApplicationStop method call.

public static String call(PageContext pc) throws PageException {
    CFMLFactoryImpl factory = (CFMLFactoryImpl) pc.getCFMLFactory();
    ScopeContext sc = factory.getScopeContext();
    sc.clearApplication(pc);
    return null;
}
Also used : ScopeContext(lucee.runtime.type.scope.ScopeContext) CFMLFactoryImpl(lucee.runtime.CFMLFactoryImpl)

Example 4 with ScopeContext

use of lucee.runtime.type.scope.ScopeContext in project Lucee by lucee.

the class SessionTracker method getSessionCollection.

public static Struct getSessionCollection(String appName) {
    PageContext pc = ThreadLocalPageContext.get();
    ScopeContext sc = ((CFMLFactoryImpl) pc.getCFMLFactory()).getScopeContext();
    return sc.getAllSessionScopes(appName);
}
Also used : ScopeContext(lucee.runtime.type.scope.ScopeContext) CFMLFactoryImpl(lucee.runtime.CFMLFactoryImpl) PageContext(lucee.runtime.PageContext) ThreadLocalPageContext(lucee.runtime.engine.ThreadLocalPageContext)

Example 5 with ScopeContext

use of lucee.runtime.type.scope.ScopeContext in project Lucee by lucee.

the class SessionTracker method getSessionCount.

public static int getSessionCount() {
    PageContext pc = ThreadLocalPageContext.get();
    ScopeContext sc = ((CFMLFactoryImpl) pc.getCFMLFactory()).getScopeContext();
    return sc.getSessionCount(pc);
}
Also used : ScopeContext(lucee.runtime.type.scope.ScopeContext) CFMLFactoryImpl(lucee.runtime.CFMLFactoryImpl) PageContext(lucee.runtime.PageContext) ThreadLocalPageContext(lucee.runtime.engine.ThreadLocalPageContext)

Aggregations

CFMLFactoryImpl (lucee.runtime.CFMLFactoryImpl)5 ScopeContext (lucee.runtime.type.scope.ScopeContext)5 PageContext (lucee.runtime.PageContext)2 ThreadLocalPageContext (lucee.runtime.engine.ThreadLocalPageContext)2 ConfigWebImpl (lucee.runtime.config.ConfigWebImpl)1 DoubleStruct (lucee.runtime.type.DoubleStruct)1 Struct (lucee.runtime.type.Struct)1 StructImpl (lucee.runtime.type.StructImpl)1