Class ResourceBindingFactory
java.lang.Object
org.j7m.middleware.application.distributed.ResourceBindingFactory
- All Implemented Interfaces:
org.j7m.middleware.application.components.ManagedHostBindings.Factory
public final class ResourceBindingFactory
extends Object
implements org.j7m.middleware.application.components.ManagedHostBindings.Factory
Trusted optional host adapter for named D resources, separate from ObjectRef business RPC.
Raw group resources accept NEVER only: their native leader protocol is intrinsic and unchanged.
Partition registrations support authoritative ownership refresh with no same-call replay.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOpaque host-owned resource registration, created only through concrete supported factories. -
Constructor Summary
ConstructorsConstructorDescriptionResourceBindingFactory(Map<String, ResourceBindingFactory.Registration> resources, Set<String> policies) Registers finite explicitly authorized named resource capabilities. -
Method Summary
Modifier and TypeMethodDescriptionorg.j7m.middleware.application.components.ManagedHostBindings.BoundValuebind(org.j7m.middleware.application.api.ManagedDependency dependency) Registers a provider-only lookup of the current acquired deduplication claim.execution(String partition, String scope, org.j7m.middleware.distributed.PartitionAdminClient topology, Map<String, org.j7m.middleware.distributed.PartitionEndpoint> groups, Duration preparationBudget) Constructs a real jobs/sagas/RPC execution client with authoritative owner routing.execution(String partition, String scope, org.j7m.middleware.distributed.PartitionAdminClient topology, Map<String, org.j7m.middleware.distributed.PartitionEndpoint> groups, Duration preparationBudget, Supplier<Map<String, String>> context, org.j7m.middleware.distributed.ExecutionClient.Observer observer) Constructs an instrumented typed execution binding without a vendor dependency.executionGroup(String partition, String scope, org.j7m.middleware.distributed.PartitionEndpoint endpoint, long epoch) Constructs an authorized scope-bound execution client over a fixed owner group.group(org.j7m.middleware.distributed.ResourceEndpoint endpoint) Borrows a raw group endpoint; native D leader following and durable identities are preserved.Registers the current transaction's exact guarded Connection, without a global switching proxy.Registers provider-only access to the actual current local JDBC transaction context.Supplies the actual current job callback context through a provider only.Registers provider-only lookup of the actual current native ownership claim.partition(String partition, org.j7m.middleware.distributed.PartitionAdminClient topology, Map<String, org.j7m.middleware.distributed.PartitionEndpoint> groups, Duration preparationBudget) Registers an authoritative partition identity with bounded preparation and trusted clients.partitionGroup(org.j7m.middleware.distributed.PartitionEndpoint endpoint) Borrows a raw single-owner partition group endpoint; no ownership refresh is claimed.Borrows a typed encoded-program client with its own authoritative per-operation D08 routing.queue(String partition, String scope, org.j7m.middleware.distributed.PartitionAdminClient topology, Map<String, org.j7m.middleware.distributed.PartitionEndpoint> groups, Duration preparationBudget) Constructs a real queue facade with authoritative owner routing and stable durable identities.queueGroup(String partition, String scope, org.j7m.middleware.distributed.PartitionEndpoint endpoint, long epoch) Constructs an authorized scope-bound queue client over a fixed owner group.Registers provider-only access to the actual current native resource transaction.saga(ManagedSagaClient client) Registers one host-selected saga client with a revocable binding view.Supplies the actual current saga callback context through a provider only.voidvalidate(org.j7m.middleware.application.api.ManagedDependency dependency, org.j7m.middleware.annotations.Scope.Kind scope)
-
Constructor Details
-
ResourceBindingFactory
public ResourceBindingFactory(Map<String, ResourceBindingFactory.Registration> resources, Set<String> policies) Registers finite explicitly authorized named resource capabilities.- Parameters:
resources- at most256 immutable named registrationspolicies- host-approved binding policy IDs, at most256- Throws:
IllegalArgumentException- for invalid IDs/capacity
-
-
Method Details
-
deduplicationContext
Registers a provider-only lookup of the current acquired deduplication claim. The returned value is the actual lifetime-bound capability, never a mutable global facade.- Returns:
- NEVER-only registration requiring an active managed deduplication invocation
-
ownershipContext
Registers provider-only lookup of the actual current native ownership claim. An existing claim object never rebinds to another owner. Lookup outside an owned invocation fails, and refresh modes cannot manufacture a new lease or revive a revoked context.- Returns:
- NEVER-only invocation capability registration
-
sagaContext
Supplies the actual current saga callback context through a provider only.- Returns:
- host registration that cannot capture a context across callbacks
-
jobContext
Supplies the actual current job callback context through a provider only.- Returns:
- NEVER-only registration that cannot capture or retarget callback ownership
-
saga
Registers one host-selected saga client with a revocable binding view. Closing this binding blocks new client operations without closing shared native endpoints.- Parameters:
client- trusted definition/version facade- Returns:
- NEVER-refresh registration; each operation resolves actual admitted ownership
- Throws:
NullPointerException- for a missing client
-
resourceTransactionContext
Registers provider-only access to the actual current native resource transaction.- Returns:
- NEVER-only borrowed invocation capability registration
-
jdbcTransactionContext
Registers provider-only access to the actual current local JDBC transaction context.- Returns:
- NEVER-only borrowed invocation capability registration
-
jdbcConnection
Registers the current transaction's exact guarded Connection, without a global switching proxy.- Returns:
- provider-only NEVER registration; lookup requires actual owned USER context
-
partitionProgram
Borrows a typed encoded-program client with its own authoritative per-operation D08 routing. The binding supports NEVER selection because the client already resolves current ownership. Its concrete program/schema contract is validated on every operation; typed query additionally checks the requested Java view type. No generic DI graph extension is needed. Closing the binding revokes its scoped view before further codec/RPC entry, without closing the trusted host's original client, schemas or shared endpoints.- Parameters:
client- prepared thread-safe authorized client for one concrete program and scope- Returns:
- explicit typed client capability registration
- Throws:
NullPointerException- for a missing client
-
group
public static ResourceBindingFactory.Registration group(org.j7m.middleware.distributed.ResourceEndpoint endpoint) Borrows a raw group endpoint; native D leader following and durable identities are preserved.- Parameters:
endpoint- already authenticated authorized resource endpoint- Returns:
- registration supporting NEVER selection
-
partitionGroup
public static ResourceBindingFactory.Registration partitionGroup(org.j7m.middleware.distributed.PartitionEndpoint endpoint) Borrows a raw single-owner partition group endpoint; no ownership refresh is claimed.- Parameters:
endpoint- authenticated authorized group endpoint- Returns:
- registration supporting NEVER selection
-
partition
public static ResourceBindingFactory.Registration partition(String partition, org.j7m.middleware.distributed.PartitionAdminClient topology, Map<String, org.j7m.middleware.distributed.PartitionEndpoint> groups, Duration preparationBudget) Registers an authoritative partition identity with bounded preparation and trusted clients.- Parameters:
partition- stable partition identitytopology- separately authorized topology read facadegroups- authorized group endpointspreparationBudget- positive at most30seconds- Returns:
- registration supporting all three binding modes
- Throws:
IllegalArgumentException- for invalid preparation budget
-
queueGroup
public static ResourceBindingFactory.Registration queueGroup(String partition, String scope, org.j7m.middleware.distributed.PartitionEndpoint endpoint, long epoch) Constructs an authorized scope-bound queue client over a fixed owner group. Native leader following and identical-ID MOVED/FROZEN handling remain queue protocol behavior.- Parameters:
partition- stable queue partitionscope- authenticated endpoint tenant scopeendpoint- borrowed authorized group endpointepoch- positive fixed ownership epoch- Returns:
- NEVER-only typed registration; closing revokes its endpoint wrapper
-
executionGroup
public static ResourceBindingFactory.Registration executionGroup(String partition, String scope, org.j7m.middleware.distributed.PartitionEndpoint endpoint, long epoch) Constructs an authorized scope-bound execution client over a fixed owner group.- Parameters:
partition- stable execution partitionscope- authenticated endpoint tenant scopeendpoint- borrowed authorized group endpointepoch- positive fixed ownership epoch- Returns:
- NEVER-only typed execution registration
-
queue
public static ResourceBindingFactory.Registration queue(String partition, String scope, org.j7m.middleware.distributed.PartitionAdminClient topology, Map<String, org.j7m.middleware.distributed.PartitionEndpoint> groups, Duration preparationBudget) Constructs a real queue facade with authoritative owner routing and stable durable identities. Binding refresh never repeats an endpoint invocation. Native queue retries only its documented identical-ID MOVED/FROZEN protocol, never an IOException/UNKNOWN or a new business identity.- Parameters:
partition- stable queue partitionscope- authenticated tenant scopetopology- borrowed authorized topology readergroups- borrowed authorized group clientspreparationBudget- positive preparation bound at most30seconds- Returns:
- typed queue registration supporting all refresh modes
-
execution
public static ResourceBindingFactory.Registration execution(String partition, String scope, org.j7m.middleware.distributed.PartitionAdminClient topology, Map<String, org.j7m.middleware.distributed.PartitionEndpoint> groups, Duration preparationBudget) Constructs a real jobs/sagas/RPC execution client with authoritative owner routing. External effects are never invoked by this factory or client; UNKNOWN needs reconciliation.- Parameters:
partition- stable execution partitionscope- authenticated tenant scopetopology- borrowed authorized topology readergroups- borrowed authorized group clientspreparationBudget- positive preparation bound at most30seconds- Returns:
- typed execution registration supporting all refresh modes
-
execution
public static ResourceBindingFactory.Registration execution(String partition, String scope, org.j7m.middleware.distributed.PartitionAdminClient topology, Map<String, org.j7m.middleware.distributed.PartitionEndpoint> groups, Duration preparationBudget, Supplier<Map<String, String>> context, org.j7m.middleware.distributed.ExecutionClient.Observer observer) Constructs an instrumented typed execution binding without a vendor dependency.- Parameters:
partition- stable execution partitionscope- authenticated tenant scopetopology- borrowed authorized topology readergroups- borrowed authorized group clientspreparationBudget- positive bounded preparation timecontext- calling-thread W3C carrier supplier, never credentialsobserver- no-throw execution lifecycle observer- Returns:
- typed execution registration preserving supplied context/instrumentation hooks
-
validate
public void validate(org.j7m.middleware.application.api.ManagedDependency dependency, org.j7m.middleware.annotations.Scope.Kind scope) - Specified by:
validatein interfaceorg.j7m.middleware.application.components.ManagedHostBindings.Factory
-
bind
-