Package org.apache.camel.spi
Interface TransformerRegistry<K>
- Type Parameters:
K- transformer key
- All Superinterfaces:
AutoCloseable,Map<K,,Transformer> Service,StaticService
Registry to cache transformers in memory.
The registry contains two caches:
- static - which keeps all the transformers in the cache for the entire lifecycle
- dynamic - which keeps the transformers in a
and may evict transformers which hasn't been requested recently
invalid reference
org.apache.camel.support.LRUCache
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoidcleanUp()Cleanup the cache (purging stale entries)intNumber of transformers in the dynamic registryintMaximum number of entries to store in the dynamic registrybooleanWhether the given transformer is stored in the dynamic cachebooleanWhether the givenTransformeris stored in the dynamic cachebooleanWhether the given transformer is stored in the static cachebooleanWhether the given transformer is stored in the static cachevoidpurge()Purges the cache (removes transformers from the dynamic cache)resolveTransformer(K key) Lookup aTransformerin the registry which supports the transformation for the data types represented by the key.intNumber of transformers 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
-
resolveTransformer
Lookup aTransformerin the registry which supports the transformation for the data types represented by the key.- Parameters:
key- a key represents the from/to data types to transform- Returns:
Transformerif matched, otherwise null
-
staticSize
int staticSize()Number of transformers in the static registry. -
dynamicSize
int dynamicSize()Number of transformers in the dynamic registry -
getMaximumCacheSize
int getMaximumCacheSize()Maximum number of entries to store in the dynamic registry -
purge
void purge()Purges the cache (removes transformers from the dynamic cache) -
isStatic
Whether the given transformer is stored in the static cache- Parameters:
scheme- the scheme supported by this transformer- Returns:
- true if in static cache, false if not
-
isStatic
Whether the given transformer is stored in the static cache- Parameters:
from- 'from' data typeto- 'to' data type- Returns:
- true if in static cache, false if not
-
isDynamic
Whether the given transformer is stored in the dynamic cache- Parameters:
scheme- the scheme supported by this transformer- Returns:
- true if in dynamic cache, false if not
-
isDynamic
Whether the givenTransformeris stored in the dynamic cache- Parameters:
from- 'from' data typeto- 'to' data type- Returns:
- true if in dynamic cache, false if not
-
cleanUp
void cleanUp()Cleanup the cache (purging stale entries)
-