Class MiddlewareRuntimeBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a builder with default codec, registry, and clock. -
Method Summary
Modifier and TypeMethodDescriptionaddTransport(org.j7m.middleware.transport.api.TransportProvider provider) Adds a transport provider.org.j7m.middleware.core.DefaultMiddlewareRuntimebuild()Builds and starts the runtime.Sets the runtime clock.codec(org.j7m.middleware.codec.api.ValueCodec codec) Sets the value codec.Explicitly disables runtime-owned nugget administration.nuggetAdmin(NuggetAdminRuntimeConfiguration configuration) Configures the runtime-owned nugget administration service.registry(org.j7m.middleware.registry.api.RegistryClient registry) Sets the registry client.registryContext(String registryContext) Sets the registry context.Sets the runtime id.security(org.j7m.middleware.security.api.SecurityConfiguration security) Sets runtime security configuration.
-
Constructor Details
-
MiddlewareRuntimeBuilder
public MiddlewareRuntimeBuilder()Creates a builder with default codec, registry, and clock.
-
-
Method Details
-
runtimeId
Sets the runtime id.- Parameters:
runtimeId- runtime identifier- Returns:
- this builder
-
registryContext
Sets the registry context.- Parameters:
registryContext- registry context- Returns:
- this builder
-
registry
Sets the registry client.- Parameters:
registry- registry client- Returns:
- this builder
-
codec
Sets the value codec.- Parameters:
codec- value codec- Returns:
- this builder
-
clock
Sets the runtime clock.- Parameters:
clock- clock- Returns:
- this builder
-
addTransport
public MiddlewareRuntimeBuilder addTransport(org.j7m.middleware.transport.api.TransportProvider provider) Adds a transport provider.- Parameters:
provider- provider owned by the runtime- Returns:
- this builder
-
security
public MiddlewareRuntimeBuilder security(org.j7m.middleware.security.api.SecurityConfiguration security) Sets runtime security configuration.- Parameters:
security- security configuration- Returns:
- this builder
-
nuggetAdmin
Configures the runtime-owned nugget administration service.Supplying this configuration keeps nugget administration enabled and makes the returned runtime own the started service. The runtime closes the service during shutdown before closing transports and the registry. The configuration must include a valid PIN source unless it explicitly disables admin or explicitly enables unsafe developer mode.
- Parameters:
configuration- nugget administration configuration- Returns:
- this builder
- Throws:
IllegalArgumentException- whenconfigurationisnull
-
disableNuggetAdmin
Explicitly disables runtime-owned nugget administration.This method is intended for tests, demos, and embedders that do not expose the Phase 7 operations plane. Production runtime construction is otherwise fail-closed: nugget administration is enabled by default and a missing PIN source rejects startup.
- Returns:
- this builder
-
build
public org.j7m.middleware.core.DefaultMiddlewareRuntime build()Builds and starts the runtime.When no transport providers were explicitly supplied through
addTransport(TransportProvider), the builder loadsTransportProviderimplementations throughServiceLoader. Provider loading is bounded, sorted by provider class name, and fails fast when no provider is available. Explicitly supplied providers always take precedence and do not trigger service loading.- Returns:
- runtime
-