public class MapSessionsModule extends AbstractModule implements HandlerDecoratingModule
SessionStore.
SessionStorage - using an in-memory (i.e. non persistent) cacheSessionManager (can be provided by SessionModule)
This module decorates the handler to make
the SessionStorage available during request processing.
import ratpack.handling.*;
import ratpack.session.store.SessionStorage;
class MyHandler implements Handler {
void handle(Context ctx) {
SessionStorage session = ctx.getRequest().get(SessionStorage.class);
}
}
| Constructor and Description |
|---|
MapSessionsModule(int maxEntries,
int idleTimeoutMinutes)
Creates a new module with the given configuration for session storage.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
configure() |
Handler |
decorate(Injector injector,
Handler handler)
Makes
SessionStorage available in the exchange service. |
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBindingpublic MapSessionsModule(int maxEntries,
int idleTimeoutMinutes)
maxEntries - The number of maximum sessions to store (old sessions are evicted according to LRU)idleTimeoutMinutes - How long a session can be idle before its considered inactive and able to be evictedprotected void configure()
configure in class AbstractModulepublic Handler decorate(Injector injector, Handler handler)
SessionStorage available in the exchange service.decorate in interface HandlerDecoratingModuleinjector - The injector created from all the application moduleshandler - The application handlerSessionStorage impl in the exchange service