public interface DependencyInjector<DI extends DependencyInjector<DI>> extends AppService<DI>, org.osgl.inject.Injector
Destroyable.Util
Modifier and Type | Method and Description |
---|---|
void |
fireInjectedEvent(Object bean,
org.osgl.inject.BeanSpec spec)
Once an object has been created and ready for injection, this method will be called to call back to the
listeners that has been registered |
<T> T |
get(Class<T> clazz)
Get a bean instance by class
|
boolean |
isProvided(Class<?> type)
Report if a given type is a provided type (e.g.
|
void |
registerDiBinder(DependencyInjectionBinder binder)
Register a
DependencyInjectionBinder to the injector |
void |
registerDiListener(DependencyInjectionListener listener)
Register a
DependencyInjectionListener to the injector |
<T> void |
registerNamedProvider(Class<? super T> type,
org.osgl.inject.NamedProvider<? extends T> provider)
Register a
NamedProvider to the injector |
<T> void |
registerProvider(Class<? super T> type,
javax.inject.Provider<? extends T> provider)
Register a
Provider to the injector |
destroy, isDestroyed, scope
void registerDiBinder(DependencyInjectionBinder binder)
Register a DependencyInjectionBinder
to the injector
binder
- the bindervoid registerDiListener(DependencyInjectionListener listener)
Register a DependencyInjectionListener
to the injector
listener
- the dependency injection event listener<T> void registerProvider(Class<? super T> type, javax.inject.Provider<? extends T> provider)
Register a Provider
to the injector
T
- the type parameter of the targettype
- the target typeprovider
- the provider<T> void registerNamedProvider(Class<? super T> type, org.osgl.inject.NamedProvider<? extends T> provider)
Register a NamedProvider
to the injector
T
- the generic type of the target objecttype
- the target object typeprovider
- the providerboolean isProvided(Class<?> type)
Report if a given type is a provided type (e.g. ActContext, All application services etc, DAO)
type
- the type to be checkedtrue
if the type is a provided type or false
otherwisevoid fireInjectedEvent(Object bean, org.osgl.inject.BeanSpec spec)
Once an object has been created and ready for injection, this method will be called to call back to the listeners
that has been registered
bean
- the object to be injectedspec
- the spec about the bean instance<T> T get(Class<T> clazz)
Get a bean instance by class
get
in interface org.osgl.inject.Injector
T
- the generic type of the bean instanceclazz
- the class of the bean instance to be returnedCopyright © 2014–2018 ActFramework. All rights reserved.