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
org.apache.camel.support.LRUCache
and may evict transformers which hasn't been requested recently
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanUp()
Cleanup the cache (purging stale entries)int
Number of transformers in the dynamic registryint
Maximum number of entries to store in the dynamic registryboolean
Whether the given transformer is stored in the dynamic cacheboolean
Whether the givenTransformer
is stored in the dynamic cacheboolean
Whether the given transformer is stored in the static cacheboolean
Whether the given transformer is stored in the static cachevoid
purge()
Purges the cache (removes transformers from the dynamic cache)resolveTransformer
(K key) Lookup aTransformer
in the registry which supports the transformation for the data types represented by the key.int
Number 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 aTransformer
in 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:
Transformer
if 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 givenTransformer
is 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)
-