resolver.setLocalVariable("refreshInterval",new Integer(3000));
resolver.setLocalVariable("commMode",new Integer(CommMode.XHR_ASYNC));
for(int i = 0; i < sessionList.size(); i++)
{
ItsNatHttpSession otherSession = (ItsNatHttpSession)sessionList.get(i);
ItsNatDocument[] remDocs = otherSession.getItsNatDocuments();
for(int j = 0; j < remDocs.length; j++)
{
ItsNatDocument currRemDoc = remDocs[j];
if (itsNatDoc == currRemDoc) continue;
// currRemDoc should be synchronized, but a dead lock could occur by other process doing the same (docs locked mutually, the parent doc is already locked)
// there is no problem, the ItsNatDocument.getItsNatDocumentTemplate() is thread safe
ItsNatDocumentTemplate docTemplate = currRemDoc.getItsNatDocumentTemplate();
if (docTemplate != thisDocTemplate)
continue;
String docId = currRemDoc.getId(); // No sync is needed
Element sessionElem = (Element)sessionNodeList.addElement();
long lastRequest = currRemDoc.getClientDocumentOwner().getLastRequestTime();
ItsNatVariableResolver resolver2 = resolver.createItsNatVariableResolver();
resolver2.setLocalVariable("sessionId",otherSession.getId());
resolver2.setLocalVariable("docId",docId);
resolver2.setLocalVariable("agentInfo",otherSession.getUserAgent());
resolver2.setLocalVariable("lastRequest",new Date(lastRequest).toString());
resolver2.resolve(sessionElem);
}
}