Interface ObjectRegistration<T>

Type Parameters:
T - primary Java interface type
All Superinterfaces:
AutoCloseable

public interface ObjectRegistration<T> extends AutoCloseable
Registration handle returned from MiddlewareRuntime.export(String, T, Class, ExportOptions).

The handle is thread-safe when implemented by the runtime. Closing it is idempotent and unexports the concrete instance represented by ref().

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Unexports the object.
    Returns the local target instance owned by the runtime.
    ref()
    Returns the exported object reference.
    default void
    setReadiness(boolean ready, Duration validity)
    Sets host-owned readiness with a finite freshness bound, without changing export identity.
    Returns the current instance status.
  • Method Details

    • ref

      ObjectRef ref()
      Returns the exported object reference.
      Returns:
      object reference
    • instance

      T instance()
      Returns the local target instance owned by the runtime.
      Returns:
      local target instance
    • status

      InstanceStatus status()
      Returns the current instance status.
      Returns:
      status snapshot
    • setReadiness

      default void setReadiness(boolean ready, Duration validity)
      Sets host-owned readiness with a finite freshness bound, without changing export identity. Only the registration owner receives this handle; invocation metadata cannot call this setter. Once enabled, expiry is unready even if the probe/heartbeat scheduler stops. Legacy exports which never opt in retain their existing unlimited readiness behavior. A false observation never becomes ready merely because it expires. Unsupported runtimes fail closed.
      Parameters:
      ready - latest trusted host readiness result
      validity - freshness duration from1millisecond through5minutes
      Throws:
      MiddlewareException - for unsupported runtimes, invalid validity or closed registrations
    • close

      void close()
      Unexports the object. The method is idempotent.
      Specified by:
      close in interface AutoCloseable