Class CatalogCompatibilityGate
Content-present predicate: a catalog is considered present when shipped-workflows/index
resolves on the classpath and contains at least one non-blank entry. When it is absent or empty
the gate is a no-op — a pure framework with no catalog jar loads zero shipped workflows, which is
valid, not an error. When a catalog is present its
shipped-workflows/agentforge4j-catalog.json manifest is required: a missing, unparseable,
or out-of-range manifest fails fast with CatalogCompatibilityException. Test fixtures
loaded from other roots (e.g. /test-workflows/) never trip this gate.
Resources are resolved through the same loader the locators use
(WorkflowBundleLocator.class.getClassLoader()); version bounds are compared numerically by
NumericVersion so a 0.0.1-SNAPSHOT framework satisfies a 0.0.1 minimum.
-
Constructor Summary
ConstructorsConstructorDescriptionCatalogCompatibilityGate(ClassLoader loader, String frameworkVersion, int supportedSchemaVersion, com.fasterxml.jackson.databind.ObjectMapper mapper) Creates a gate. -
Method Summary
Modifier and TypeMethodDescriptionstatic CatalogCompatibilityGatedefaults()The production gate: resolves catalog resources on the locator's classloader, against the runningFrameworkVersionand the supportedWorkflowSchemaVersion.SUPPORTED_WORKFLOW_SCHEMA_VERSION.voidenforce()Verifies catalog/framework compatibility, throwing when a present catalog is incompatible.
-
Constructor Details
-
CatalogCompatibilityGate
public CatalogCompatibilityGate(ClassLoader loader, String frameworkVersion, int supportedSchemaVersion, com.fasterxml.jackson.databind.ObjectMapper mapper) Creates a gate. Preferdefaults()for production wiring; this constructor lets tests supply a classloader over a controlled catalog layout and a fixed framework version.- Parameters:
loader- classloader over which catalog resources are resolvedframeworkVersion- the running framework versionsupportedSchemaVersion- the workflow schema version this framework supportsmapper- JSON mapper for the manifest
-
-
Method Details
-
defaults
The production gate: resolves catalog resources on the locator's classloader, against the runningFrameworkVersionand the supportedWorkflowSchemaVersion.SUPPORTED_WORKFLOW_SCHEMA_VERSION.- Returns:
- a gate wired for the running framework
-
enforce
public void enforce()Verifies catalog/framework compatibility, throwing when a present catalog is incompatible.- Throws:
CatalogCompatibilityException- when a catalog is present but its manifest is missing, unparseable, version-incompatible, or declares an unsupported workflow schema version
-