Class 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
A Map-based registry.

Favour using DefaultRegistry instead of this.

See Also:
  • Constructor Details

    • SimpleRegistry

      public SimpleRegistry()
  • Method Details

    • lookupByName

      public Object lookupByName(String name)
      Specified by:
      lookupByName in interface org.apache.camel.spi.BeanRepository
    • lookupByNameAndType

      public <T> T lookupByNameAndType(String name, Class<T> type)
      Specified by:
      lookupByNameAndType in interface org.apache.camel.spi.BeanRepository
    • findByTypeWithName

      public <T> Map<String,T> findByTypeWithName(Class<T> type)
      Specified by:
      findByTypeWithName in interface org.apache.camel.spi.BeanRepository
    • findByType

      public <T> Set<T> findByType(Class<T> type)
      Specified by:
      findByType in interface org.apache.camel.spi.BeanRepository
    • bind

      public void bind(String id, Class<?> type, Object bean)
      Specified by:
      bind in interface org.apache.camel.spi.Registry
    • bind

      public void bind(String id, Class<?> type, Supplier<Object> bean)
      Specified by:
      bind in interface org.apache.camel.spi.Registry
    • bindAsPrototype

      public void bindAsPrototype(String id, Class<?> type, Supplier<Object> bean)
      Specified by:
      bindAsPrototype in interface org.apache.camel.spi.Registry
    • unbind

      public void unbind(String id)
      Specified by:
      unbind in interface org.apache.camel.spi.Registry
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException