本文整理了Java中javax.servlet.http.HttpSessionEvent.()
方法的一些代码示例,展示了HttpSessionEvent.()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpSessionEvent.()
方法的具体详情如下:
包路径:javax.servlet.http.HttpSessionEvent
类名称:HttpSessionEvent
方法名:
HttpSessionEvent.介绍
[英]Construct a session event from the given source.
[中]从给定源构造会话事件。
代码示例
代码示例来源:origin: javamelody/javamelody
void registerSessionIfNeeded(HttpSession session) {
if (session != null) {
synchronized (session) {
if (!SESSION_MAP_BY_ID.containsKey(session.getId())) {
sessionCreated(new HttpSessionEvent(session));
}
}
}
}
代码示例来源:origin: spring-projects/spring-session
private HttpSessionEvent createHttpSessionEvent(AbstractSessionEvent event) {
Session session = event.getSession();
HttpSession httpSession = new HttpSessionAdapter<>(session,
this.context);
return new HttpSessionEvent(httpSession);
}
代码示例来源:origin: wildfly/wildfly
void triggerPrePassivationEvents(ImmutableSession session) {
List listeners = findListeners(session);
if (!listeners.isEmpty()) {
HttpSessionEvent event = new HttpSessionEvent(new ImmutableHttpSessionAdapter(session, this.context));
for (HttpSessionActivationListener listener : listeners) {
listener.sessionWillPassivate(event);
}
}
}
代码示例来源:origin: wildfly/wildfly
void triggerPostActivationEvents(ImmutableSession session) {
List listeners = findListeners(session);
if (!listeners.isEmpty()) {
HttpSessionEvent event = new HttpSessionEvent(new ImmutableHttpSessionAdapter(session, this.context));
for (HttpSessionActivationListener listener : listeners) {
listener.sessionDidActivate(event);
}
}
}
代码示例来源:origin: javamelody/javamelody
void unregisterSessionIfNeeded(HttpSession session) {
if (session != null) {
try {
session.getCreationTime();
// https://issues.jenkins-ci.org/browse/JENKINS-20532
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=413019
session.getLastAccessedTime();
} catch (final IllegalStateException e) {
// session.getCreationTime() lance IllegalStateException si la session est invalidée
synchronized (session) {
sessionDestroyed(new HttpSessionEvent(session));
}
}
}
}
代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel
protected HttpSessionEvent getHttpSessionEvent(
HttpSessionEvent httpSessionEvent) {
if (CompoundSessionIdSplitterUtil.hasSessionDelimiter()) {
CompoundSessionIdHttpSession compoundSessiOnIdHttpSession=
new CompoundSessionIdHttpSession(httpSessionEvent.getSession());
httpSessiOnEvent= new HttpSessionEvent(
compoundSessionIdHttpSession);
}
return httpSessionEvent;
}
代码示例来源:origin: httpunit/httpunit
public void sendSessionDestroyed( HttpSession session ) {
HttpSessionEvent event = new HttpSessionEvent( session );
for (Iterator i = _sessionListeners.iterator(); i.hasNext();) {
HttpSessionListener listener = (HttpSessionListener) i.next();
listener.sessionDestroyed( event );
}
}
代码示例来源:origin: httpunit/httpunit
public void sendSessionCreated( HttpSession session ) {
HttpSessionEvent event = new HttpSessionEvent( session );
for (Iterator i = _sessionListeners.iterator(); i.hasNext();) {
HttpSessionListener listener = (HttpSessionListener) i.next();
listener.sessionCreated( event );
}
}
代码示例来源:origin: org.jglue.cdi-unit/cdi-unit
public HttpSession getSession(boolean create) {
HttpSession previousSession = delegate.getSession(false);
HttpSession session = delegate.getSession(create);
if (previousSession == null && session != null) {
listener.sessionCreated(new HttpSessionEvent(session));
}
return session;
}
代码示例来源:origin: org.apache.tomee/openejb-http
public void callListeners() {
if (!this.listeners.isEmpty()) {
final HttpSessionEvent event = new HttpSessionEvent(this);
for (final HttpSessionListener o : this.listeners) {
HttpSessionListener.class.cast(o).sessionCreated(event);
}
}
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.http.servlet
@Override
public void sessionDidActivate(HttpSessionEvent se) {
if (value instanceof HttpSessionActivationListener) {
((HttpSessionActivationListener) value).sessionDidActivate(new HttpSessionEvent(innerSession));
}
}
代码示例来源:origin: net.bull.javamelody/javamelody-core
void registerSessionIfNeeded(HttpSession session) {
if (session != null) {
synchronized (session) {
if (!SESSION_MAP_BY_ID.containsKey(session.getId())) {
sessionCreated(new HttpSessionEvent(session));
}
}
}
}
代码示例来源:origin: net.oneandone/ejb-cdi-unit
public HttpSession getSession(boolean create) {
HttpSession previousSession = delegate.getSession(false);
HttpSession session = delegate.getSession(create);
if (previousSession == null && session != null) {
listener.sessionCreated(new HttpSessionEvent(session));
}
return session;
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.http.servlet
@Override
public void sessionWillPassivate(HttpSessionEvent se) {
if (value instanceof HttpSessionActivationListener) {
((HttpSessionActivationListener) value).sessionWillPassivate(new HttpSessionEvent(innerSession));
}
}
代码示例来源:origin: org.apache.openejb/openejb-http
@Override
public void invalidate() {
listener.sessionDestroyed(new HttpSessionEvent(session));
}
}
代码示例来源:origin: org.jvnet.hudson.winstone/winstone
public void sendCreatedNotifies() {
// Notify session listeners of new session
for (int n = 0; n ClassLoader cl = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(this.webAppConfig.getLoader());
this.sessionListeners[n].sessionCreated(new HttpSessionEvent(this));
Thread.currentThread().setContextClassLoader(cl);
}
}
代码示例来源:origin: io.undertow/undertow-servlet
public void sessionDestroyed(final HttpSession session) {
if(!started) {
return;
}
final HttpSessionEvent sre = new HttpSessionEvent(session);
for (int i = httpSessionListeners.length - 1; i >= 0; --i) {
ManagedListener listener = httpSessionListeners[i];
this.get(listener).sessionDestroyed(sre);
}
}
代码示例来源:origin: io.undertow/undertow-servlet
public void sessionCreated(final HttpSession session) {
if(!started) {
return;
}
final HttpSessionEvent sre = new HttpSessionEvent(session);
for (int i = 0; i this.get(httpSessionListeners[i]).sessionCreated(sre);
}
}
代码示例来源:origin: io.undertow/undertow-servlet
public void httpSessionIdChanged(final HttpSession session, final String oldSessionId) {
if(!started) {
return;
}
final HttpSessionEvent sre = new HttpSessionEvent(session);
for (int i = 0; i this.get(httpSessionIdListeners[i]).sessionIdChanged(sre, oldSessionId);
}
}
代码示例来源:origin: com.helger/ph-servlet
public void invalidate ()
{
if (m_bInvalidated)
throw new IllegalStateException ("Session scope '" + getId () + "' already invalidated!");
m_bInvalidated = true;
final HttpSessionEvent aHSE = new HttpSessionEvent (this);
for (final HttpSessionListener aListener : MockHttpListener.getAllHttpSessionListeners ())
aListener.sessionDestroyed (aHSE);
clearAttributes ();
}