Search in sources :

Example 1 with SessionEvent

use of com.iplanet.dpro.session.SessionEvent in project OpenAM by OpenRock.

the class SessionCache method removeSID.

/**
     * Removes the <code>SessionID</code> from session table.
     *
     * @param sid Session ID.
     */
public void removeSID(SessionID sid) {
    if (sid == null || sid.isNull()) {
        return;
    }
    Session session = readSession(sid);
    if (session != null) {
        long eventTime = System.currentTimeMillis();
        // remove from sessionTable if there is no purge delay or it has elapsed
        if (session.getPurgeAt() <= eventTime) {
            deleteSession(sid);
            session.cancel();
        }
        // ensure session has destroyed state and observers are notified (exactly once)
        if (session.getRemoved().compareAndSet(false, true)) {
            session.setState(DESTROYED);
            SessionEvent event = new SessionEvent(session, SessionEvent.DESTROY, eventTime);
            SessionEvent.invokeListeners(event);
        }
    }
}
Also used : SessionEvent(com.iplanet.dpro.session.SessionEvent) Session(com.iplanet.dpro.session.Session)

Aggregations

Session (com.iplanet.dpro.session.Session)1 SessionEvent (com.iplanet.dpro.session.SessionEvent)1