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 exchange) { SessionStorage session = exchange.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, requireBinding
public 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 AbstractModule
public Handler decorate(Injector injector, Handler handler)
SessionStorage
available in the exchange service.decorate
in interface HandlerDecoratingModule
injector
- The injector created from all the application moduleshandler
- The application handlerSessionStorage
impl in the exchange service