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;
}
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);
}
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;
}
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);
}
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);
}
Aggregations