| Constructor and Description |
|---|
JreInjector() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
create(Class<? super T> cls) |
protected void |
init(Class<?> on,
InitMap<Class<?>,?> map) |
void |
initialize(Object o) |
<T> T |
provide(Class<? super T> cls)
Synchronously returns a singleton which implements or extends this method's generic type.
|
<T> void |
setInstanceFactory(Class<T> cls,
javax.inject.Provider<T> provider) |
<T> void |
setSingletonFactory(Class<T> cls,
javax.inject.Provider<T> provider) |
public <T> T provide(Class<? super T> cls)
InjectorSingletonDefault and SingletonOverride
For java mode, the JavaInjector uses runtime lookup of resources in
META-INF/singletons or META-INF/singletons to find bindings for your classes.
If you enable runtime injection, the tool will do a once-per-runtime scan for annotations,
and will generate the bindings in memory. For maximum performance in
production, you will want to use the preloading strategy to read in a
manifest of all injectable classes and prepare providers before they are
requested.
A maven plugin will be provided to create this manifest for you.
All libraries exporting functionality should include specific META-INF
bindings for defaults at least; the META-INF resources will only be checked
if the given type is not already bound.public <T> void setInstanceFactory(Class<T> cls, javax.inject.Provider<T> provider)
setInstanceFactory in interface Injectorpublic <T> void setSingletonFactory(Class<T> cls, javax.inject.Provider<T> provider)
setSingletonFactory in interface Injectorpublic void initialize(Object o)
Copyright © December 07, 2012–2015 The Internet Party. All rights reserved.