Interface J7mInjector
The injector creates application-owned components from public annotations and public capability bindings. It is intentionally much smaller than a general-purpose dependency injection framework: it supports constructor injection, controlled field injection, safe configuration values, invocation-scoped context values, lifecycle hooks, and diagnostics. It does not require Spring, Guice, CDI, bytecode generation, classpath scanning, or vendor-specific APIs.
Implementations must be thread-safe for concurrent component creation once configured. Blocking behavior is limited to reflective construction and lifecycle method invocation; implementations must not perform network I/O as part of dependency resolution. Missing or ambiguous dependencies must fail with stable middleware error codes and redacted diagnostics.
-
Method Summary
Modifier and TypeMethodDescription<T> Tinstantiate(Class<T> type) Creates an application-owned component.voidinvokeLifecycle(Object component, Class<? extends Annotation> annotation) Invokes all no-argument lifecycle methods annotated with the supplied annotation.status()Returns a safe immutable status snapshot.
-
Method Details
-
instantiate
Creates an application-owned component.- Type Parameters:
T- component type- Parameters:
type- component class- Returns:
- constructed and field-injected component
-
invokeLifecycle
Invokes all no-argument lifecycle methods annotated with the supplied annotation.- Parameters:
component- component instanceannotation- lifecycle annotation type
-
status
InjectionGraphStatus status()Returns a safe immutable status snapshot.- Returns:
- injection graph status
-