Java 类org.apache.catalina.SessionEvent 实例源码

项目:tomcat7    文件:SingleSignOnListener.java   
@Override
public void sessionEvent(SessionEvent event) {
    if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType())) {
        return;
    }

    Session session = event.getSession();
    Manager manager = session.getManager();
    if (manager == null) {
        return;
    }
    Context context = (Context) manager.getContainer();
    Authenticator authenticator = context.getAuthenticator();
    if (!(authenticator instanceof AuthenticatorBase)) {
        return;
    }
    SingleSignOn sso = ((AuthenticatorBase) authenticator).sso;
    if (sso == null) {
        return;
    }
    sso.sessionDestroyed(ssoId, session);
}
项目:jerrydog    文件:SingleSignOn.java   
/**
 * Acknowledge the occurrence of the specified event.
 *
 * @param event SessionEvent that has occurred
 */
public void sessionEvent(SessionEvent event) {

    // We only care about session destroyed events
    if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType()))
        return;

    // Look up the single session id associated with this session (if any)
    Session session = event.getSession();
    if (debug >= 1)
        log("Process session destroyed on " + session);
    String ssoId = null;
    synchronized (reverse) {
        ssoId = (String) reverse.get(session);
    }
    if (ssoId == null)
        return;

    // Deregister this single session id, invalidating associated sessions
    deregister(ssoId);

}
项目:apache-tomcat-7.0.73-with-comment    文件:SingleSignOnListener.java   
@Override
public void sessionEvent(SessionEvent event) {
    if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType())) {
        return;
    }

    Session session = event.getSession();
    Manager manager = session.getManager();
    if (manager == null) {
        return;
    }
    Context context = (Context) manager.getContainer();
    Authenticator authenticator = context.getAuthenticator();
    if (!(authenticator instanceof AuthenticatorBase)) {
        return;
    }
    SingleSignOn sso = ((AuthenticatorBase) authenticator).sso;
    if (sso == null) {
        return;
    }
    sso.sessionDestroyed(ssoId, session);
}
项目:lazycat    文件:SingleSignOnListener.java   
@Override
public void sessionEvent(SessionEvent event) {
    if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType())) {
        return;
    }

    Session session = event.getSession();
    Manager manager = session.getManager();
    if (manager == null) {
        return;
    }
    Context context = (Context) manager.getContainer();
    Authenticator authenticator = context.getAuthenticator();
    if (!(authenticator instanceof AuthenticatorBase)) {
        return;
    }
    SingleSignOn sso = ((AuthenticatorBase) authenticator).sso;
    if (sso == null) {
        return;
    }
    sso.sessionDestroyed(ssoId, session);
}
项目:HowTomcatWorks    文件:SingleSignOn.java   
/**
 * Acknowledge the occurrence of the specified event.
 *
 * @param event SessionEvent that has occurred
 */
public void sessionEvent(SessionEvent event) {

    // We only care about session destroyed events
    if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType()))
        return;

    // Look up the single session id associated with this session (if any)
    Session session = event.getSession();
    if (debug >= 1)
        log("Process session destroyed on " + session);
    String ssoId = null;
    synchronized (reverse) {
        ssoId = (String) reverse.get(session);
    }
    if (ssoId == null)
        return;

    // Deregister this single session id, invalidating associated sessions
    deregister(ssoId);

}
项目:tomcat7    文件:StandardSession.java   
/**
 * Notify all session event listeners that a particular event has
 * occurred for this Session.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
public void fireSessionEvent(String type, Object data) {
    if (listeners.size() < 1)
        return;
    SessionEvent event = new SessionEvent(this, type, data);
    SessionListener list[] = new SessionListener[0];
    synchronized (listeners) {
        list = listeners.toArray(list);
    }

    for (int i = 0; i < list.length; i++){
        (list[i]).sessionEvent(event);
    }

}
项目:lams    文件:StandardSession.java   
/**
 * Notify all session event listeners that a particular event has
 * occurred for this Session.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
public void fireSessionEvent(String type, Object data) {
    if (listeners.size() < 1)
        return;
    SessionEvent event = new SessionEvent(this, type, data);
    SessionListener list[] = new SessionListener[0];
    synchronized (listeners) {
        list = (SessionListener[]) listeners.toArray(list);
    }

    for (int i = 0; i < list.length; i++){
        ((SessionListener) list[i]).sessionEvent(event);
    }

}
项目:lams    文件:SingleSignOn.java   
/**
 * Acknowledge the occurrence of the specified event.
 *
 * @param event SessionEvent that has occurred
 */
public void sessionEvent(SessionEvent event) {

    // We only care about session destroyed events
    if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType())
            && (!Session.SESSION_PASSIVATED_EVENT.equals(event.getType())))
        return;

    // Look up the single session id associated with this session (if any)
    Session session = event.getSession();

    String ssoId = null;
    synchronized (reverse) {
        ssoId = (String) reverse.get(session);
    }
    if (ssoId == null)
        return;

    // Was the session destroyed as the result of a timeout?
    // If so, we'll just remove the expired session from the
    // SSO.  If the session was logged out, we'll log out
    // of all session associated with the SSO.
    if (((session.getMaxInactiveInterval() > 0)
        && (System.currentTimeMillis() - session.getLastAccessedTimeInternal() >=
            session.getMaxInactiveInterval() * 1000)) 
        || (Session.SESSION_PASSIVATED_EVENT.equals(event.getType()))) {
        removeSession(ssoId, session);
    } else {
        // The session was logged out.
        // Deregister this single session id, invalidating 
        // associated sessions
        deregister(ssoId);
    }

}
项目:jerrydog    文件:StandardSession.java   
/**
 * Notify all session event listeners that a particular event has
 * occurred for this Session.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
public void fireSessionEvent(String type, Object data) {

    if (listeners.size() < 1)
        return;
    SessionEvent event = new SessionEvent(this, type, data);
    SessionListener list[] = new SessionListener[0];
    synchronized (listeners) {
        list = (SessionListener[]) listeners.toArray(list);
    }
    for (int i = 0; i < list.length; i++)
        ((SessionListener) list[i]).sessionEvent(event);

}
项目:apache-tomcat-7.0.73-with-comment    文件:StandardSession.java   
/**
 * Notify all session event listeners that a particular event has
 * occurred for this Session.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
public void fireSessionEvent(String type, Object data) {
    if (listeners.size() < 1)
        return;
    SessionEvent event = new SessionEvent(this, type, data);
    SessionListener list[] = new SessionListener[0];
    synchronized (listeners) {
        list = listeners.toArray(list);
    }

    for (int i = 0; i < list.length; i++){
        (list[i]).sessionEvent(event);
    }

}
项目:lazycat    文件:StandardSession.java   
/**
 * Notify all session event listeners that a particular event has occurred
 * for this Session. The default implementation performs this notification
 * synchronously using the calling thread.
 *
 * @param type
 *            Event type
 * @param data
 *            Event data
 */
public void fireSessionEvent(String type, Object data) {
    if (listeners.size() < 1)
        return;
    SessionEvent event = new SessionEvent(this, type, data);
    SessionListener list[] = new SessionListener[0];
    synchronized (listeners) {
        list = listeners.toArray(list);
    }

    for (int i = 0; i < list.length; i++) {
        (list[i]).sessionEvent(event);
    }

}
项目:class-guard    文件:StandardSession.java   
/**
 * Notify all session event listeners that a particular event has
 * occurred for this Session.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
public void fireSessionEvent(String type, Object data) {
    if (listeners.size() < 1)
        return;
    SessionEvent event = new SessionEvent(this, type, data);
    SessionListener list[] = new SessionListener[0];
    synchronized (listeners) {
        list = listeners.toArray(list);
    }

    for (int i = 0; i < list.length; i++){
        (list[i]).sessionEvent(event);
    }

}
项目:apache-tomcat-7.0.57    文件:StandardSession.java   
/**
 * Notify all session event listeners that a particular event has
 * occurred for this Session.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
public void fireSessionEvent(String type, Object data) {
    if (listeners.size() < 1)
        return;
    SessionEvent event = new SessionEvent(this, type, data);
    SessionListener list[] = new SessionListener[0];
    synchronized (listeners) {
        list = listeners.toArray(list);
    }

    for (int i = 0; i < list.length; i++){
        (list[i]).sessionEvent(event);
    }

}
项目:apache-tomcat-7.0.57    文件:StandardSession.java   
/**
 * Notify all session event listeners that a particular event has
 * occurred for this Session.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
public void fireSessionEvent(String type, Object data) {
    if (listeners.size() < 1)
        return;
    SessionEvent event = new SessionEvent(this, type, data);
    SessionListener list[] = new SessionListener[0];
    synchronized (listeners) {
        list = listeners.toArray(list);
    }

    for (int i = 0; i < list.length; i++){
        (list[i]).sessionEvent(event);
    }

}
项目:HowTomcatWorks    文件:StandardSession.java   
/**
 * Notify all session event listeners that a particular event has
 * occurred for this Session.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
public void fireSessionEvent(String type, Object data) {

    if (listeners.size() < 1)
        return;
    SessionEvent event = new SessionEvent(this, type, data);
    SessionListener list[] = new SessionListener[0];
    synchronized (listeners) {
        list = (SessionListener[]) listeners.toArray(list);
    }
    for (int i = 0; i < list.length; i++)
        ((SessionListener) list[i]).sessionEvent(event);

}
项目:WBSAirback    文件:StandardSession.java   
/**
 * Notify all session event listeners that a particular event has
 * occurred for this Session.  The default implementation performs
 * this notification synchronously using the calling thread.
 *
 * @param type Event type
 * @param data Event data
 */
public void fireSessionEvent(String type, Object data) {
    if (listeners.size() < 1)
        return;
    SessionEvent event = new SessionEvent(this, type, data);
    SessionListener list[] = new SessionListener[0];
    synchronized (listeners) {
        list = listeners.toArray(list);
    }

    for (int i = 0; i < list.length; i++){
        (list[i]).sessionEvent(event);
    }

}
项目:WBSAirback    文件:SingleSignOn.java   
/**
 * Acknowledge the occurrence of the specified event.
 *
 * @param event SessionEvent that has occurred
 */
@Override
public void sessionEvent(SessionEvent event) {

    // We only care about session destroyed events
    if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType())
            && (!Session.SESSION_PASSIVATED_EVENT.equals(event.getType())))
        return;

    // Look up the single session id associated with this session (if any)
    Session session = event.getSession();
    if (containerLog.isDebugEnabled())
        containerLog.debug("Process session destroyed on " + session);

    String ssoId = null;
    synchronized (reverse) {
        ssoId = reverse.get(session);
    }
    if (ssoId == null)
        return;

    // Was the session destroyed as the result of a timeout?
    // If so, we'll just remove the expired session from the
    // SSO.  If the session was logged out, we'll log out
    // of all session associated with the SSO.
    if (((session.getMaxInactiveInterval() > 0)
        && (System.currentTimeMillis() - session.getThisAccessedTimeInternal() >=
            session.getMaxInactiveInterval() * 1000)) 
        || (Session.SESSION_PASSIVATED_EVENT.equals(event.getType()))) {
        removeSession(ssoId, session);
    } else {
        // The session was logged out.
        // Deregister this single session id, invalidating 
        // associated sessions
        deregister(ssoId);
    }

}
项目:class-guard    文件:SingleSignOn.java   
/**
 * Acknowledge the occurrence of the specified event.
 *
 * @param event SessionEvent that has occurred
 */
@Override
public void sessionEvent(SessionEvent event) {

    if (!getState().isAvailable()) {
        return;
    }

    // We only care about session destroyed events
    if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType())
            && (!Session.SESSION_PASSIVATED_EVENT.equals(event.getType())))
        return;

    // Look up the single session id associated with this session (if any)
    Session session = event.getSession();
    if (containerLog.isDebugEnabled())
        containerLog.debug("Process session destroyed on " + session);

    String ssoId = null;
    synchronized (reverse) {
        ssoId = reverse.get(session);
    }
    if (ssoId == null)
        return;

    // Was the session destroyed as the result of a timeout?
    // If so, we'll just remove the expired session from the
    // SSO.  If the session was logged out, we'll log out
    // of all session associated with the SSO.
    if (((session.getMaxInactiveInterval() > 0)
        && (System.currentTimeMillis() - session.getThisAccessedTimeInternal() >=
            session.getMaxInactiveInterval() * 1000)) 
        || (Session.SESSION_PASSIVATED_EVENT.equals(event.getType()))
        || (!session.getManager().getContainer().getState().isAvailable())) {
        removeSession(ssoId, session);
    } else {
        // The session was logged out.
        // Deregister this single session id, invalidating 
        // associated sessions
        deregister(ssoId);
    }

}
项目:apache-tomcat-7.0.57    文件:SingleSignOn.java   
/**
 * Acknowledge the occurrence of the specified event.
 *
 * @param event SessionEvent that has occurred
 */
@Override
public void sessionEvent(SessionEvent event) {

    if (!getState().isAvailable()) {
        return;
    }

    // We only care about session destroyed events
    if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType())
            && (!Session.SESSION_PASSIVATED_EVENT.equals(event.getType())))
        return;

    // Look up the single session id associated with this session (if any)
    Session session = event.getSession();
    if (containerLog.isDebugEnabled())
        containerLog.debug("Process session destroyed on " + session);

    String ssoId = null;
    synchronized (reverse) {
        ssoId = reverse.get(session);
    }
    if (ssoId == null)
        return;

    // Was the session destroyed as the result of a timeout?
    // If so, we'll just remove the expired session from the
    // SSO.  If the session was logged out, we'll log out
    // of all session associated with the SSO.
    if (((session.getMaxInactiveInterval() > 0)
        && (System.currentTimeMillis() - session.getThisAccessedTimeInternal() >=
            session.getMaxInactiveInterval() * 1000)) 
        || (Session.SESSION_PASSIVATED_EVENT.equals(event.getType()))
        || (!session.getManager().getContainer().getState().isAvailable())) {
        removeSession(ssoId, session);
    } else {
        // The session was logged out.
        // Deregister this single session id, invalidating 
        // associated sessions
        deregister(ssoId);
    }

}
项目:apache-tomcat-7.0.57    文件:SingleSignOn.java   
/**
 * Acknowledge the occurrence of the specified event.
 *
 * @param event SessionEvent that has occurred
 */
@Override
public void sessionEvent(SessionEvent event) {

    if (!getState().isAvailable()) {
        return;
    }

    // We only care about session destroyed events
    if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType())
            && (!Session.SESSION_PASSIVATED_EVENT.equals(event.getType())))
        return;

    // Look up the single session id associated with this session (if any)
    Session session = event.getSession();
    if (containerLog.isDebugEnabled())
        containerLog.debug("Process session destroyed on " + session);

    String ssoId = null;
    synchronized (reverse) {
        ssoId = reverse.get(session);
    }
    if (ssoId == null)
        return;

    // Was the session destroyed as the result of a timeout?
    // If so, we'll just remove the expired session from the
    // SSO.  If the session was logged out, we'll log out
    // of all session associated with the SSO.
    if (((session.getMaxInactiveInterval() > 0)
        && (System.currentTimeMillis() - session.getThisAccessedTimeInternal() >=
            session.getMaxInactiveInterval() * 1000)) 
        || (Session.SESSION_PASSIVATED_EVENT.equals(event.getType()))
        || (!session.getManager().getContainer().getState().isAvailable())) {
        removeSession(ssoId, session);
    } else {
        // The session was logged out.
        // Deregister this single session id, invalidating 
        // associated sessions
        deregister(ssoId);
    }

}