icitly seed some seed objects... scope.seed(Key.get(SomeObject.class), someObject); // create and access scoped objects } finally { scope.exit(); } The scope can be initialized with one or more seed values by calling
seed(key, value)
before the injector will be called upon to provide for this key. A typical use is for a servlet filter to enter/exit the scope, representing a Request Scope, and seed HttpServletRequest and HttpServletResponse. For each key inserted with seed(), you must include a corresponding binding:
bind(key) .toProvider(SimpleScope.<KeyClass>seededKeyProvider()) .in(ScopeAnnotation.class);
@author Jesse Wilson
@author Fedor Karpelevitch