com.google.inject
Interface Scope.Strategy

Enclosing class:
Scope

public static interface Scope.Strategy

Pluggable scoping strategy. Enables users to provide custom implementations of request, session, and wizard scopes. Implement and pass to Container.setScopeStrategy(com.google.inject.Scope.Strategy).


Method Summary
<T> T
findInRequest(Key<T> key, java.util.concurrent.Callable<? extends T> factory)
          Finds an object for the given type and name in the request scope.
<T> T
findInSession(Key<T> key, java.util.concurrent.Callable<? extends T> factory)
          Finds an object for the given type and name in the session scope.
<T> T
findInWizard(Key<T> key, java.util.concurrent.Callable<? extends T> factory)
          Finds an object for the given type and name in the wizard scope.
 

Method Detail

findInRequest

<T> T findInRequest(Key<T> key,
                    java.util.concurrent.Callable<? extends T> factory)
                throws java.lang.Exception
Finds an object for the given type and name in the request scope. Creates a new object if necessary using the given factory.

Throws:
java.lang.Exception

findInSession

<T> T findInSession(Key<T> key,
                    java.util.concurrent.Callable<? extends T> factory)
                throws java.lang.Exception
Finds an object for the given type and name in the session scope. Creates a new object if necessary using the given factory.

Throws:
java.lang.Exception

findInWizard

<T> T findInWizard(Key<T> key,
                   java.util.concurrent.Callable<? extends T> factory)
               throws java.lang.Exception
Finds an object for the given type and name in the wizard scope. Creates a new object if necessary using the given factory.

Throws:
java.lang.Exception