Class ManagedContainer
java.lang.Object
org.j7m.middleware.application.components.ManagedContainer
- All Implemented Interfaces:
AutoCloseable
Opt-in application-owned container for finite generated component indexes. The full graph is
validated before any product is created; activation products are then eagerly constructed.
This API does not deploy applications, scan classpaths, invoke lifecycle hooks, refresh routes
or change the legacy injector. Owned AutoCloseable values close in reverse creation order.
A failed construction invalidates and disposes its resolving scope. Call scopes are explicit;
async propagation and hosting integration are separate APIs.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classExplicit call ownership boundary, shared neither implicitly nor through captured providers.static final classSafe graph/lifecycle failure without application exception messages or qualifier values.static final recordBounded aggregate lifecycle counters without component names or configuration values. -
Method Summary
Modifier and TypeMethodDescriptionstatic ManagedContaineractivate(Collection<? extends org.j7m.middleware.application.api.ManagedComponentIndex> indexes) Validates and starts a finite activation with a4096-instance ownership/call limit.static ManagedContaineractivate(Collection<? extends org.j7m.middleware.application.api.ManagedComponentIndex> indexes, int capacity) Starts a finite activation with explicit ownership and open-call capacity.static ManagedContaineractivate(Collection<? extends org.j7m.middleware.application.api.ManagedComponentIndex> indexes, int capacity, LiveConfiguration configuration) Starts a bounded activation with configuration bindings validated before constructors.static ManagedContaineractivate(Collection<? extends org.j7m.middleware.application.api.ManagedComponentIndex> indexes, int capacity, LiveConfiguration configuration, ManagedHostBindings bindings) Validates and starts an activation with explicitly granted host integration capabilities.static ManagedContaineractivate(Collection<? extends org.j7m.middleware.application.api.ManagedComponentIndex> indexes, LiveConfiguration configuration) Starts a finite activation with explicit host-owned configuration.voidclose()Closes idle call scopes and then activation products.<T> Tget(Class<T> type, String name, List<org.j7m.middleware.application.api.ManagedQualifier> qualifiers) Resolves an activation/prototype root; CALL roots require an explicit call scope.voidlifecycle(org.j7m.middleware.application.api.ManagedLifecycle phase) Runs managed lifecycle phases over owned generated host adapters.openCall()Opens a detached explicit call scope.<T> org.j7m.middleware.application.api.ManagedProvider<T> provider(Class<T> type, String name, List<org.j7m.middleware.application.api.ManagedQualifier> qualifiers) Creates a lazy root lookup.status()Returns aggregate state without sensitive component metadata.
-
Method Details
-
activate
public static ManagedContainer activate(Collection<? extends org.j7m.middleware.application.api.ManagedComponentIndex> indexes) Validates and starts a finite activation with a4096-instance ownership/call limit.- Parameters:
indexes- explicit generated indexes, never a classpath scan- Returns:
- active managed container
- Throws:
IllegalStateException- for invalid graphs or construction failure
-
activate
public static ManagedContainer activate(Collection<? extends org.j7m.middleware.application.api.ManagedComponentIndex> indexes, int capacity) Starts a finite activation with explicit ownership and open-call capacity.- Parameters:
indexes- explicit version1 indexescapacity- maximum live owned values and separately maximum open call scopes,1..1000000- Returns:
- active container
- Throws:
IllegalStateException- for unsupported metadata, invalid graph or failed creation
-
activate
public static ManagedContainer activate(Collection<? extends org.j7m.middleware.application.api.ManagedComponentIndex> indexes, LiveConfiguration configuration) Starts a finite activation with explicit host-owned configuration. The container owns only its binding registrations, never the configuration owner.- Parameters:
indexes- explicit version1 indexesconfiguration- borrowed configuration owner- Returns:
- active container with4096-instance capacity
- Throws:
IllegalStateException- for invalid graphs/configuration or construction failure
-
activate
public static ManagedContainer activate(Collection<? extends org.j7m.middleware.application.api.ManagedComponentIndex> indexes, int capacity, LiveConfiguration configuration) Starts a bounded activation with configuration bindings validated before constructors.- Parameters:
indexes- explicit version1 indexescapacity- maximum owned instances and separately open callsconfiguration- borrowed nonnull host configuration- Returns:
- active managed container
- Throws:
IllegalStateException- for invalid configuration, metadata or graph
-
get
public <T> T get(Class<T> type, String name, List<org.j7m.middleware.application.api.ManagedQualifier> qualifiers) Resolves an activation/prototype root; CALL roots require an explicit call scope.- Type Parameters:
T- requested contract- Parameters:
type- required contractname- exact name, never an unnamed fallbackqualifiers- exact qualifiers- Returns:
- selected product
- Throws:
IllegalStateException- for invalid selection, scope or failed construction
-
activate
public static ManagedContainer activate(Collection<? extends org.j7m.middleware.application.api.ManagedComponentIndex> indexes, int capacity, LiveConfiguration configuration, ManagedHostBindings bindings) Validates and starts an activation with explicitly granted host integration capabilities.- Parameters:
indexes- finite trusted generated definitionscapacity- maximum owned instances and concurrent call scopesconfiguration- optional live configuration, required by config edgesbindings- explicit immutable host capability registry, never application supplied- Returns:
- started activation; host bindings are owned and closed on failure or shutdown
- Throws:
IllegalStateException- for invalid graph, metadata, binding or construction failure
-
provider
public <T> org.j7m.middleware.application.api.ManagedProvider<T> provider(Class<T> type, String name, List<org.j7m.middleware.application.api.ManagedQualifier> qualifiers) Creates a lazy root lookup. CALL values require CallScope.call to be active on this thread.- Type Parameters:
T- required contract- Parameters:
type- required contractname- exact namequalifiers- exact qualifiers- Returns:
- provider which never captures an old call scope
- Throws:
IllegalStateException- if selection is missing/ambiguous or the container is closed
-
openCall
Opens a detached explicit call scope. Use call() to make it visible to lazy providers.- Returns:
- new independently owned scope
- Throws:
IllegalStateException- if closed or the bounded call capacity is exhausted
-
status
Returns aggregate state without sensitive component metadata.- Returns:
- immutable lifecycle counters
-
lifecycle
public void lifecycle(org.j7m.middleware.application.api.ManagedLifecycle phase) Runs managed lifecycle phases over owned generated host adapters. Initialization/startup follow dependency construction order; drain/shutdown use reverse order. Newly created CALL/PROTOTYPE values inherit the activation's initialized/started phases and are shut down when their actual owning scope closes. Failed hooks never cause repeat cleanup.- Parameters:
phase- requested phase, never null- Throws:
IllegalStateException- on application hook failure or shutdown while calls are running
-
close
public void close()Closes idle call scopes and then activation products. Running calls must drain explicitly. All remaining disposers run even if one fails. Repeated close never repeats disposal.- Specified by:
closein interfaceAutoCloseable- Throws:
IllegalStateException- if calls are running or any disposer fails
-