-
- Enclosing interface:
- HttpSession
public static interface HttpSession.AccessorAn accessor for applications to interact with aHttpSessionoutside of the scope of an HTTP request.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaccess(Consumer<HttpSession> sessionConsumer)Call to access theHttpSessionused to obtain thisAccessorfrom outside the scope of a HTTP request.
-
-
-
Method Detail
-
access
void access(Consumer<HttpSession> sessionConsumer)
Call to access theHttpSessionused to obtain thisAccessorfrom outside the scope of a HTTP request.When called, the container will call the
Consumer.accept(Object)method of thesessionConsumerpassed by the application, with anHttpSessionobject that represents the sameHttpSessionthat thisAccessorwas obtained from.The passed
HttpSessionmay be the same instance as used to obtain thisAccessor, or a new instance for the session which has possibly been passivated and activated since theAccessorwas obtained.The passed
HttpSessionmay be shared concurrently with otherAccessors for the same session, other calls to thisAccessorand/orServlets andFilters.The passed
HttpSessionmust 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 ofsessionConsumeroccurs during the processing of an HTTP request for the same session.- Parameters:
sessionConsumer- the application providedConsumerofHttpSessionto access the session.- Throws:
IllegalStateException- if this method is called on an invalidated session or if the session ID has changed since theAccessorwas obtained.
-
-