public class CombinedRegistry extends Object implements org.apache.camel.spi.Registry
When looking up something in it, it will try those encapsulated Registry(s) one by one. And it has an internal SimpleRegistry, as the last one to try. You can also write code to add entries to the internal SimpleRegistry.
当查找东西的时候,它会逐个尝试这些个Registry。而且,它内置一个SimpleRegistry, 作为最后一个尝试的Registry。你还可以通过内置的SimpleRegistry来利用 程序添加自己额外的内容。
Modifier and Type | Field and Description |
---|---|
protected org.apache.camel.impl.SimpleRegistry |
defaultSimpleRegistry |
protected List<org.apache.camel.spi.Registry> |
registryList |
Constructor and Description |
---|
CombinedRegistry()
Constructs an instance that contains only an internal SimpleRegistry.
创建一个实例,它仅含有内置的SimpleRegistry。 |
CombinedRegistry(org.apache.camel.spi.Registry... registries)
Constructs an instance that contains not only an internal SimpleRegistry,
but also several Registry(s) specified.
创建一个除了内置的SimpleRegistry之外,还包含指定的一些Registry的实例。 |
CombinedRegistry(org.apache.camel.spi.Registry registry)
Constructs an instance that contains not only an internal SimpleRegistry,
but also the Registry specified.
创建一个除了内置的SimpleRegistry之外,还包含指定Registry的实例。 |
Modifier and Type | Method and Description |
---|---|
void |
addRegistry(org.apache.camel.spi.Registry... registries)
Adds several Registry(s) which will be put after all others but just before the internal SimpleRegistry.
添加一些Registry,它们的位置会位于其他Registry之后,但是在缺省的SimpleRegistry之前。 |
void |
addRegistry(org.apache.camel.spi.Registry registry)
Adds a Registry which will be put after all others but just before the internal SimpleRegistry.
添加一个Registry,它的位置会位于其他Registry之后,但是在缺省的SimpleRegistry之前。 |
org.apache.camel.impl.SimpleRegistry |
getDefaultSimpleRegistry()
Gets the internal SimpleRegistry which can be manipulated later.
获得其内置的缺省SimpleRegistry,其后可以向它进行增删改查操作。 |
Object |
lookup(String name)
Looks up from all encapsulated Registry(s) one by one, and returns the first result found.
按次序从所封装的Registry中查找,返回第一个找到的结果。 |
<T> T |
lookup(String name,
Class<T> type)
Looks up from all encapsulated Registry(s) one by one, and returns the first result found.
按次序从所封装的Registry中查找,返回第一个找到的结果。 |
<T> Map<String,T> |
lookupByType(Class<T> type)
Looks up from all encapsulated Registry(s) one by one, and returns all the result found.
按次序从所封装的Registry中查找,并返回所有能找到的结果。 |
protected org.apache.camel.impl.SimpleRegistry defaultSimpleRegistry
protected List<org.apache.camel.spi.Registry> registryList
public CombinedRegistry()
public CombinedRegistry(org.apache.camel.spi.Registry registry)
registry
- The Registry that will be encapsulated.public CombinedRegistry(org.apache.camel.spi.Registry... registries)
registries
- The Registry(s) that will be encapsulated.public void addRegistry(org.apache.camel.spi.Registry registry)
public void addRegistry(org.apache.camel.spi.Registry... registries)
public Object lookup(String name)
If no result can be found, null will be returned.
如果全都找不到,则返回null。
lookup
in interface org.apache.camel.spi.Registry
Registry.lookup(java.lang.String)
public <T> T lookup(String name, Class<T> type)
If no result can be found, null will be returned.
如果全都找不到,则返回null。
lookup
in interface org.apache.camel.spi.Registry
Registry.lookup(java.lang.String, java.lang.Class)
public <T> Map<String,T> lookupByType(Class<T> type)
If no result can be found, an empty Map will be returned.
如果全都找不到,则返回一个空的Map。
lookupByType
in interface org.apache.camel.spi.Registry
Registry.lookupByType(java.lang.Class)
public org.apache.camel.impl.SimpleRegistry getDefaultSimpleRegistry()
Copyright © 2014. All Rights Reserved.