_app.getSessionManager().addSessionListener(new SessionAdapter()
{
public void sessionClosed(SessionEvent evt)
{
IIdentifier id = evt.getSession().getIdentifier();
MemorySessionInfo msi = _sessionInfosBySessionIDs.get(id);
if(null == msi)
{
throw new IllegalStateException("A session with ID " + id + " has not been created");
}
msi.closed = new Date();
updateGcStatus();
}
public void sessionConnected(SessionEvent evt)
{
IIdentifier id = evt.getSession().getIdentifier();
if(null != _sessionInfosBySessionIDs.get(id))
{
throw new IllegalStateException("A session with ID " + id + " has already been created");
}
MemorySessionInfo msi = new MemorySessionInfo(id, evt.getSession().getAlias().getName());