org.apache.camel.impl
Class SimpleRegistry
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<String,Object>
org.apache.camel.impl.SimpleRegistry
- All Implemented Interfaces:
- Serializable, Cloneable, Map<String,Object>, Registry
public class SimpleRegistry
- extends HashMap<String,Object>
- implements Registry
A Map
-based registry.
- See Also:
- Serialized Form
Method Summary |
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. |
|
lookup(String name,
Class<T> type)
Looks up a service in the registry, returning the service or null if it could not be found. |
|
lookupByType(Class<T> type)
Looks up services in the registry by their type. |
Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
SimpleRegistry
public SimpleRegistry()
lookup
public Object lookup(String name)
- Description copied from interface:
Registry
- Looks up a service in the registry based purely on name,
returning the service or null if it could not be found.
- Specified by:
lookup
in interface Registry
- Parameters:
name
- the name of the service
- Returns:
- the service from the registry or null if it could not be found
lookup
public <T> T lookup(String name,
Class<T> type)
- Description copied from interface:
Registry
- Looks up a service in the registry, returning the service or null if it could not be found.
- Specified by:
lookup
in interface Registry
- Parameters:
name
- the name of the servicetype
- the type of the required service
- Returns:
- the service from the registry or null if it could not be found
lookupByType
public <T> Map<String,T> lookupByType(Class<T> type)
- Description copied from interface:
Registry
- Looks up services in the registry by their type.
Note: Not all registry implementations support this feature,
such as the
JndiRegistry
.
- Specified by:
lookupByType
in interface Registry
- Parameters:
type
- the type of the registered services
- Returns:
- the types found, with their id as the key. Returns an empty Map if none found.
Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.