Package org.apache.camel.spi
Interface ValidatorRegistry
- All Superinterfaces:
AutoCloseable
,Map<ValidatorKey,
,Validator> Service
,StaticService
Registry to cache validators in memory.
The registry contains two caches:
- static - which keeps all the validators in the cache for the entire lifecycle
- dynamic - which keeps the validators in a
invalid reference
org.apache.camel.support.LRUCache
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanUp()
Cleanup the cache (purging stale entries)int
Number of validators in the dynamic registryint
Maximum number of entries to store in the dynamic registryboolean
Whether the givenValidator
is stored in the dynamic cacheboolean
Whether the givenValidator
is stored in the static cachevoid
purge()
Purges the cache (removes validators from the dynamic cache)Lookup aValidator
in the registry which supports the validation for the data type represented by the key.int
Number of validators in the static registry.Methods inherited from interface java.util.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
Lookup aValidator
in the registry which supports the validation for the data type represented by the key.- Parameters:
key
- a key represents the data type- Returns:
Validator
if matched, otherwise null
-
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
Whether the givenValidator
is stored in the static cache- Parameters:
type
- the data type- Returns:
- true if in static cache, false if not
-
isDynamic
Whether the givenValidator
is stored in the dynamic cache- Parameters:
type
- the data type- Returns:
- true if in dynamic cache, false if not
-
cleanUp
void cleanUp()Cleanup the cache (purging stale entries)
-