本文整理汇总了Java中org.apache.camel.impl.JndiRegistry类的典型用法代码示例。如果您正苦于以下问题:Java JndiRegistry类的具体用法?Java JndiRegistry怎么用?Java JndiRegistry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JndiRegistry类属于org.apache.camel.impl包,在下文中一共展示了JndiRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRegistry
import org.apache.camel.impl.JndiRegistry; //导入依赖的package包/类
@Override
protected JndiRegistry createRegistry() throws Exception {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource("server.jks");
ksp.setPassword("password");
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
SSLContextParameters sslContextParameters = new SSLContextParameters();
sslContextParameters.setSecureSocketProtocol("SSL");
sslContextParameters.setTrustManagers(tmp);
JndiRegistry registry = super.createRegistry();
registry.bind("sslContextParameters", sslContextParameters);
return registry;
}
开发者ID:HydAu,项目名称:Camel,代码行数:18,代码来源:FileToFtpsExplicitSSLWithoutClientAuthAndSSLContextParametersTest.java
示例2: createRegistry
import org.apache.camel.impl.JndiRegistry; //导入依赖的package包/类
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry reg = super.createRegistry();
db = new EmbeddedDatabaseBuilder()
.setType(EmbeddedDatabaseType.DERBY).build();
reg.bind("testdb", db);
DataSourceTransactionManager txMgr = new DataSourceTransactionManager();
txMgr.setDataSource(db);
reg.bind("txManager", txMgr);
SpringTransactionPolicy txPolicy = new SpringTransactionPolicy();
txPolicy.setTransactionManager(txMgr);
txPolicy.setPropagationBehaviorName("PROPAGATION_REQUIRED");
reg.bind("required", txPolicy);
return reg;
}
示例3: createRegistry
import org.apache.camel.impl.JndiRegistry; //导入依赖的package包/类
@Override
protected JndiRegistry createRegistry() throws Exception {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource("server.jks");
ksp.setPassword("password");
KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyPassword("password");
kmp.setKeyStore(ksp);
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
SSLContextParameters sslContextParameters = new SSLContextParameters();
sslContextParameters.setSecureSocketProtocol("SSL");
sslContextParameters.setKeyManagers(kmp);
sslContextParameters.setTrustManagers(tmp);
JndiRegistry registry = super.createRegistry();
registry.bind("sslContextParameters", sslContextParameters);
return registry;
}
开发者ID:HydAu,项目名称:Camel,代码行数:23,代码来源:FileToFtpsExplicitSSLWithClientAuthAndSSLContextParametersTest.java
示例4: createRegistry
import org.apache.camel.impl.JndiRegistry; //导入依赖的package包/类
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry jndi = super.createRegistry();
HL7MLLPNettyDecoderFactory decoder = new HL7MLLPNettyDecoderFactory();
decoder.setCharset("iso-8859-1");
// to test with different start and end bytes.
decoder.setStartByte('*');
decoder.setEndByte1('#');
decoder.setEndByte2('*');
decoder.setConvertLFtoCR(false);
jndi.bind("hl7decoder", decoder);
HL7MLLPNettyEncoderFactory encoder = new HL7MLLPNettyEncoderFactory();
encoder.setCharset("iso-8859-1");
// to test with different start and end bytes.
encoder.setStartByte('*');
encoder.setEndByte1('#');
encoder.setEndByte2('*');
encoder.setConvertLFtoCR(false);
jndi.bind("hl7encoder", encoder);
return jndi;
}
示例5: testFormatterNotPickedUpWithDifferentKey
import org.apache.camel.impl.JndiRegistry; //导入依赖的package包/类
@Test
public void testFormatterNotPickedUpWithDifferentKey() throws Exception {
context.stop();
exchangeFormatter = new TestExchangeFormatter();
JndiRegistry registry = getRegistryAsJndi();
registry.bind("anotherFormatter", exchangeFormatter);
context.start();
String endpointUri = "log:" + LogCustomFormatterTest.class.getCanonicalName();
template.requestBody(endpointUri, "Hello World");
template.requestBody(endpointUri, "Hello World");
template.requestBody(endpointUri + "2", "Hello World");
template.requestBody(endpointUri + "2", "Hello World");
assertEquals(0, exchangeFormatter.getCounter());
}
示例6: createRegistry
import org.apache.camel.impl.JndiRegistry; //导入依赖的package包/类
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry registry = super.createRegistry();
// setup the String encoder and decoder
StringDecoder stringDecoder = new StringDecoder();
registry.bind("string-decoder", stringDecoder);
StringEncoder stringEncoder = new StringEncoder();
registry.bind("string-encoder", stringEncoder);
List<ChannelHandler> decoders = new ArrayList<ChannelHandler>();
decoders.add(stringDecoder);
List<ChannelHandler> encoders = new ArrayList<ChannelHandler>();
encoders.add(stringEncoder);
registry.bind("encoders", encoders);
registry.bind("decoders", decoders);
return registry;
}
示例7: createRegistry
import org.apache.camel.impl.JndiRegistry; //导入依赖的package包/类
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry jndi = super.createRegistry();
NettyHttpSecurityConfiguration security = new NettyHttpSecurityConfiguration();
security.setRealm("karaf");
SecurityAuthenticator auth = new JAASSecurityAuthenticator();
auth.setName("karaf");
security.setSecurityAuthenticator(auth);
SecurityConstraintMapping matcher = new SecurityConstraintMapping();
matcher.addInclusion("/*");
matcher.addExclusion("/public/*");
security.setSecurityConstraint(matcher);
jndi.bind("mySecurityConfig", security);
return jndi;
}
示例8: createRegistry
import org.apache.camel.impl.JndiRegistry; //导入依赖的package包/类
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry jndi = super.createRegistry();
// create NettyServerBootstrapConfiguration instance where we can configure the bootstrap
// option we want to use in our Camel routes. This allows us to configure this once,
// and also explicit
bootstrapConfiguration = new NettyServerBootstrapConfiguration();
bootstrapConfiguration.setBacklog(200);
bootstrapConfiguration.setConnectTimeout(5000);
bootstrapConfiguration.setKeepAlive(true);
bootstrapConfiguration.setWorkerCount(4);
// register the configuration in the registry with this key
jndi.bind("myBootstrapOptions", bootstrapConfiguration);
return jndi;
}
示例9: createRouteBuilder
import org.apache.camel.impl.JndiRegistry; //导入依赖的package包/类
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
context().getRegistry(JndiRegistry.class).bind("rfc5426FrameDecoder", new Rfc5425FrameDecoder());
return new RouteBuilder() {
@Override
public void configure() throws Exception {
context.setTracing(true);
DataFormat syslogDataFormat = new SyslogDataFormat();
// we setup a Syslog listener on a random port.
from(uri).unmarshal(syslogDataFormat).process(new Processor() {
@Override
public void process(Exchange ex) {
assertTrue(ex.getIn().getBody() instanceof SyslogMessage);
}
}).to("mock:syslogReceiver").marshal(syslogDataFormat).to("mock:syslogReceiver2");
// Here we need to turn the request body into channelbuffer
from("direct:start").convertBodyTo(ChannelBuffer.class).to(uri);
}
};
}
示例10: createRegistry
import org.apache.camel.impl.JndiRegistry; //导入依赖的package包/类
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry jndi = super.createRegistry();
// START SNIPPET: e1
HL7MLLPNettyDecoderFactory decoder = new HL7MLLPNettyDecoderFactory();
decoder.setCharset("iso-8859-1");
decoder.setConvertLFtoCR(true);
jndi.bind("hl7decoder", decoder);
HL7MLLPNettyEncoderFactory encoder = new HL7MLLPNettyEncoderFactory();
decoder.setCharset("iso-8859-1");
decoder.setConvertLFtoCR(true);
jndi.bind("hl7encoder", encoder);
// END SNIPPET: e1
return jndi;
}
示例11: registerBean
import org.apache.camel.impl.JndiRegistry; //导入依赖的package包/类
public static void registerBean(Registry registry, String beanName, Object bean) {
if (registry instanceof SimpleRegistry) {
((SimpleRegistry) registry).put(beanName, bean);
} else if (registry instanceof PropertyPlaceholderDelegateRegistry) {
Registry wrappedRegistry = ((PropertyPlaceholderDelegateRegistry) registry).getRegistry();
registerBean(wrappedRegistry, beanName, bean);
} else if (registry instanceof JndiRegistry) {
((JndiRegistry) registry).bind(beanName, bean);
} else {
throw new RuntimeException("could not identify the registry type while registering core beans");
}
}
示例12: createRegistry
import org.apache.camel.impl.JndiRegistry; //导入依赖的package包/类
@Override
protected JndiRegistry createRegistry() throws Exception {
Map<String, Object> properties = new HashMap<>();
properties.put("beanName", "my-bean");
ComponentProxyComponent component = new ComponentProxyComponent("my-bean-proxy", "bean");
component.setOptions(properties);
JndiRegistry registry = super.createRegistry();
registry.bind("my-bean", new MyBean());
registry.bind(component.getComponentId() + "-component", component);
return registry;
}
示例13: createRegistry
import org.apache.camel.impl.JndiRegistry; //导入依赖的package包/类
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry registry = super.createRegistry();
registry.bind("my-bean", new ComponentProxyComponentTest.MyBean());
return registry;
}
示例14: main
import org.apache.camel.impl.JndiRegistry; //导入依赖的package包/类
/**
* Application entry point
* @param args application arguments
* @throws Exception
*/
public static void main(String... args) throws Exception {
JndiRegistry reg = new JndiRegistry(new JndiContext());
reg.bind("sslContextParameters",sslParameters());
CamelContext ctx = new DefaultCamelContext(reg);
ctx.addRoutes(new WebsocketRouteNoSSL());
ctx.setUseMDCLogging(true);
ctx.setTracing(true);
ctx.start();
}
示例15: main
import org.apache.camel.impl.JndiRegistry; //导入依赖的package包/类
/**
* Application entry point
* @param args application arguments
* @throws Exception
*/
public static void main(String... args) throws Exception {
JndiRegistry reg = new JndiRegistry(new JndiContext());
reg.bind("sslContextParameters",sslParameters());
CamelContext ctx = new DefaultCamelContext(reg);
ctx.addRoutes(new WebsocketRouteNoSSL());
ctx.setUseMDCLogging(true);
ctx.setTracing(true);
ctx.start();
}