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 class
ConsulRegistry.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 void
bind(String id, Class<?> type, Supplier<Object> bean)
void
bind(String id, Class type, Object bean)
void
bindAsPrototype(String id, Class<?> type, Supplier<Object> bean)
<T> Set<T>
findByType(Class<T> type)
<T> Map<String,T>
findByTypeWithName(Class<T> type)
String
getHostname()
int
getPort()
Object
lookupByName(String key)
<T> T
lookupByNameAndType(String name, Class<T> type)
void
put(String key, Object object)
void
remove(String key)
void
setHostname(String hostname)
void
setPort(int port)
-
-
-
Method Detail
-
lookupByName
public Object lookupByName(String key)
- Specified by:
lookupByName
in interfaceorg.apache.camel.spi.BeanRepository
-
lookupByNameAndType
public <T> T lookupByNameAndType(String name, Class<T> type)
- Specified by:
lookupByNameAndType
in interfaceorg.apache.camel.spi.BeanRepository
-
findByTypeWithName
public <T> Map<String,T> findByTypeWithName(Class<T> type)
- Specified by:
findByTypeWithName
in interfaceorg.apache.camel.spi.BeanRepository
-
findByType
public <T> Set<T> findByType(Class<T> type)
- Specified by:
findByType
in interfaceorg.apache.camel.spi.BeanRepository
-
bind
public void bind(String id, Class type, Object bean) throws org.apache.camel.RuntimeCamelException
- Specified by:
bind
in interfaceorg.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 interfaceorg.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 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)
-
-