Package org.int4.dirk.cdi
Class Injectors
- java.lang.Object
-
- org.int4.dirk.cdi.Injectors
-
public class Injectors extends java.lang.ObjectFactory for CDI styleInjectors.This mimics CDI style injection, which supports all features of Jakarta Inject, and additionally:
- The
Producesannotation on fields and methods - The
Defaultannotation is added to sources when not annotated with any qualifiers or only annotated withNamedand/orAnyannotations - The
Defaultannotation is added to targets when not annotated with any other qualifiers - The
Anyannotation is always added to all sources
- Interceptors, Decorators and Events
- Extensions via Jakarta Enterprise Inject SPI; instead use the provided SPI
- Lifecycle management for sources created by producers
- The
Instanceextension ofProvider
- Proxies are only available when the optional proxy extension is on the class path
- Proxies are only created to resolve scope conflicts, but not to resolve circular dependencies
- Exceptions thrown by the injector are of a different type with different messages
- Sources can still be added and removed after initialization if so desired
- The
-
-
Constructor Summary
Constructors Constructor Description Injectors()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.int4.dirk.api.InjectorautoDiscovering(org.int4.dirk.spi.scope.ScopeResolver... scopeResolvers)Creates anInjectorwith auto discovery activated and the givenScopeResolvers.static org.int4.dirk.api.Injectormanual(org.int4.dirk.spi.scope.ScopeResolver... scopeResolvers)Creates anInjectorwhich must be manually configured with the givenScopeResolvers.
-
-
-
Method Detail
-
autoDiscovering
public static org.int4.dirk.api.Injector autoDiscovering(org.int4.dirk.spi.scope.ScopeResolver... scopeResolvers)
Creates anInjectorwith auto discovery activated and the givenScopeResolvers.- Parameters:
scopeResolvers- an optional array ofScopeResolvers- Returns:
- an
Injector, nevernull
-
manual
public static org.int4.dirk.api.Injector manual(org.int4.dirk.spi.scope.ScopeResolver... scopeResolvers)
Creates anInjectorwhich must be manually configured with the givenScopeResolvers.- Parameters:
scopeResolvers- an optional array ofScopeResolvers- Returns:
- an
Injector, nevernull
-
-