public interface InjectionContext
Resource,
PostConstruct| Modifier and Type | Method and Description |
|---|---|
void |
freeze()
Freezes current context, so there will be no possibility to modify this context.
|
<T> T |
getBean(Class<T> beanClass)
Gets bean associated with the class given.
|
<T> List<T> |
getBeans(Class<T> beanClass)
Returns all the beans that implement the given class.
|
boolean |
isFrozen() |
<T> void |
registerBean(Class<T> beanClass)
Puts bean instance associated with the given class.
|
<T> void |
registerBean(T bean)
Puts bean instance to the context.
|
<T> void registerBean(@Nonnull T bean)
T - Bean's class.bean - Bean instance.<T> void registerBean(@Nonnull Class<T> beanClass)
InjectionException if the given bean class clashes with certain existing definition.T - Bean class type.beanClass - Non-interface bean class.@Nonnull <T> T getBean(@Nonnull Class<T> beanClass)
InjectionException in case of no bean associated with the given class.
Throws InjectionException if multiple beans can be returned by this method.T - Interface type.beanClass - Interface class, that is expected to be associated with the bean.@Nonnull <T> List<T> getBeans(@Nonnull Class<T> beanClass)
T - Interface type.beanClass - Interface class, that is expected to be associated with the bean.void freeze()
isFrozen()boolean isFrozen()
freeze()Copyright © 2011–2014. All rights reserved.