use of lucee.runtime.config.ConfigWebImpl 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.config.ConfigWebImpl in project Lucee by lucee.
the class PagePoolClear method call.
public static boolean call(PageContext pc) {
ConfigWebImpl config = (ConfigWebImpl) pc.getConfig();
clear(config.getMappings());
clear(config.getCustomTagMappings());
clear(pc.getApplicationContext().getMappings());
clear(config.getComponentMappings());
clear(config.getFunctionMapping());
clear(config.getServerFunctionMapping());
clear(config.getTagMapping());
clear(config.getServerTagMapping());
return true;
}
use of lucee.runtime.config.ConfigWebImpl in project Lucee by lucee.
the class SystemCacheClear method tagCache.
private static void tagCache(PageContext pc) {
ConfigWebImpl config = (ConfigWebImpl) pc.getConfig();
PagePoolClear.clear(config.getServerTagMapping());
PagePoolClear.clear(config.getTagMapping());
}
use of lucee.runtime.config.ConfigWebImpl in project Lucee by lucee.
the class AppListenerUtil method toMappings.
public static Mapping[] toMappings(ConfigWeb cw, Object o, Resource source) throws PageException {
Struct sct = Caster.toStruct(o);
Iterator<Entry<Key, Object>> it = sct.entryIterator();
Entry<Key, Object> e;
java.util.List<Mapping> mappings = new ArrayList<Mapping>();
ConfigWebImpl config = (ConfigWebImpl) cw;
String virtual;
while (it.hasNext()) {
e = it.next();
virtual = translateMappingVirtual(e.getKey().getString());
MappingData md = toMappingData(e.getValue(), source);
mappings.add(config.getApplicationMapping("application", virtual, md.physical, md.archive, md.physicalFirst, false));
}
return mappings.toArray(new Mapping[mappings.size()]);
}
use of lucee.runtime.config.ConfigWebImpl in project Lucee by lucee.
the class AppListenerUtil method toMappings.
private static Mapping[] toMappings(ConfigWeb cw, String type, Object o, boolean useStructNames, Resource source) throws PageException {
ConfigWebImpl config = (ConfigWebImpl) cw;
Array array;
if (o instanceof String) {
array = ListUtil.listToArrayRemoveEmpty(Caster.toString(o), ',');
} else if (o instanceof Struct) {
Struct sct = (Struct) o;
if (useStructNames) {
Iterator<Entry<Key, Object>> it = sct.entryIterator();
List<Mapping> list = new ArrayList<Mapping>();
Entry<Key, Object> e;
String virtual;
while (it.hasNext()) {
e = it.next();
virtual = e.getKey().getString();
if (virtual.length() == 0)
virtual = "/";
if (!virtual.startsWith("/"))
virtual = "/" + virtual;
if (!virtual.equals("/") && virtual.endsWith("/"))
virtual = virtual.substring(0, virtual.length() - 1);
MappingData md = toMappingData(e.getValue(), source);
list.add(config.getApplicationMapping(type, virtual, md.physical, md.archive, md.physicalFirst, true));
}
return list.toArray(new Mapping[list.size()]);
}
array = new ArrayImpl();
Iterator<Object> it = sct.valueIterator();
while (it.hasNext()) {
array.append(it.next());
}
} else {
array = Caster.toArray(o);
}
MappingImpl[] mappings = new MappingImpl[array.size()];
for (int i = 0; i < mappings.length; i++) {
MappingData md = toMappingData(array.getE(i + 1), source);
mappings[i] = (MappingImpl) config.getApplicationMapping(type, "/" + i, md.physical, md.archive, md.physicalFirst, true);
}
return mappings;
}
Aggregations