|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.guice.inject.Injectors
public final class Injectors
Field Summary | |
---|---|
static String |
MODULE_CLASS_NAMES
|
Method Summary | ||
---|---|---|
static void |
close(com.google.inject.Injector injector)
Closes any singleton objects in the injector using the currently registered Closer implementations |
|
static void |
close(com.google.inject.Injector injector,
Class<? extends Annotation> scopeAnnotationToClose)
Closes objects within the given scope using the currently registered Closer implementations |
|
static void |
close(com.google.inject.Injector injector,
Class<? extends Annotation> scopeAnnotationToClose,
CloseErrors errors)
Closes objects within the given scope using the currently registered Closer implementations |
|
static void |
close(com.google.inject.Injector injector,
CloseErrors errors)
Closes objects within the given scope using the currently registered Closer implementations |
|
static com.google.inject.Injector |
createInjector(Map environment,
com.google.inject.Module... overridingModules)
Creates an injector from the given properties, loading any modules define by the MODULE_CLASS_NAMES property value (space separated) along
with any other modules passed as an argument. |
|
static com.google.inject.Binding<?> |
getBinding(com.google.inject.Injector injector,
com.google.inject.Key<?> key)
Returns the binding for the given key or null if there is no such binding |
|
static Set<com.google.inject.Binding<?>> |
getBindingsOf(com.google.inject.Injector injector,
Class<?> baseClass)
Returns a collection of all bindings of the given base type |
|
static Set<com.google.inject.Binding<?>> |
getBindingsOf(com.google.inject.Injector injector,
com.google.inject.matcher.Matcher<Class> matcher)
Returns a collection of all of the bindings matching the given matcher |
|
static
|
getInstance(com.google.inject.Injector injector,
Class<T> type,
String name)
Returns an instance of the given type with the Named annotation value. |
|
static
|
getInstancesOf(com.google.inject.Injector injector,
Class<T> baseClass)
Returns a collection of all instances of the given base type |
|
static
|
getInstancesOf(com.google.inject.Injector injector,
com.google.inject.matcher.Matcher<Class> matcher)
Returns a collection of all instances matching the given matcher |
|
static
|
getKeyType(com.google.inject.Key<?> key)
Returns the key type of the given key |
|
static
|
getProvidersOf(com.google.inject.Injector injector,
Class<T> baseClass)
Returns a collection of all providers of the given base type |
|
static
|
getProvidersOf(com.google.inject.Injector injector,
com.google.inject.matcher.Matcher<Class> matcher)
Returns a collection of all of the providers matching the given matcher |
|
static Class<? extends Annotation> |
getScopeAnnotation(com.google.inject.Binding<?> binding)
Returns the scope annotation for the given binding or null if there is no scope |
|
static boolean |
hasBinding(com.google.inject.Injector injector,
Class<?> baseClass)
Returns true if a binding exists for the given base class |
|
static boolean |
hasBinding(com.google.inject.Injector injector,
com.google.inject.Key<?> key)
Returns true if a binding exists for the given key |
|
static boolean |
hasBinding(com.google.inject.Injector injector,
com.google.inject.matcher.Matcher<Class> matcher)
Returns true if a binding exists for the given matcher |
|
protected static com.google.inject.Module |
loadModule(String moduleName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String MODULE_CLASS_NAMES
Method Detail |
---|
public static com.google.inject.Injector createInjector(Map environment, com.google.inject.Module... overridingModules) throws ClassNotFoundException, IllegalAccessException, InstantiationException
MODULE_CLASS_NAMES
property value (space separated) along
with any other modules passed as an argument.
environment
- the properties used to create the injectoroverridingModules
- any modules which override the modules referenced in the
environment such as to provide the actual JNDI context
ClassNotFoundException
IllegalAccessException
InstantiationException
public static <T> T getInstance(com.google.inject.Injector injector, Class<T> type, String name)
Named
annotation value.
This method allows you to switch this code
injector.getInstance(Key.get(type, Names.named(name)));
to the more concise
Injectors.getInstance(injector, type, name);
public static <T> Set<T> getInstancesOf(com.google.inject.Injector injector, Class<T> baseClass)
T
- the base typebaseClass
- the base type of objects required
public static <T> Set<T> getInstancesOf(com.google.inject.Injector injector, com.google.inject.matcher.Matcher<Class> matcher)
matcher
- matches the types to return instances
public static <T> Set<com.google.inject.Provider<T>> getProvidersOf(com.google.inject.Injector injector, com.google.inject.matcher.Matcher<Class> matcher)
matcher
- matches the types to return instances
public static <T> Set<com.google.inject.Provider<T>> getProvidersOf(com.google.inject.Injector injector, Class<T> baseClass)
T
- the base typebaseClass
- the base type of objects required
public static boolean hasBinding(com.google.inject.Injector injector, com.google.inject.matcher.Matcher<Class> matcher)
public static boolean hasBinding(com.google.inject.Injector injector, Class<?> baseClass)
public static boolean hasBinding(com.google.inject.Injector injector, com.google.inject.Key<?> key)
public static com.google.inject.Binding<?> getBinding(com.google.inject.Injector injector, com.google.inject.Key<?> key)
public static Set<com.google.inject.Binding<?>> getBindingsOf(com.google.inject.Injector injector, com.google.inject.matcher.Matcher<Class> matcher)
matcher
- matches the types to return instances
public static Set<com.google.inject.Binding<?>> getBindingsOf(com.google.inject.Injector injector, Class<?> baseClass)
baseClass
- the base type of objects required
public static <T> Class<?> getKeyType(com.google.inject.Key<?> key)
protected static com.google.inject.Module loadModule(String moduleName) throws ClassNotFoundException, IllegalAccessException, InstantiationException
ClassNotFoundException
IllegalAccessException
InstantiationException
public static void close(com.google.inject.Injector injector) throws CloseFailedException
Closer
implementations
CloseFailedException
public static void close(com.google.inject.Injector injector, CloseErrors errors) throws CloseFailedException
Closer
implementations
CloseFailedException
public static void close(com.google.inject.Injector injector, Class<? extends Annotation> scopeAnnotationToClose) throws CloseFailedException
Closer
implementations
CloseFailedException
public static void close(com.google.inject.Injector injector, Class<? extends Annotation> scopeAnnotationToClose, CloseErrors errors) throws CloseFailedException
Closer
implementations
CloseFailedException
public static Class<? extends Annotation> getScopeAnnotation(com.google.inject.Binding<?> binding)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |