Class ConsulRegistry

  • All Implemented Interfaces:
    org.apache.camel.spi.BeanRepository, org.apache.camel.spi.Registry

    public class ConsulRegistry
    extends Object
    implements org.apache.camel.spi.Registry
    Apache Camel Plug-in for Consul Registry (Objects stored under kv/key as well as bookmarked under kv/[type]/key to avoid iteration over types)
    • Constructor Detail

      • ConsulRegistry

        public ConsulRegistry​(String hostname)
      • ConsulRegistry

        public ConsulRegistry​(String hostname,
                              int port)
    • Method Detail

      • lookupByName

        public Object lookupByName​(String key)
        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)
                  throws org.apache.camel.RuntimeCamelException
        Specified by:
        bind in interface org.apache.camel.spi.Registry
        Throws:
        org.apache.camel.RuntimeCamelException
      • bind

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

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

        public void remove​(String key)
      • getHostname

        public String getHostname()
      • setHostname

        public void setHostname​(String hostname)
      • getPort

        public int getPort()
      • setPort

        public void setPort​(int port)