01: package com.bm.ejb3guice.introspect;
02:
03: import com.bm.ejb3guice.inject.Key;
04:
05: import java.util.Set;
06:
07: /**
08: * The resolver is used by the Injector to, given an injection request (key),
09: * find the appropriate instructions for obtaining instances to fulfill that
10: * request. It is exposed for use by tools.
11: *
12: * @author Kevin Bourrillion (kevinb9n@gmail.com)
13: */
14: public interface Resolver {
15:
16: /**
17: * Returns the Implementation that the given key resolves to
18: * @throws IllegalArgumentException if the key cannot be resolved
19: */
20: <T> Implementation<T> resolve(Key<? super T> key);
21:
22: /**
23: * Returns all the keys that can be resolved by this injector.
24: */
25: Set<Key<?>> allKeys();
26:
27: /**
28: * Returns all the implementations known to this injector.
29: */
30: Set<Implementation<?>> resolveAll();
31: }
|