当前位置: 首页>>代码示例>>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;未经允许,请勿转载。