Package com.google.inject.servlet
Class ServletScopes.SessionScope
- java.lang.Object
-
- com.google.inject.servlet.ServletScopes.SessionScope
-
- All Implemented Interfaces:
Scope
- Enclosing class:
- ServletScopes
private static final class ServletScopes.SessionScope extends java.lang.Object implements Scope
-
-
Constructor Summary
Constructors Modifier Constructor Description private
SessionScope()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Provider<T>
scope(Key<T> key, Provider<T> creator)
Scopes a provider.java.lang.String
toString()
A short but useful description of this scope.
-
-
-
Method Detail
-
scope
public <T> Provider<T> scope(Key<T> key, Provider<T> creator)
Description copied from interface:Scope
Scopes a provider. The returned provider returns objects from this scope. If an object does not exist in this scope, the provider can use the given unscoped provider to retrieve one.Scope implementations are strongly encouraged to override
Object.toString()
in the returned provider and include the backing provider'stoString()
output.
-
toString
public java.lang.String toString()
Description copied from interface:Scope
A short but useful description of this scope. For comparison, the standard scopes that ship with guice use the descriptions"Scopes.SINGLETON"
,"ServletScopes.SESSION"
and"ServletScopes.REQUEST"
.
-
-