Class ManagedPartitionFactory

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

public final class ManagedPartitionFactory extends Object implements org.j7m.middleware.application.components.ManagedHostedResources.Factory, AutoCloseable
Trusted finite host adapter registering real replicated encoded POJO partitions. Install this factory explicitly under hosted kind partition. It does not grant applications topology authority or raw native handles. Pure reducer callbacks do not enter RPC policies or transactions; they must be deterministic and effect-free. Only exact program/schema/configuration restarts are supported. Drain waits for actual native apply and resource work before releasing the borrowed reducer or its classloader. This factory is thread-safe and owns bounded close workers.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Snapshots finite host-approved partition policies without opening storage or starting code.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns finite local bound addresses for trusted host discovery and native status probes.
    Set<Class<? extends Annotation>>
    Returns the pure reducer backend capability, independent of hosted invocation callbacks.
    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)
    Creates one exclusive local resource lifecycle; prepare performs actual durable recovery.
    void
    Refuses to discard active resources and releases idle host workers only after all drains.
    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 exact descriptor, pure component and schema types before component construction.

    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

    requiredPolicies
  • Constructor Details

    • ManagedPartitionFactory

      public ManagedPartitionFactory(Map<String, ManagedPartitionProfile> profiles)
      Snapshots finite host-approved partition policies without opening storage or starting code.
      Parameters:
      profiles - policy names to immutable local profiles,1..64 entries
      Throws:
      IllegalArgumentException - for invalid names, duplicate resource directories or capacity
  • Method Details

    • backendKinds

      public Set<String> backendKinds()
      Returns the pure reducer backend capability, independent of hosted invocation callbacks.
      Specified by:
      backendKinds in interface org.j7m.middleware.application.components.ManagedHostedResources.Factory
      Returns:
      exact partition backend kind
    • annotationTypes

      public Set<Class<? extends Annotation>> annotationTypes()
      Specified by:
      annotationTypes in interface org.j7m.middleware.application.components.ManagedHostedResources.Factory
    • 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 exact descriptor, pure component and schema types before component construction.
      Specified by:
      validate in interface org.j7m.middleware.application.components.ManagedHostedResources.Factory
      Parameters:
      feature - finite generated declaration
      definition - direct generated program
      bundle - verified whole-artifact identity and semantic configuration
      Throws:
      IllegalArgumentException - for an unsupported policy, data model or impure component shape
    • 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)
      Creates one exclusive local resource lifecycle; prepare performs actual durable recovery.
      Specified by:
      bind in interface org.j7m.middleware.application.components.ManagedHostedResources.Factory
      Parameters:
      feature - validated generated partition declaration
      definition - exact generated definition
      component - borrowed stateless reducer
      bundle - host-verified artifact/configuration snapshot
      invoker - trusted shared activation admission guard; never called from replicated apply
      Returns:
      owned finite lifecycle
      Throws:
      IllegalArgumentException - for unsupported or duplicate registration
      IllegalStateException - if this host factory has closed
    • addresses

      public Map<String, InetSocketAddress> addresses()
      Returns finite local bound addresses for trusted host discovery and native status probes. This synchronized metadata snapshot is not a readiness, ownership or quorum assertion. Use an authenticated PartitionClient.status with the original deadline for authoritative group/epoch/phase/logical-position evidence. Empty means not prepared or already released. No node mutex, network call or application callback is entered by this method.
      Returns:
      immutable resource ID to actual bound address map, at most64 entries
    • close

      public void close()
      Refuses to discard active resources and releases idle host workers only after all drains.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IllegalStateException - while an owned binding has not actually drained and closed