Class DIRegistry
java.lang.Object
java.util.AbstractMap<String,Map<Class<?>,Object>>
java.util.HashMap<String,Map<Class<?>,Object>>
java.util.LinkedHashMap<String,Map<Class<?>,Object>>
org.apache.camel.support.SimpleRegistry
org.apache.camel.support.SupplierRegistry
org.apache.camel.tooling.maven.support.DIRegistry
- All Implemented Interfaces:
Closeable,Serializable,AutoCloseable,Cloneable,Map<String,,Map<Class<?>, Object>> org.apache.camel.spi.BeanRepository,org.apache.camel.spi.Registry
public class DIRegistry
extends org.apache.camel.support.SupplierRegistry
SupplierRegistry extension that allows registration of bean recipes based on jakarta.inject
annotations.
Such requirement was found when trying to configure maven-resolver without using the deprecated service locator helpers (see MRESOLVER-157).
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidMake analiaspoint to the same target bean as existingkey.voidRegistration of a bean with the same lookup and target class.voidMain "registration" method, wherebeanClassis expected to be a pojo class with non-default constructor annotated withInject.voidvoidvoidbindAsPrototype(String id, Class<?> type, Supplier<Object> bean) <T> TlookupByClass(Class<T> cls) Methods inherited from class org.apache.camel.support.SupplierRegistry
findByType, findByTypeWithName, lookupByNameAndTypeMethods inherited from class org.apache.camel.support.SimpleRegistry
bind, bind, close, lookupByName, unbindMethods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, valuesMethods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class java.util.AbstractMap
equals, hashCode, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.spi.BeanRepository
findSingleByType, mandatoryFindSingleByType, unwrapMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from interface org.apache.camel.spi.Registry
bind, bind, wrap
-
Constructor Details
-
DIRegistry
public DIRegistry()
-
-
Method Details
-
bind
Registration of a bean with the same lookup and target class.- Parameters:
type-
-
bind
Main "registration" method, wherebeanClassis expected to be a pojo class with non-default constructor annotated withInject. The class may be annotated withNamed. (Maybe supportingSingletonsoon).- Parameters:
key- the lookup typetype- the actual type (to use when instantiating a bean)
-
alias
Make analiaspoint to the same target bean as existingkey.- Parameters:
alias-key-
-
bind
- Specified by:
bindin interfaceorg.apache.camel.spi.Registry- Overrides:
bindin classorg.apache.camel.support.SimpleRegistry
-
bind
- Specified by:
bindin interfaceorg.apache.camel.spi.Registry- Overrides:
bindin classorg.apache.camel.support.SupplierRegistry
-
bindAsPrototype
- Specified by:
bindAsPrototypein interfaceorg.apache.camel.spi.Registry- Overrides:
bindAsPrototypein classorg.apache.camel.support.SimpleRegistry
-
lookupByClass
-