當前位置: 首頁>>代碼示例>>Java>>正文


Java HttpSessionListener.sessionCreated方法代碼示例

本文整理匯總了Java中javax.servlet.http.HttpSessionListener.sessionCreated方法的典型用法代碼示例。如果您正苦於以下問題:Java HttpSessionListener.sessionCreated方法的具體用法?Java HttpSessionListener.sessionCreated怎麽用?Java HttpSessionListener.sessionCreated使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.servlet.http.HttpSessionListener的用法示例。


在下文中一共展示了HttpSessionListener.sessionCreated方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onApplicationEvent

import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
public void onApplicationEvent(AbstractSessionEvent event) {
	if (this.listeners.isEmpty()) {
		return;
	}

	HttpSessionEvent httpSessionEvent = createHttpSessionEvent(event);

	for (HttpSessionListener listener : this.listeners) {
		if (event instanceof SessionDestroyedEvent) {
			listener.sessionDestroyed(httpSessionEvent);
		}
		else if (event instanceof SessionCreatedEvent) {
			listener.sessionCreated(httpSessionEvent);
		}
	}
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:17,代碼來源:SessionEventHttpSessionListenerAdapter.java

示例2: onApplicationEvent

import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
@Override
public void onApplicationEvent(AbstractSessionEvent event) {
	if (this.listeners.isEmpty()) {
		return;
	}

	HttpSessionEvent httpSessionEvent = createHttpSessionEvent(event);

	for (HttpSessionListener listener : this.listeners) {
		if (event instanceof SessionDestroyedEvent) {
			listener.sessionDestroyed(httpSessionEvent);
		}
		else if (event instanceof SessionCreatedEvent) {
			listener.sessionCreated(httpSessionEvent);
		}
	}
}
 
開發者ID:spring-projects,項目名稱:spring-session,代碼行數:18,代碼來源:SessionEventHttpSessionListenerAdapter.java

示例3: sessionCreated

import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
@Override
public void sessionCreated(HttpSessionEvent event) {
    HttpSession session = event.getSession();
    synchronized (session) {
        session.setAttribute(Constants.SESSION_RESET_ATTR, "#");
        HANDLER.instantiateAuthBean(session);

        if (CONFIG.getContent().getSessionTimeout() > 0) {
            session.setMaxInactiveInterval(CONFIG.getContent().getSessionTimeout() * 60);
        }

        for (HttpSessionListener sessionListener : HANDLER.sessionListeners) {
            HANDLER.executeInjection(sessionListener);
            sessionListener.sessionCreated(event);
        }
    }
}
 
開發者ID:jefalbino,項目名稱:jsmart-web,代碼行數:18,代碼來源:SessionControl.java

示例4: tellNew

import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
/**
 * Inform the listeners about the new session.
 *
 */
public void tellNew() {

    // Notify interested session event listeners
    fireSessionEvent(Session.SESSION_CREATED_EVENT, null);

    // Notify interested application event listeners
    Context context = (Context) manager.getContainer();
    Object listeners[] = context.getApplicationLifecycleListeners();
    if (listeners != null) {
        HttpSessionEvent event =
            new HttpSessionEvent(getSession());
        for (int i = 0; i < listeners.length; i++) {
            if (!(listeners[i] instanceof HttpSessionListener))
                continue;
            HttpSessionListener listener =
                (HttpSessionListener) listeners[i];
            try {
                context.fireContainerEvent("beforeSessionCreated",
                        listener);
                listener.sessionCreated(event);
                context.fireContainerEvent("afterSessionCreated", listener);
            } catch (Throwable t) {
                ExceptionUtils.handleThrowable(t);
                try {
                    context.fireContainerEvent("afterSessionCreated",
                            listener);
                } catch (Exception e) {
                    // Ignore
                }
                manager.getContainer().getLogger().error
                    (sm.getString("standardSession.sessionEvent"), t);
            }
        }
    }

}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:41,代碼來源:StandardSession.java

示例5: sessionCreated

import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
public void sessionCreated(HttpSessionEvent se) {
    if (ctx == null) {
        logger.warn("cannot find applicationContext");

        return;
    }

    Collection<HttpSessionListener> httpSessionListeners = ctx
            .getBeansOfType(HttpSessionListener.class).values();

    for (HttpSessionListener httpSessionListener : httpSessionListeners) {
        httpSessionListener.sessionCreated(se);
    }
}
 
開發者ID:zhaojunfei,項目名稱:lemon,代碼行數:15,代碼來源:ProxyServletListener.java

示例6: sessionCreated

import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
@Override
public void sessionCreated(HttpSessionEvent event)
{
	for( HttpSessionListener listener : getListeners() )
	{
		listener.sessionCreated(event);
	}
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:9,代碼來源:UserSessionDestructionListener.java

示例7: tellNew

import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
/**
 * Inform the listeners about the new session.
 *
 */
public void tellNew() {

    // Notify interested session event listeners
    fireSessionEvent(Session.SESSION_CREATED_EVENT, null);

    // Notify interested application event listeners
    Context context = (Context) manager.getContainer();
    Object listeners[] = context.getApplicationLifecycleListeners();
    if (listeners != null) {
        HttpSessionEvent event =
            new HttpSessionEvent(getSession());
        for (int i = 0; i < listeners.length; i++) {
            if (!(listeners[i] instanceof HttpSessionListener))
                continue;
            HttpSessionListener listener =
                (HttpSessionListener) listeners[i];
            try {
                fireContainerEvent(context,
                                   "beforeSessionCreated",
                                   listener);
                listener.sessionCreated(event);
                fireContainerEvent(context,
                                   "afterSessionCreated",
                                   listener);
            } catch (Throwable t) {
                try {
                    fireContainerEvent(context,
                                       "afterSessionCreated",
                                       listener);
                } catch (Exception e) {
                    ;
                }
                manager.getContainer().getLogger().error
                    (sm.getString("standardSession.sessionEvent"), t);
            }
        }
    }

}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:44,代碼來源:StandardSession.java

示例8: tellNew

import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
/**
 * Inform the listeners about the new session.
 *
 */
public void tellNew() {

	// Notify interested session event listeners
	fireSessionEvent(Session.SESSION_CREATED_EVENT, null);

	// Notify interested application event listeners
	Context context = (Context) manager.getContainer();
	Object listeners[] = context.getApplicationLifecycleListeners();
	if (listeners != null) {
		HttpSessionEvent event = new HttpSessionEvent(getSession());
		for (int i = 0; i < listeners.length; i++) {
			if (!(listeners[i] instanceof HttpSessionListener))
				continue;
			HttpSessionListener listener = (HttpSessionListener) listeners[i];
			try {
				context.fireContainerEvent("beforeSessionCreated", listener);
				listener.sessionCreated(event);
				context.fireContainerEvent("afterSessionCreated", listener);
			} catch (Throwable t) {
				ExceptionUtils.handleThrowable(t);
				try {
					context.fireContainerEvent("afterSessionCreated", listener);
				} catch (Exception e) {
					// Ignore
				}
				manager.getContainer().getLogger().error(sm.getString("standardSession.sessionEvent"), t);
			}
		}
	}

}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:36,代碼來源:StandardSession.java

示例9: sessionCreated

import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
@Override
public void sessionCreated(RepositoryBackedSession session) {
  if (session instanceof HttpSession) {
    HttpSessionEvent event = new HttpSessionEvent((HttpSession)session);
    for (HttpSessionListener listener : descriptor.getHttpSessionListeners()) {
      listener.sessionCreated(event);
    }
  }
}
 
開發者ID:AmadeusITGroup,項目名稱:HttpSessionReplacer,代碼行數:10,代碼來源:HttpSessionNotifier.java

示例10: sessionCreated

import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 * @see javax.servlet.http.HttpSessionListener#sessionCreated(javax.servlet.http.HttpSessionEvent)
 */
public void sessionCreated(final HttpSessionEvent event) {
    LOG.debug("Begin BootstrapListener session created...");
    
    init();
    
    for (HttpSessionListener listener : listeners.values()) {
        listener.sessionCreated(event);
    }
    
    LOG.debug("...end BootstrapListener session created.");
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:16,代碼來源:BootstrapListener.java

示例11: sessionCreated

import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
public void sessionCreated( HttpSessionEvent se )
{
    for ( HttpSessionListener listener : HttpSessionListenerService.getListeners( ) )
    {
        listener.sessionCreated( se );
    }
}
 
開發者ID:lutece-platform,項目名稱:lutece-core,代碼行數:11,代碼來源:MainHttpSessionListener.java

示例12: setId

import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
/**
 * Set the session identifier for this session.
 *
 * @param id The new session identifier
 */
public void setId(String id) {

    if ((this.id != null) && (manager != null))
        manager.remove(this);

    this.id = id;

    if (manager != null)
        manager.add(this);

    // Notify interested session event listeners
    fireSessionEvent(Session.SESSION_CREATED_EVENT, null);

    // Notify interested application event listeners
    Context context = (Context) manager.getContainer();
    Object listeners[] = context.getApplicationListeners();
    if (listeners != null) {
        HttpSessionEvent event =
            new HttpSessionEvent(getSession());
        for (int i = 0; i < listeners.length; i++) {
            if (!(listeners[i] instanceof HttpSessionListener))
                continue;
            HttpSessionListener listener =
                (HttpSessionListener) listeners[i];
            try {
                fireContainerEvent(context,
                                   "beforeSessionCreated",
                                   listener);
                listener.sessionCreated(event);
                fireContainerEvent(context,
                                   "afterSessionCreated",
                                   listener);
            } catch (Throwable t) {
                try {
                    fireContainerEvent(context,
                                       "afterSessionCreated",
                                       listener);
                } catch (Exception e) {
                    ;
                }
                // FIXME - should we do anything besides log these?
                log(sm.getString("standardSession.sessionEvent"), t);
            }
        }
    }

}
 
開發者ID:c-rainstorm,項目名稱:jerrydog,代碼行數:53,代碼來源:StandardSession.java

示例13: sessionCreated

import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
public void sessionCreated(HttpSessionEvent se) {
  for (HttpSessionListener listener : listeners) {
    listener.sessionCreated(se);
  }
}
 
開發者ID:bboypscmylife,項目名稱:opengse,代碼行數:6,代碼來源:HttpSessionListenerList.java

示例14: tellNew

import javax.servlet.http.HttpSessionListener; //導入方法依賴的package包/類
/**
 * Inform the listeners about the new session.
 *
 */
public void tellNew() {

    // Notify interested session event listeners
    fireSessionEvent(Session.SESSION_CREATED_EVENT, null);

    // Notify interested application event listeners
    Context context = (Context) manager.getContainer();
    Object listeners[] = context.getApplicationLifecycleListeners();
    if (listeners != null) {
        HttpSessionEvent event =
            new HttpSessionEvent(getSession());
        for (int i = 0; i < listeners.length; i++) {
            if (!(listeners[i] instanceof HttpSessionListener))
                continue;
            HttpSessionListener listener =
                (HttpSessionListener) listeners[i];
            try {
                fireContainerEvent(context,
                                   "beforeSessionCreated",
                                   listener);
                listener.sessionCreated(event);
                fireContainerEvent(context,
                                   "afterSessionCreated",
                                   listener);
            } catch (Throwable t) {
                ExceptionUtils.handleThrowable(t);
                try {
                    fireContainerEvent(context,
                                       "afterSessionCreated",
                                       listener);
                } catch (Exception e) {
                    // Ignore
                }
                manager.getContainer().getLogger().error
                    (sm.getString("standardSession.sessionEvent"), t);
            }
        }
    }

}
 
開發者ID:WhiteBearSolutions,項目名稱:WBSAirback,代碼行數:45,代碼來源:StandardSession.java


注:本文中的javax.servlet.http.HttpSessionListener.sessionCreated方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。