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 usingDefaultRegistry
instead 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 void
bind(String id, Class<?> type, Object bean)
void
bind(String id, Class<?> type, Supplier<Object> bean)
void
bindAsPrototype(String id, Class<?> type, Supplier<Object> bean)
void
close()
<T> Set<T>
findByType(Class<T> type)
<T> Map<String,T>
findByTypeWithName(Class<T> type)
Object
lookupByName(String name)
<T> T
lookupByNameAndType(String name, Class<T> type)
void
unbind(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:
lookupByName
in interfaceorg.apache.camel.spi.BeanRepository
-
lookupByNameAndType
public <T> T lookupByNameAndType(String name, Class<T> type)
- Specified by:
lookupByNameAndType
in interfaceorg.apache.camel.spi.BeanRepository
-
findByTypeWithName
public <T> Map<String,T> findByTypeWithName(Class<T> type)
- Specified by:
findByTypeWithName
in interfaceorg.apache.camel.spi.BeanRepository
-
findByType
public <T> Set<T> findByType(Class<T> type)
- Specified by:
findByType
in interfaceorg.apache.camel.spi.BeanRepository
-
bind
public void bind(String id, Class<?> type, Object bean)
- Specified by:
bind
in interfaceorg.apache.camel.spi.Registry
-
bind
public void bind(String id, Class<?> type, Supplier<Object> bean)
- Specified by:
bind
in interfaceorg.apache.camel.spi.Registry
-
bindAsPrototype
public void bindAsPrototype(String id, Class<?> type, Supplier<Object> bean)
- Specified by:
bindAsPrototype
in interfaceorg.apache.camel.spi.Registry
-
unbind
public void unbind(String id)
- Specified by:
unbind
in interfaceorg.apache.camel.spi.Registry
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-