Class ManagedJobFactory

java.lang.Object
org.j7m.middleware.application.distributed.ManagedJobFactory
All Implemented Interfaces:
AutoCloseable, org.j7m.middleware.application.components.ManagedHostedResources.Factory, org.j7m.middleware.application.components.ManagedInvocationPolicy

public final class ManagedJobFactory extends Object implements org.j7m.middleware.application.components.ManagedHostedResources.Factory, org.j7m.middleware.application.components.ManagedInvocationPolicy, AutoCloseable
General POJO durable job host using actual owned calls and reactive native claim delivery. Install this exact instance as both hosted factory and REPLAY policy. Native completion follows USER settlement and inner transaction finalizers; checkpoint/progress are explicit safe points. Bounded workers, reconnect timers and renewals do not turn cancellation into physical completion.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Actual local lifecycle, independent of a public stage's cancellation.
    static enum 
    Fixed redacted diagnostics; none contains input, exception text or credentials.
    static final record 
    Immutable local host observation.

    Nested classes/interfaces inherited from interface org.j7m.middleware.application.components.ManagedInvocationPolicy

    org.j7m.middleware.application.components.ManagedInvocationPolicy.Binding, org.j7m.middleware.application.components.ManagedInvocationPolicy.Proceed
  • Constructor Summary

    Constructors
    Constructor
    Description
    ManagedJobFactory(Map<String, ManagedJobProfile> profiles, int maximumWorkers, int maximumQueued)
    Creates a bounded host without scheduled definitions.
    ManagedJobFactory(Map<String, ManagedJobProfile> profiles, Map<String, ManagedScheduleProfile> triggers, int maximumWorkers, int maximumQueued)
    Creates explicit native job and durable trigger capabilities without starting work.
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<Class<? extends Annotation>>
    Returns actual finite job/hook capabilities.
    org.j7m.middleware.application.components.ManagedHostedResources.Binding
    bind(org.j7m.middleware.application.api.ManagedHostedFeature feature, org.j7m.middleware.application.api.ManagedComponentDefinition<?> definition, Object component, org.j7m.middleware.application.components.ManagedHostedResources.Bundle bundle, org.j7m.middleware.application.components.ManagedHostedResources.Invoker invoker)
    Binds one real activation component without admitting work until global commit.
    org.j7m.middleware.application.components.ManagedInvocationPolicy.Binding
    bind(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface)
    Installs only a genuine captured claim context and owned result finalizer.
    client(String policy, String definition, int version)
    Selects producer metadata by the exact trusted profile, definition and version.
    void
    Closes worker resources only after all bound resources have actually drained and closed.
    org.j7m.middleware.application.components.ManagedInvocationPolicy.Phase
    Places native replay/completion outside transaction commit and inside security/admission.
    Set<org.j7m.middleware.application.components.ManagedInvocationPolicy>
    Requires the same actual guard instance before component construction.
    Returns bounded local observations without application data.
    void
    validate(org.j7m.middleware.application.api.ManagedHostedFeature feature, org.j7m.middleware.application.api.ManagedComponentDefinition<?> definition, org.j7m.middleware.application.components.ManagedHostedResources.Bundle bundle)
    Validates the complete finite plan, schema allowlist and selected policies before constructors.
    void
    validate(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface)
    Allows only the actual hosted contract for a job component, never an RPC alias.
    void
    validateComponent(Class<?> component, boolean exported)
    Rejects job metadata without an actual hosted entry boundary.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.j7m.middleware.application.components.ManagedHostedResources.Factory

    backendKinds

    Methods inherited from interface org.j7m.middleware.application.components.ManagedInvocationPolicy

    bindHosted, validateExposure, validateHosted, validateHostedExposure, validateHostedExposure
  • Constructor Details

    • ManagedJobFactory

      public ManagedJobFactory(Map<String, ManagedJobProfile> profiles, int maximumWorkers, int maximumQueued)
      Creates a bounded host without scheduled definitions.
      Parameters:
      profiles - immutable named native job sources, at most64
      maximumWorkers - concurrent synchronous callback roots,1..16
      maximumQueued - bounded ready queue,1..64
    • ManagedJobFactory

      public ManagedJobFactory(Map<String, ManagedJobProfile> profiles, Map<String, ManagedScheduleProfile> triggers, int maximumWorkers, int maximumQueued)
      Creates explicit native job and durable trigger capabilities without starting work.
      Parameters:
      profiles - immutable named job profiles, at most64
      triggers - immutable named durable trigger profiles, at most64
      maximumWorkers - concurrent synchronous roots,1..16
      maximumQueued - bounded ready queue,1..64
      Throws:
      IllegalArgumentException - for invalid names or capacity
      NullPointerException - for missing profiles
  • Method Details

    • annotationTypes

      public Set<Class<? extends Annotation>> annotationTypes()
      Returns actual finite job/hook capabilities.
      Specified by:
      annotationTypes in interface org.j7m.middleware.application.components.ManagedHostedResources.Factory
      Specified by:
      annotationTypes in interface org.j7m.middleware.application.components.ManagedInvocationPolicy
      Returns:
      immutable marker allowlist
    • requiredPolicies

      public Set<org.j7m.middleware.application.components.ManagedInvocationPolicy> requiredPolicies()
      Requires the same actual guard instance before component construction.
      Specified by:
      requiredPolicies in interface org.j7m.middleware.application.components.ManagedHostedResources.Factory
      Returns:
      this exact policy installation
    • phase

      public org.j7m.middleware.application.components.ManagedInvocationPolicy.Phase phase()
      Places native replay/completion outside transaction commit and inside security/admission.
      Specified by:
      phase in interface org.j7m.middleware.application.components.ManagedInvocationPolicy
      Returns:
      REPLAY phase
    • validate

      public void validate(org.j7m.middleware.application.api.ManagedHostedFeature feature, org.j7m.middleware.application.api.ManagedComponentDefinition<?> definition, org.j7m.middleware.application.components.ManagedHostedResources.Bundle bundle)
      Validates the complete finite plan, schema allowlist and selected policies before constructors.
      Specified by:
      validate in interface org.j7m.middleware.application.components.ManagedHostedResources.Factory
      Parameters:
      feature - generated job declaration
      definition - exact generated adapter
      bundle - verified artifact/configuration identity
    • validateComponent

      public void validateComponent(Class<?> component, boolean exported)
      Rejects job metadata without an actual hosted entry boundary.
      Specified by:
      validateComponent in interface org.j7m.middleware.application.components.ManagedInvocationPolicy
      Parameters:
      component - declared finite component
      exported - whether the host has actual service/callback exposure
    • validate

      public void validate(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface)
      Allows only the actual hosted contract for a job component, never an RPC alias.
      Specified by:
      validate in interface org.j7m.middleware.application.components.ManagedInvocationPolicy
      Parameters:
      contract - full hosted identity
      implementation - concrete component
      businessInterface - finite host callback type
    • bind

      public org.j7m.middleware.application.components.ManagedInvocationPolicy.Binding bind(org.j7m.middleware.application.api.ManagedServiceContract contract, Class<?> implementation, Class<?> businessInterface)
      Installs only a genuine captured claim context and owned result finalizer.
      Specified by:
      bind in interface org.j7m.middleware.application.components.ManagedInvocationPolicy
      Parameters:
      contract - validated hosted contract
      implementation - concrete component
      businessInterface - finite generated host type
      Returns:
      borrowed per-boundary policy state
    • bind

      public org.j7m.middleware.application.components.ManagedHostedResources.Binding bind(org.j7m.middleware.application.api.ManagedHostedFeature feature, org.j7m.middleware.application.api.ManagedComponentDefinition<?> definition, Object component, org.j7m.middleware.application.components.ManagedHostedResources.Bundle bundle, org.j7m.middleware.application.components.ManagedHostedResources.Invoker invoker)
      Binds one real activation component without admitting work until global commit.
      Specified by:
      bind in interface org.j7m.middleware.application.components.ManagedHostedResources.Factory
      Parameters:
      feature - validated feature
      definition - actual generated job adapter
      component - activation-owned POJO, never closed by this factory
      bundle - verified immutable program identity
      invoker - fixed-principal owned call handle
      Returns:
      activation-owned lifecycle
    • client

      public ManagedJobClient client(String policy, String definition, int version)
      Selects producer metadata by the exact trusted profile, definition and version.
      Parameters:
      policy - installed profile name
      definition - stable job definition identity
      version - positive logical contract version
      Returns:
      independently closeable borrowed-endpoint producer/query facade
      Throws:
      IllegalArgumentException - if absent or ambiguous
    • statuses

      public List<ManagedJobFactory.Status> statuses()
      Returns bounded local observations without application data.
      Returns:
      at most64 immutable lifecycle observations
    • close

      public void close()
      Closes worker resources only after all bound resources have actually drained and closed.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IllegalStateException - if a binding still owns actual work