Interface ApplicationContext
public interface ApplicationContext
Safe capabilities supplied to application lifecycle hooks.
The context is thread-safe if the supplied capability implementations are thread-safe. It intentionally hides runtime maps, registry internals, transport providers, and classloader management.
The context is owned by one application activation lifecycle. It exposes
only safe capability facades for configuration, service export, audit,
metrics, and resource snapshots. Security decisions remain the responsibility
of the runtime and policy layer; the activation principal is informational
unless an API explicitly accepts it as input. Configuration, audit, metrics,
and resource status must be redacted before they are published. JPMS module
descriptors and declared opens clauses remain authoritative for
lifecycle and injection access.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the principal that requested this activation.Returns the immutable identity of the deployed application.audit()Returns the application-scoped audit publishing capability.Returns an immutable application configuration view.Returns the identity of the currently active application instance.metrics()Returns the application-scoped metrics publishing capability.Returns the current resource usage snapshot visible to the application.Returns the runtime identity hosting this application instance.services()Returns the safe service export capability for this application.
-
Method Details
-
applicationIdentity
ApplicationIdentity applicationIdentity()Returns the immutable identity of the deployed application.- Returns:
- application identity
-
instanceIdentity
ApplicationInstanceIdentity instanceIdentity()Returns the identity of the currently active application instance.- Returns:
- active instance identity
-
activationPrincipal
Principal activationPrincipal()Returns the principal that requested this activation.- Returns:
- principal that requested activation
-
runtimeIdentity
RuntimeIdentity runtimeIdentity()Returns the runtime identity hosting this application instance.- Returns:
- owning runtime identity
-
configuration
ConfigurationView configuration()Returns an immutable application configuration view.- Returns:
- immutable configuration view
-
services
ServiceExporter services()Returns the safe service export capability for this application.- Returns:
- safe service exporter
-
audit
AuditPublisher audit()Returns the application-scoped audit publishing capability.- Returns:
- safe audit publisher
-
metrics
MetricsPublisher metrics()Returns the application-scoped metrics publishing capability.- Returns:
- safe metrics publisher
-
resources
ResourceUsageSnapshot resources()Returns the current resource usage snapshot visible to the application.- Returns:
- current resource snapshot
-