org.apache.camel.spi
Interface Registry

All Known Implementing Classes:
CompositeRegistry, JndiRegistry, PropertyPlaceholderDelegateRegistry, SimpleRegistry

public interface Registry

Represents a service registry which may be implemented via a Spring ApplicationContext, via JNDI, a simple Map or the OSGi Service Registry

Version:

Method Summary
<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)
          Deprecated. use lookupByName(String)
<T> T
lookup(String name, Class<T> type)
          Deprecated. use lookupByNameAndType(String, Class)
 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)
          Deprecated. use findByTypeWithName(Class)
 

Method Detail

lookupByName

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.

Parameters:
name - the name of the service
Returns:
the service from the registry or null if it could not be found

lookupByNameAndType

<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.

Parameters:
name - the name of the service
type - the type of the required service
Returns:
the service from the registry or null if it could not be found

findByTypeWithName

<T> Map<String,T> findByTypeWithName(Class<T> type)
Finds services in the registry by their type.

Parameters:
type - the type of the registered services
Returns:
the types found, with their ids as the key. Returns an empty Map if none found.

findByType

<T> Set<T> findByType(Class<T> type)
Finds services in the registry by their type.

Parameters:
type - the type of the registered services
Returns:
the types found. Returns an empty Set if none found.

lookup

@Deprecated
Object lookup(String name)
Deprecated. use lookupByName(String)

Looks up a service in the registry based purely on name, returning the service or null if it could not be found.

Parameters:
name - the name of the service
Returns:
the service from the registry or null if it could not be found

lookup

@Deprecated
<T> T lookup(String name,
                        Class<T> type)
Deprecated. use lookupByNameAndType(String, Class)

Looks up a service in the registry, returning the service or null if it could not be found. cha

Parameters:
name - the name of the service
type - the type of the required service
Returns:
the service from the registry or null if it could not be found

lookupByType

@Deprecated
<T> Map<String,T> lookupByType(Class<T> type)
Deprecated. use findByTypeWithName(Class)

Looks up services in the registry by their type.

Note: Not all registry implementations support this feature, such as the JndiRegistry.

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.


Apache Camel