Class ConsulRegistry
- java.lang.Object
-
- org.apache.camel.component.consul.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)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConsulRegistry.Builder
-
Constructor Summary
Constructors Constructor Description ConsulRegistry(String hostname)ConsulRegistry(String hostname, int port)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(String id, Class type, Object bean)<T> Set<T>findByType(Class<T> type)<T> Map<String,T>findByTypeWithName(Class<T> type)StringgetHostname()intgetPort()ObjectlookupByName(String key)<T> TlookupByNameAndType(String name, Class<T> type)voidput(String key, Object object)voidremove(String key)voidsetHostname(String hostname)voidsetPort(int port)
-
-
-
Method Detail
-
lookupByName
public Object lookupByName(String key)
- Specified by:
lookupByNamein interfaceorg.apache.camel.spi.BeanRepository
-
lookupByNameAndType
public <T> T lookupByNameAndType(String name, Class<T> type)
- Specified by:
lookupByNameAndTypein interfaceorg.apache.camel.spi.BeanRepository
-
findByTypeWithName
public <T> Map<String,T> findByTypeWithName(Class<T> type)
- Specified by:
findByTypeWithNamein interfaceorg.apache.camel.spi.BeanRepository
-
findByType
public <T> Set<T> findByType(Class<T> type)
- Specified by:
findByTypein interfaceorg.apache.camel.spi.BeanRepository
-
bind
public void bind(String id, Class type, Object bean) throws org.apache.camel.RuntimeCamelException
- Specified by:
bindin interfaceorg.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)
-
-