Class DefaultMiddlewareRuntime
java.lang.Object
org.j7m.middleware.core.DefaultMiddlewareRuntime
- All Implemented Interfaces:
AutoCloseable, org.j7m.middleware.api.MiddlewareRuntime, org.j7m.middleware.transport.api.RuntimeTransportContext
public final class DefaultMiddlewareRuntime
extends Object
implements org.j7m.middleware.api.MiddlewareRuntime, org.j7m.middleware.transport.api.RuntimeTransportContext
Default Phase 1 middleware runtime implementation.
The runtime is thread-safe. It owns its registry client, transport
providers, heartbeat scheduler, exported object descriptors, and invocation
log. Public failures are normalized into MiddlewareException.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultMiddlewareRuntime(RuntimeConfiguration configuration) Creates and starts a runtime from configuration.DefaultMiddlewareRuntime(RuntimeConfiguration configuration, List<? extends AutoCloseable> ownedResources) Creates and starts a runtime from configuration and additional lifecycle-owned resources. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()org.j7m.middleware.codec.api.ValueCodeccodec()List<org.j7m.middleware.api.ObjectRegistration<?>> commitPreparedExports(List<? extends org.j7m.middleware.api.PreparedObjectRegistration<?>> preparedExports) decodeValue(org.j7m.middleware.codec.api.EncodedValue value, Class<?> expectedType) describeTarget(org.j7m.middleware.api.ObjectRef target) org.j7m.middleware.codec.api.EncodedValuedispatch(org.j7m.middleware.api.ObjectRef target, org.j7m.middleware.transport.api.MethodDescriptor method, List<org.j7m.middleware.codec.api.EncodedValue> arguments, org.j7m.middleware.api.InvocationOptions options) org.j7m.middleware.codec.api.EncodedValuedispatchLogicalAsyncTrusted(org.j7m.middleware.api.ObjectRef target, org.j7m.middleware.transport.api.MethodDescriptor method, List<org.j7m.middleware.codec.api.EncodedValue> arguments, org.j7m.middleware.api.InvocationOptions options, org.j7m.middleware.security.api.SecurityContext trustedContext, org.j7m.middleware.transport.api.InvocationCancellation cancellation) org.j7m.middleware.codec.api.EncodedValuedispatchTrusted(org.j7m.middleware.api.ObjectRef target, org.j7m.middleware.transport.api.MethodDescriptor method, List<org.j7m.middleware.codec.api.EncodedValue> arguments, org.j7m.middleware.api.InvocationOptions options, org.j7m.middleware.security.api.SecurityContext trustedContext) org.j7m.middleware.codec.api.EncodedValueencodeValue(Object value, Class<?> declaredType) voidexecuteOneWay(Runnable task) <T> org.j7m.middleware.api.ObjectRegistration<T> export(String serviceName, T instance, Class<T> primaryInterface, org.j7m.middleware.api.ExportOptions options) org.j7m.middleware.api.ObjectRefexportCallback(Object value, Class<?> declaredType) org.j7m.middleware.api.RuntimeIdentityidentity()List<org.j7m.middleware.api.ObjectRef> list(String serviceName, List<String> interfaces, Map<String, String> requiredParams, org.j7m.middleware.api.LookupOptions options) <T> T<T> org.j7m.middleware.api.PreparedObjectRegistration<T> prepareExport(String serviceName, T instance, Class<T> primaryInterface, org.j7m.middleware.api.ExportOptions options) <T> T<T> Treference(org.j7m.middleware.api.ObjectRef reference, Class<T> contract, org.j7m.middleware.api.ProxyOptions options) voidreleaseInvocationCallbacks(List<org.j7m.middleware.codec.api.EncodedValue> encodedArguments) org.j7m.middleware.api.RuntimeStatusstatus()voidvalidateTarget(org.j7m.middleware.api.ObjectRef target, String requiredInterface) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.j7m.middleware.transport.api.RuntimeTransportContext
releaseFailedInvocationCallbacks
-
Constructor Details
-
DefaultMiddlewareRuntime
Creates and starts a runtime from configuration.- Parameters:
configuration- runtime configuration
-
DefaultMiddlewareRuntime
public DefaultMiddlewareRuntime(RuntimeConfiguration configuration, List<? extends AutoCloseable> ownedResources) Creates and starts a runtime from configuration and additional lifecycle-owned resources.The supplied resources are closed during runtime shutdown before exported objects, executors, transports, and the registry are closed. The kernel treats these resources only as generic
AutoCloseableinstances; callers must not rely on kernel knowledge of higher-level resource semantics.- Parameters:
configuration- runtime configurationownedResources- additional resources owned by the runtime
-
-
Method Details
-
identity
public org.j7m.middleware.api.RuntimeIdentity identity()- Specified by:
identityin interfaceorg.j7m.middleware.api.MiddlewareRuntime- Specified by:
identityin interfaceorg.j7m.middleware.transport.api.RuntimeTransportContext
-
codec
public org.j7m.middleware.codec.api.ValueCodec codec()- Specified by:
codecin interfaceorg.j7m.middleware.transport.api.RuntimeTransportContext
-
export
-
prepareExport
-
commitPreparedExports
-
lookup
-
list
-
status
public org.j7m.middleware.api.RuntimeStatus status()- Specified by:
statusin interfaceorg.j7m.middleware.api.MiddlewareRuntime
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceorg.j7m.middleware.api.MiddlewareRuntime
-
encodeValue
-
decodeValue
-
dispatch
public org.j7m.middleware.codec.api.EncodedValue dispatch(org.j7m.middleware.api.ObjectRef target, org.j7m.middleware.transport.api.MethodDescriptor method, List<org.j7m.middleware.codec.api.EncodedValue> arguments, org.j7m.middleware.api.InvocationOptions options) - Specified by:
dispatchin interfaceorg.j7m.middleware.transport.api.RuntimeTransportContext
-
dispatchTrusted
public org.j7m.middleware.codec.api.EncodedValue dispatchTrusted(org.j7m.middleware.api.ObjectRef target, org.j7m.middleware.transport.api.MethodDescriptor method, List<org.j7m.middleware.codec.api.EncodedValue> arguments, org.j7m.middleware.api.InvocationOptions options, org.j7m.middleware.security.api.SecurityContext trustedContext) - Specified by:
dispatchTrustedin interfaceorg.j7m.middleware.transport.api.RuntimeTransportContext
-
dispatchLogicalAsyncTrusted
public org.j7m.middleware.codec.api.EncodedValue dispatchLogicalAsyncTrusted(org.j7m.middleware.api.ObjectRef target, org.j7m.middleware.transport.api.MethodDescriptor method, List<org.j7m.middleware.codec.api.EncodedValue> arguments, org.j7m.middleware.api.InvocationOptions options, org.j7m.middleware.security.api.SecurityContext trustedContext, org.j7m.middleware.transport.api.InvocationCancellation cancellation) - Specified by:
dispatchLogicalAsyncTrustedin interfaceorg.j7m.middleware.transport.api.RuntimeTransportContext
-
exportCallback
-
proxyFor
- Specified by:
proxyForin interfaceorg.j7m.middleware.transport.api.RuntimeTransportContext
-
reference
public <T> T reference(org.j7m.middleware.api.ObjectRef reference, Class<T> contract, org.j7m.middleware.api.ProxyOptions options) - Specified by:
referencein interfaceorg.j7m.middleware.api.MiddlewareRuntime
-
validateTarget
- Specified by:
validateTargetin interfaceorg.j7m.middleware.transport.api.RuntimeTransportContext
-
describeTarget
-
releaseInvocationCallbacks
public void releaseInvocationCallbacks(List<org.j7m.middleware.codec.api.EncodedValue> encodedArguments) - Specified by:
releaseInvocationCallbacksin interfaceorg.j7m.middleware.transport.api.RuntimeTransportContext
-
executeOneWay
- Specified by:
executeOneWayin interfaceorg.j7m.middleware.transport.api.RuntimeTransportContext
-