-
- Enclosing interface:
- HttpSession
public static interface HttpSession.Accessor
An accessor for applications to interact with aHttpSession
outside of the scope of an HTTP request.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
access(Consumer<HttpSession> sessionConsumer)
Call to access theHttpSession
used to obtain thisAccessor
from outside the scope of a HTTP request.
-
-
-
Method Detail
-
access
void access(Consumer<HttpSession> sessionConsumer)
Call to access theHttpSession
used to obtain thisAccessor
from outside the scope of a HTTP request.When called, the container will call the
Consumer.accept(Object)
method of thesessionConsumer
passed by the application, with anHttpSession
object that represents the sameHttpSession
that thisAccessor
was obtained from.The passed
HttpSession
may be the same instance as used to obtain thisAccessor
, or a new instance for the session which has possibly been passivated and activated since theAccessor
was obtained.The passed
HttpSession
may be shared concurrently with otherAccessor
s for the same session, other calls to thisAccessor
and/orServlet
s andFilter
s.The passed
HttpSession
must not be used or referenced outside the scope of the call to theConsumer.accept(Object)
method ofsessionConsumer
.For the purposes of session access, validity, passivation, activation etc. the container behaves as if the call to the
Consumer.accept(Object)
method ofsessionConsumer
occurs during the processing of an HTTP request for the same session.- Parameters:
sessionConsumer
- the application providedConsumer
ofHttpSession
to access the session.- Throws:
IllegalStateException
- if this method is called on an invalidated session or if the session ID has changed since theAccessor
was obtained.
-
-