Package org.apache.camel.support
Class SimpleRegistry
- 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
-
- 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:
SupplierRegistry
public class SimpleRegistry extends LinkedHashMap<String,Map<Class<?>,Object>> implements org.apache.camel.spi.Registry, Closeable
AMap-based registry. Favour usingDefaultRegistryinstead of this.- See Also:
DefaultRegistry, 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 SimpleRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(String id, Class<?> type, Object bean)voidbind(String id, Class<?> type, Supplier<Object> bean)voidbindAsPrototype(String id, Class<?> type, Supplier<Object> bean)voidclose()<T> Set<T>findByType(Class<T> type)<T> Map<String,T>findByTypeWithName(Class<T> type)ObjectlookupByName(String name)<T> TlookupByNameAndType(String name, Class<T> type)voidunbind(String id)-
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
-
lookupByName
public Object lookupByName(String name)
- Specified by:
lookupByNamein interfaceorg.apache.camel.spi.BeanRepository
-
lookupByNameAndType
public <T> T lookupByNameAndType(String name, Class<T> type)
- Specified by:
lookupByNameAndTypein interfaceorg.apache.camel.spi.BeanRepository
-
findByTypeWithName
public <T> Map<String,T> findByTypeWithName(Class<T> type)
- Specified by:
findByTypeWithNamein interfaceorg.apache.camel.spi.BeanRepository
-
findByType
public <T> Set<T> findByType(Class<T> type)
- Specified by:
findByTypein interfaceorg.apache.camel.spi.BeanRepository
-
bind
public void bind(String id, Class<?> type, Object bean)
- Specified by:
bindin interfaceorg.apache.camel.spi.Registry
-
bind
public void bind(String id, Class<?> type, Supplier<Object> bean)
- Specified by:
bindin interfaceorg.apache.camel.spi.Registry
-
bindAsPrototype
public void bindAsPrototype(String id, Class<?> type, Supplier<Object> bean)
- Specified by:
bindAsPrototypein interfaceorg.apache.camel.spi.Registry
-
unbind
public void unbind(String id)
- Specified by:
unbindin interfaceorg.apache.camel.spi.Registry
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-