public class SimpleRegistry extends HashMap<String,Object> implements Registry
Map
-based registry.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
SimpleRegistry() |
Modifier and Type | Method and Description |
---|---|
<T> Set<T> |
findByType(Class<T> type)
Finds services in the registry by their type.
|
<T> Map<String,T> |
findByTypeWithName(Class<T> type)
Finds services in the registry by their type.
|
Object |
lookup(String name)
Looks up a service in the registry based purely on name,
returning the service or null if it could not be found.
|
<T> T |
lookup(String name,
Class<T> type)
Looks up a service in the registry, returning the service or null if it could not be found.
|
Object |
lookupByName(String name)
Looks up a service in the registry based purely on name,
returning the service or null if it could not be found.
|
<T> T |
lookupByNameAndType(String name,
Class<T> type)
Looks up a service in the registry, returning the service or null if it could not be found.
|
<T> Map<String,T> |
lookupByType(Class<T> type)
Looks up services in the registry by their type.
|
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
equals, hashCode, toString
public SimpleRegistry()
public Object lookupByName(String name)
Registry
lookupByName
in interface Registry
name
- the name of the servicepublic <T> T lookupByNameAndType(String name, Class<T> type)
Registry
lookupByNameAndType
in interface Registry
name
- the name of the servicetype
- the type of the required servicepublic <T> Map<String,T> findByTypeWithName(Class<T> type)
Registry
findByTypeWithName
in interface Registry
type
- the type of the registered servicespublic <T> Set<T> findByType(Class<T> type)
Registry
findByType
in interface Registry
type
- the type of the registered servicespublic Object lookup(String name)
Registry
public <T> T lookup(String name, Class<T> type)
Registry
public <T> Map<String,T> lookupByType(Class<T> type)
Registry
JndiRegistry
.lookupByType
in interface Registry
type
- the type of the registered servicesApache Camel