当前位置: 首页>>代码示例>>Java>>正文


Java SessionEvent类代码示例

本文整理汇总了Java中org.apache.catalina.SessionEvent的典型用法代码示例。如果您正苦于以下问题:Java SessionEvent类的具体用法?Java SessionEvent怎么用?Java SessionEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SessionEvent类属于org.apache.catalina包,在下文中一共展示了SessionEvent类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sessionEvent

import org.apache.catalina.SessionEvent; //导入依赖的package包/类
@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);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:23,代码来源:SingleSignOnListener.java

示例2: sessionEvent

import org.apache.catalina.SessionEvent; //导入依赖的package包/类
/**
 * 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);

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:27,代码来源:SingleSignOn.java

示例3: sessionEvent

import org.apache.catalina.SessionEvent; //导入依赖的package包/类
@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);
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:23,代码来源:SingleSignOnListener.java

示例4: fireSessionEvent

import org.apache.catalina.SessionEvent; //导入依赖的package包/类
/**
 * 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);
    }

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:23,代码来源:StandardSession.java

示例5: fireSessionEvent

import org.apache.catalina.SessionEvent; //导入依赖的package包/类
/**
 * 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);
    }

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:23,代码来源:StandardSession.java

示例6: sessionEvent

import org.apache.catalina.SessionEvent; //导入依赖的package包/类
/**
 * 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);
    }

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:40,代码来源:SingleSignOn.java

示例7: fireSessionEvent

import org.apache.catalina.SessionEvent; //导入依赖的package包/类
/**
 * 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);

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:22,代码来源:StandardSession.java

示例8: fireSessionEvent

import org.apache.catalina.SessionEvent; //导入依赖的package包/类
/**
 * 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);
	}

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:25,代码来源:StandardSession.java

示例9: sessionEvent

import org.apache.catalina.SessionEvent; //导入依赖的package包/类
/**
 * 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);
    }

}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:43,代码来源:SingleSignOn.java

示例10: sessionEvent

import org.apache.catalina.SessionEvent; //导入依赖的package包/类
/**
 * 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);
    }

}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:48,代码来源:SingleSignOn.java


注:本文中的org.apache.catalina.SessionEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。