public long getPageContextsSize() {
return SizeOf.size(pcs);
}
public Array getInfo() {
Array info=new ArrayImpl();
synchronized (runningPcs) {
//int len=runningPcs.size();
Iterator<Key> it = runningPcs.keyIterator();
PageContextImpl pc;
Struct data,sctThread,scopes;
Collection.Key key;
Thread thread;
while(it.hasNext()) {
data=new StructImpl();
sctThread=new StructImpl();
scopes=new StructImpl();
data.setEL("thread", sctThread);
data.setEL("scopes", scopes);
key=KeyImpl.toKey(it.next(),null);
//print.out("key:"+key);
pc=(PageContextImpl) runningPcs.get(key,null);
if(pc==null || pc.isGatewayContext()) continue;
thread=pc.getThread();
if(thread==Thread.currentThread()) continue;
thread=pc.getThread();
if(thread==Thread.currentThread()) continue;
data.setEL("startTime", new DateTimeImpl(pc.getStartTime(),false));
data.setEL("endTime", new DateTimeImpl(pc.getStartTime()+pc.getRequestTimeout(),false));
data.setEL(KeyConstants._timeout,new Double(pc.getRequestTimeout()));
// thread
sctThread.setEL(KeyConstants._name,thread.getName());
sctThread.setEL("priority",Caster.toDouble(thread.getPriority()));
data.setEL("TagContext",PageExceptionImpl.getTagContext(pc.getConfig(),thread.getStackTrace() ));
data.setEL("urlToken", pc.getURLToken());
try {
if(pc.getConfig().debug())data.setEL("debugger", pc.getDebugger().getDebuggingData(pc));
} catch (PageException e2) {}
try {
data.setEL("id", Hash.call(pc, pc.getId()+":"+pc.getStartTime()));
} catch (PageException e1) {}
data.setEL("requestid", pc.getId());
// Scopes
scopes.setEL(KeyConstants._name, pc.getApplicationContext().getName());
try {
scopes.setEL(KeyConstants._application, pc.applicationScope());
} catch (PageException e) {}
try {
scopes.setEL(KeyConstants._session, pc.sessionScope());
} catch (PageException e) {}
try {
scopes.setEL(KeyConstants._client, pc.clientScope());
} catch (PageException e) {}
scopes.setEL(KeyConstants._cookie, pc.cookieScope());
scopes.setEL(KeyConstants._variables, pc.variablesScope());
if(!(pc.localScope() instanceof LocalNotSupportedScope)){
scopes.setEL(KeyConstants._local, pc.localScope());
scopes.setEL(KeyConstants._arguments, pc.argumentsScope());
}
scopes.setEL(KeyConstants._cgi, pc.cgiScope());
scopes.setEL(KeyConstants._form, pc.formScope());
scopes.setEL(KeyConstants._url, pc.urlScope());
scopes.setEL(KeyConstants._request, pc.requestScope());
info.appendEL(data);
}
return info;
}
}