Interface ValidatorRegistry
- All Superinterfaces:
AutoCloseable, Map<ValidatorKey, Validator>, Service, StaticService
Registry that stores and resolves
Validator instances for Camel's
data type validation mechanism.
The registry maintains two separate caches mirroring the design of TransformerRegistry:
- static cache — holds all validators registered at route startup; no eviction, no size limit. Contains
every validator bound to a
DataTypewhen theCamelContextstarts. - dynamic cache — holds validators created or registered at runtime (for example, from custom Java code or hot-deployed routes); backed by an LRU cache with a configurable size limit (default 1000 entries) to prevent unbounded growth.
resolveValidator(ValidatorKey), which searches both caches using the DataType
encoded in the ValidatorKey.- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoidcleanUp()Cleanup the cache (purging stale entries)intNumber of validators in the dynamic registryintMaximum number of entries to store in the dynamic registrybooleanWhether the givenValidatoris stored in the dynamic cachebooleanWhether the givenValidatoris stored in the static cachevoidpurge()Purges the cache (removes validators from the dynamic cache)@Nullable ValidatorLookup aValidatorin the registry which supports the validation for the data type represented by the key.intNumber of validators in the static registry.Methods inherited from interface Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Method Details
-
resolveValidator
-
staticSize
int staticSize()Number of validators in the static registry. -
dynamicSize
int dynamicSize()Number of validators in the dynamic registry -
getMaximumCacheSize
int getMaximumCacheSize()Maximum number of entries to store in the dynamic registry -
purge
void purge()Purges the cache (removes validators from the dynamic cache) -
isStatic
-
isDynamic
-
cleanUp
void cleanUp()Cleanup the cache (purging stale entries)
-