use of lucee.runtime.CFMLFactoryImpl in project Lucee by lucee.
the class Admin method fillGetRunningThreads.
private static void fillGetRunningThreads(lucee.runtime.type.Query qry, ConfigWeb configWeb) throws PageException {
CFMLFactoryImpl factory = ((CFMLFactoryImpl) configWeb.getFactory());
Map<Integer, PageContextImpl> pcs = factory.getActivePageContexts();
Iterator<PageContextImpl> it = pcs.values().iterator();
PageContextImpl pc;
Collection.Key key;
int row = 0;
while (it.hasNext()) {
pc = it.next();
qry.addRow();
row++;
StackTraceElement[] st = pc.getThread().getStackTrace();
configWeb.getConfigDir();
configWeb.getIdentification().getId();
configWeb.getConfigDir();
qry.setAt("Id", row, new Double(pc.getId()));
qry.setAt("Start", row, new DateTimeImpl(pc.getStartTime(), false));
qry.setAt("Timeout", row, new Double(pc.getRequestTimeout() / 1000));
qry.setAt("ThreadType", row, pc.getParentPageContext() == null ? "main" : "child");
qry.setAt("StackTrace", row, toString(st));
qry.setAt("TagContext", row, PageExceptionImpl.getTagContext(pc.getConfig(), st));
qry.setAt("label", row, factory.getLabel());
qry.setAt("RootPath", row, ReqRspUtil.getRootPath(((ConfigWebImpl) configWeb).getServletContext()));
qry.setAt("ConfigFile", row, configWeb.getConfigFile().getAbsolutePath());
if (factory.getURL() != null)
qry.setAt("url", row, factory.getURL().toExternalForm());
}
}
use of lucee.runtime.CFMLFactoryImpl in project Lucee by lucee.
the class CFMLEngineImpl method reset.
@Override
public void reset(String configId) {
SystemOut.printDate("reset CFML Engine");
getControler().close();
RetireOutputStreamFactory.close();
// release HTTP Pool
HTTPEngine4Impl.releaseConnectionManager();
releaseCache(getConfigServerImpl());
CFMLFactoryImpl cfmlFactory;
// ScopeContext scopeContext;
try {
Iterator<String> it = contextes.keySet().iterator();
while (it.hasNext()) {
try {
cfmlFactory = (CFMLFactoryImpl) contextes.get(it.next());
if (configId != null && !configId.equals(cfmlFactory.getConfigWebImpl().getIdentification().getId()))
continue;
// scopes
try {
cfmlFactory.getScopeContext().clear();
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
}
// PageContext
try {
cfmlFactory.resetPageContext();
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
}
// Query Cache
try {
PageContext pc = ThreadLocalPageContext.get();
if (pc != null) {
pc.getConfig().getCacheHandlerCollection(Config.CACHE_TYPE_QUERY, null).clear(pc);
pc.getConfig().getCacheHandlerCollection(Config.CACHE_TYPE_FUNCTION, null).clear(pc);
pc.getConfig().getCacheHandlerCollection(Config.CACHE_TYPE_INCLUDE, null).clear(pc);
}
// cfmlFactory.getDefaultQueryCache().clear(null);
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
}
// Gateway
try {
cfmlFactory.getConfigWebImpl().getGatewayEngine().reset();
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
}
// Cache
releaseCache(cfmlFactory.getConfigWebImpl());
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
}
}
// release felix itself
shutdownFelix();
} finally {
// Controller
controlerState.setActive(false);
}
}
use of lucee.runtime.CFMLFactoryImpl in project Lucee by lucee.
the class CFMLEngineImpl method loadJSPFactory.
private CFMLFactoryImpl loadJSPFactory(ConfigServerImpl configServer, ServletConfig sg, int countExistingContextes) throws ServletException {
try {
if (XMLConfigWebFactory.LOG)
SystemOut.printDate("load Context");
// Load Config
RefBoolean isCustomSetting = new RefBooleanImpl();
Resource configDir = getConfigDirectory(sg, configServer, countExistingContextes, isCustomSetting);
if (XMLConfigWebFactory.LOG)
SystemOut.printDate("got context directory");
CFMLFactoryImpl factory = new CFMLFactoryImpl(this, sg);
if (XMLConfigWebFactory.LOG)
SystemOut.printDate("init factory");
ConfigWebImpl config = XMLConfigWebFactory.newInstance(this, factory, configServer, configDir, isCustomSetting.toBooleanValue(), sg);
if (XMLConfigWebFactory.LOG)
SystemOut.printDate("loaded config");
factory.setConfig(config);
return factory;
} catch (Exception e) {
ServletException se = new ServletException(e.getMessage());
se.setStackTrace(e.getStackTrace());
throw se;
}
}
use of lucee.runtime.CFMLFactoryImpl 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.CFMLFactoryImpl 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;
}
Aggregations