javax.servlet.http.HttpSessionContext Java Examples

The following examples show how to use javax.servlet.http.HttpSessionContext. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HttpSessionImpl.java    From tomee with Apache License 2.0 6 votes vote down vote up
@Override
public HttpSessionContext getSessionContext() {
    touch();
    final SessionManager component = SystemInstance.get().getComponent(SessionManager.class);
    return new HttpSessionContext() {
        @Override
        public javax.servlet.http.HttpSession getSession(final String sessionId) {
            final HttpSessionEvent event = component.findSession(sessionId);
            return event == null ? null : event.getSession();
        }

        @Override
        public Enumeration<String> getIds() {
            return Collections.enumeration(component.findSessionIds());
        }
    };
}
 
Example #2
Source File: SessionRepositoryFilterTests.java    From spring-session with Apache License 2.0 6 votes vote down vote up
@Test
void doFilterSessionContext() throws Exception {
	doFilter(new DoInFilter() {
		@Override
		public void doFilter(HttpServletRequest wrappedRequest) {
			HttpSessionContext sessionContext = wrappedRequest.getSession().getSessionContext();
			assertThat(sessionContext).isNotNull();
			assertThat(sessionContext.getSession("a")).isNull();
			assertThat(sessionContext.getIds()).isNotNull();
			assertThat(sessionContext.getIds().hasMoreElements()).isFalse();

			try {
				sessionContext.getIds().nextElement();
				fail("Expected Exception");
			}
			catch (NoSuchElementException ignored) {
			}
		}
	});
}
 
Example #3
Source File: HttpSessionMock.java    From vraptor4 with Apache License 2.0 5 votes vote down vote up
@Override
public HttpSessionContext getSessionContext() {
	return new HttpSessionContext() {
		@Override
		public HttpSession getSession(String s) {
			return HttpSessionMock.this;
		}

		@Override
		public Enumeration<String> getIds() {
			return new Enumeration<String>() {
				private boolean hasNext = true;

				@Override
				public boolean hasMoreElements() {
					return hasNext;
				}

				@Override
				public String nextElement() {
					hasNext = false;
					return getId();
				}
			};
		}
	};
}
 
Example #4
Source File: HttpSessionAdapter.java    From portals-pluto with Apache License 2.0 4 votes vote down vote up
@Override
public HttpSessionContext getSessionContext() {
	throw new UnsupportedOperationException();
}
 
Example #5
Source File: HttpSessionImpl.java    From quarkus-http with Apache License 2.0 4 votes vote down vote up
@Override
public HttpSessionContext getSessionContext() {
    return null;
}
 
Example #6
Source File: WebSessionV2.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@SuppressWarnings("deprecation")
@Override public HttpSessionContext getSessionContext() {
    return EMPTY_SES_CTX;
}
 
Example #7
Source File: WebSession.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public HttpSessionContext getSessionContext() {
    return EMPTY_SES_CTX;
}
 
Example #8
Source File: HttpSessionMock.java    From dolphin-platform with Apache License 2.0 4 votes vote down vote up
@Override
public HttpSessionContext getSessionContext() {
    return null;
}
 
Example #9
Source File: HttpSessionMock.java    From dolphin-platform with Apache License 2.0 4 votes vote down vote up
@Override
public HttpSessionContext getSessionContext() {
    return null;
}
 
Example #10
Source File: MySession.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public HttpSessionContext getSessionContext()
{
	throw new UnsupportedOperationException();
}
 
Example #11
Source File: MyLittleSession.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
/**
 * @inheritDoc
 */
public HttpSessionContext getSessionContext()
{
	throw new UnsupportedOperationException();
}
 
Example #12
Source File: EntityHttpServletRequest.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public HttpSessionContext getSessionContext() {
    throw new UnsupportedOperationException("getSessionContext");
}
 
Example #13
Source File: FakeHttpSession.java    From ontopia with Apache License 2.0 4 votes vote down vote up
@Override
public HttpSessionContext getSessionContext() {
  // Note: deprecated
  return null;
}
 
Example #14
Source File: SimpleHttpSession.java    From carbon-identity with Apache License 2.0 4 votes vote down vote up
@Override
public HttpSessionContext getSessionContext() {
    return null;
}
 
Example #15
Source File: HttpSessionAdapter.java    From spring-session with Apache License 2.0 4 votes vote down vote up
@Override
public HttpSessionContext getSessionContext() {
	return NOOP_SESSION_CONTEXT;
}
 
Example #16
Source File: MockHttpSession.java    From live-chat-engine with Apache License 2.0 4 votes vote down vote up
@Override
public HttpSessionContext getSessionContext() {
	throw new UnsupportedOperationException("getSessionContext");
}
 
Example #17
Source File: MySession.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public HttpSessionContext getSessionContext()
{
	throw new UnsupportedOperationException();
}
 
Example #18
Source File: MyLittleSession.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
/**
 * @inheritDoc
 */
public HttpSessionContext getSessionContext()
{
	throw new UnsupportedOperationException();
}
 
Example #19
Source File: EntityHttpServletRequest.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public HttpSessionContext getSessionContext() {
    throw new UnsupportedOperationException("getSessionContext");
}
 
Example #20
Source File: HttpSessionSimulator.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
public HttpSessionContext getSessionContext( )
{
	verify( );
	throw new UnsupportedOperationException(
			"Do not support getSessionContext operation!" ); //$NON-NLS-1$
}
 
Example #21
Source File: KhanHttpSession.java    From khan-session with GNU Lesser General Public License v2.1 4 votes vote down vote up
/**
 * get HttpSessionContext
 * @return
 */
@SuppressWarnings("deprecation")
@Override
public HttpSessionContext getSessionContext() {
    return session.getSessionContext();
}
 
Example #22
Source File: PippoHttpSession.java    From pippo with Apache License 2.0 4 votes vote down vote up
@Override
@Deprecated
@SuppressWarnings("deprecation")
public HttpSessionContext getSessionContext() {
    return null;
}
 
Example #23
Source File: MockHttpSession.java    From everrest with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public HttpSessionContext getSessionContext() {
    return null;
}
 
Example #24
Source File: SessionRepositoryFilter.java    From lemon with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("deprecation")
public HttpSessionContext getSessionContext() {
	return NOOP_SESSION_CONTEXT;
}
 
Example #25
Source File: ServletSessionAdapter.java    From tomee with Apache License 2.0 4 votes vote down vote up
@Override
public HttpSessionContext getSessionContext() {
    return session.getSessionContext();
}
 
Example #26
Source File: MockHttpSession.java    From deltaspike with Apache License 2.0 4 votes vote down vote up
public HttpSessionContext getSessionContext()
{
    return null;
}
 
Example #27
Source File: HttpSessionImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public HttpSessionContext getSessionContext() {
    return null;
}
 
Example #28
Source File: J2CacheSession.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Deprecated
@Override
public HttpSessionContext getSessionContext() {
    return null;
}
 
Example #29
Source File: VertxWrappedSession.java    From vertx-vaadin with MIT License 4 votes vote down vote up
@Override
public HttpSessionContext getSessionContext() {
    throw new UnsupportedOperationException("Deprecated");
}
 
Example #30
Source File: VertxWrappedSession.java    From vertx-vaadin with MIT License 4 votes vote down vote up
@Override
public HttpSessionContext getSessionContext() {
    throw new UnsupportedOperationException("Deprecated");
}