Package org.apache.camel.support
Class SupplierRegistry
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- java.util.LinkedHashMap<String,Map<Class<?>,Object>>
-
- org.apache.camel.support.SimpleRegistry
-
- org.apache.camel.support.SupplierRegistry
-
- All Implemented Interfaces:
Closeable
,Serializable
,AutoCloseable
,Cloneable
,Map<String,Map<Class<?>,Object>>
,org.apache.camel.spi.BeanRepository
,org.apache.camel.spi.Registry
- Direct Known Subclasses:
LocalBeanRegistry
public class SupplierRegistry extends SimpleRegistry
Used for storing beans that are supplied via aSupplier
. Camel will cache the result from the supplier from first lookup (singleton scope). If you do not need cached then useSimpleRegistry.bindAsPrototype(String, Class, Supplier)
instead. To bind a bean as a supplier, then use theRegistry.bind(String, Class, Supplier)
method.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description SupplierRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(String id, Class<?> type, Supplier<Object> bean)
<T> Set<T>
findByType(Class<T> type)
<T> Map<String,T>
findByTypeWithName(Class<T> type)
<T> T
lookupByNameAndType(String name, Class<T> type)
-
Methods inherited from class org.apache.camel.support.SimpleRegistry
bind, bindAsPrototype, close, lookupByName, unbind
-
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
-
-
-
-
Method Detail
-
lookupByNameAndType
public <T> T lookupByNameAndType(String name, Class<T> type)
- Specified by:
lookupByNameAndType
in interfaceorg.apache.camel.spi.BeanRepository
- Overrides:
lookupByNameAndType
in classSimpleRegistry
-
findByType
public <T> Set<T> findByType(Class<T> type)
- Specified by:
findByType
in interfaceorg.apache.camel.spi.BeanRepository
- Overrides:
findByType
in classSimpleRegistry
-
findByTypeWithName
public <T> Map<String,T> findByTypeWithName(Class<T> type)
- Specified by:
findByTypeWithName
in interfaceorg.apache.camel.spi.BeanRepository
- Overrides:
findByTypeWithName
in classSimpleRegistry
-
-