|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jabb.camel.RegistryUtility
public class RegistryUtility
This utility provides convenient methods to work on Camel Registry,
however CombinedRegistry is required in most of the cases.
提供方便地对Camel的Registry进行操作的方法,不过大部分的时候只有CombinedRegistry才被支持。
For example, it provides methods to add Codec(s) required by Netty to Registry.
比如说,它提供向Registry中添加Netty所需的Codec的方法。
But you should be aware that it does not ensure multi-threads safe on the manipulation of Registry.
但是注意,它不保证对Registry的操作是多线程安全的。
| Field Summary | |
|---|---|
static String |
NAME_DECODERS
|
static String |
NAME_ENCODERS
|
| Constructor Summary | |
|---|---|
RegistryUtility()
|
|
| Method Summary | |
|---|---|
protected static void |
addCodecOnly(CombinedRegistry registry,
String name,
org.jboss.netty.channel.ChannelHandler codec)
Adds codec to Registry only, it will not handle the manipulating of encoders or decoders list in Registry. 仅仅把codec直接加入到Registry中,而不处理加入到Registry里的encoders或decoders列表中。 |
static void |
addDecoder(org.apache.camel.CamelContext context,
String name,
org.jboss.netty.channel.ChannelUpstreamHandler decoder)
Adds an Netty decoder to Registry. 向Registry中增加一个给Netty用的decoder。 |
static void |
addEncoder(org.apache.camel.CamelContext context,
String name,
org.jboss.netty.channel.ChannelDownstreamHandler encoder)
Adds an Netty encoder to Registry. 向Registry中增加一个给Netty用的encoder。 |
static CombinedRegistry |
getCombinedRegistry(org.apache.camel.CamelContext camelContext)
Gets CombinedRegistry from CamelContext. 从CamelContext中得到CombinedRegistry类型的Registry。 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String NAME_ENCODERS
public static final String NAME_DECODERS
| Constructor Detail |
|---|
public RegistryUtility()
| Method Detail |
|---|
public static CombinedRegistry getCombinedRegistry(org.apache.camel.CamelContext camelContext)
camelContext - The CamelContext must be based on CombinedRegistry, otherwise ClassCastException will be thrown.
public static void addEncoder(org.apache.camel.CamelContext context,
String name,
org.jboss.netty.channel.ChannelDownstreamHandler encoder)
context - The CamelContext must be based on CombinedRegistry, otherwise ClassCastException will be thrown.name - Name of the encoder in Registry.encoder - The encoder that will be used by Netty.
public static void addDecoder(org.apache.camel.CamelContext context,
String name,
org.jboss.netty.channel.ChannelUpstreamHandler decoder)
context - The CamelContext must be based on CombinedRegistry, otherwise ClassCastException will be thrown.name - Name of the decoder in Registry.decoder - The decoder that will be used by Netty.
protected static void addCodecOnly(CombinedRegistry registry,
String name,
org.jboss.netty.channel.ChannelHandler codec)
If a codec with the same name already exists in the Registry, IllegalArgumentException will be thrown.
如果Registry中原先已经有同名的别的codec,则抛出IllegalArgumentException。
registry - The CombinedRegistry that the codec will be added into.name - Name of the codec in Registry.codec - The codec that will be used by Netty.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||