• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JndiContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.camel.util.jndi.JndiContext的典型用法代码示例。如果您正苦于以下问题:Java JndiContext类的具体用法?Java JndiContext怎么用?Java JndiContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JndiContext类属于org.apache.camel.util.jndi包,在下文中一共展示了JndiContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setUp

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
public void setUp() throws Exception {
    JndiRegistry registry = new JndiRegistry(new JndiContext());
    RouteBuilder builder = createRouteBuilder();
    CamelContext context = new DefaultCamelContext(registry);

    testConverter = new TestConverter();
    testTransformerFactory = TransformerFactory.newInstance();

    registry.bind("testConverter", testConverter);
    registry.bind("testTransformerFactory", testTransformerFactory);

    ProcessorEndpoint pep1 = context.getEndpoint(TEST_URI_1, ProcessorEndpoint.class);

    context.addRoutes(builder);
    context.start();

    builder1 = (XsltBuilder)pep1.getProcessor();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:XsltReferenceParameterTest.java


示例2: testCamelWithJndi

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
public void testCamelWithJndi() throws Exception {
    JndiContext jndi = new JndiContext();
    jndi.bind("foo", new MyOtherDummyBean());

    CamelContext camel = new DefaultCamelContext(jndi);
    camel.addRoutes(new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            from("direct:start").bean("foo");
        }
    });
    camel.start();

    String reply = camel.createProducerTemplate().requestBody("direct:start", "Camel", String.class);
    assertEquals("Hello Camel", reply);

    camel.stop();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:BeanLookupUsingJndiRegistryIssueTest.java


示例3: configure

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
/** configures camel-drools integration and defines 3 routes:
 * 1) testing route (connection to drools with JSON command format)
 * 2) unmarshalling route (for unmarshalling command results)
 * 3) marshalling route (enables creating commands through API and converting to JSON) */
private CamelContext configure(KieSession session) throws Exception {
    Context context = new JndiContext();
    context.bind("ksession", session);

    CamelContext camelContext = new DefaultCamelContext(context);
    camelContext.addRoutes(new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            from("direct:test-session").policy(new KiePolicy()).unmarshal("json").to("kie://ksession").marshal("json");
            from("direct:unmarshall").policy(new KiePolicy()).unmarshal("json");
            from("direct:marshall").policy(new KiePolicy()).marshal("json");
        }

    });

    return camelContext;
}
 
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:22,代码来源:JsonQueryTest.java


示例4: configure

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
/** configures camel-drools integration and defines 3 routes:
 * 1) testing route (connection to drools with JAXB command format)
 * 2) unmarshalling route (for unmarshalling command results)
 * 3) marshalling route (enables creating commands through API and converting to XML) */
private CamelContext configure(StatefulKnowledgeSession session) throws Exception {
    Context context = new JndiContext();
    context.bind("ksession", session);

    CamelContext camelContext = new DefaultCamelContext(context);
    camelContext.addRoutes(new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            JaxbDataFormat jdf = new JaxbDataFormat();
            jdf.setContextPath("org.kie.camel.testdomain");
            jdf.setPrettyPrint(true);

            from("direct:test-session").policy(new KiePolicy()).unmarshal(jdf).to("kie://ksession").marshal(jdf);
            from("direct:unmarshall").policy(new KiePolicy()).unmarshal(jdf);
            from("direct:marshall").policy(new KiePolicy()).marshal(jdf);
        }
    });

    return camelContext;
}
 
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:25,代码来源:JaxbInsertTest.java


示例5: testPojoRoutes

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
@Test
public void testPojoRoutes() throws Exception {

    JndiContext jndctx = new JndiContext();
    jndctx.bind("bye", new SayService("Good Bye!"));

    CamelContext camelContext = new DefaultCamelContext(jndctx);
    camelContext.addRoutes(createRouteBuilder(camelContext));

    camelContext.start();
    try {
        Endpoint endpoint = camelContext.getEndpoint("direct:hello");
        ISay proxy = ProxyHelper.createProxy(endpoint, false, ISay.class);
        String rc = proxy.say();
        Assert.assertEquals("Good Bye!", rc);
    } finally {
        camelContext.stop();
    }
}
 
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:20,代码来源:RmiIntegrationTest.java


示例6: MockJndiContextFactoryRule

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
public MockJndiContextFactoryRule() {

        try {
            this.context = new JndiContext();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
 
开发者ID:drinkwater-io,项目名称:drinkwater-java,代码行数:9,代码来源:MockJndiContextFactoryRule.java


示例7: main

import org.apache.camel.util.jndi.JndiContext; //导入依赖的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();
}
 
开发者ID:IIlllII,项目名称:bitbreeds-webrtc,代码行数:17,代码来源:SimpleSignalingExample.java


示例8: main

import org.apache.camel.util.jndi.JndiContext; //导入依赖的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();
}
 
开发者ID:IIlllII,项目名称:bitbreeds-webrtc,代码行数:18,代码来源:SimpleSignalingExample.java


示例9: createJndiContext

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
@Override
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();
    answer.bind("myBean", new MyBean());
    answer.bind("myStrategy", new MyAggregationStrategy());
    return answer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:8,代码来源:BeanRecipientListTimeoutTest.java


示例10: createJndiContext

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
@Override
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();
    answer.bind("myBean", myBean);
    answer.bind("myOtherBean", myOtherBean);
    return answer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:8,代码来源:BeanOgnMethodWithXPathInjectionTest.java


示例11: createJndiContext

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();
    answer.bind("foo", new FooBean());
    answer.bind("bar", new BarBean());
    answer.bind("baz", new BazBean());
    return answer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:8,代码来源:BeanPipelineTest.java


示例12: createJndiContext

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();
    answer.bind("one", new MyBean("one"));
    answer.bind("two", new MyBean("two"));
    answer.bind("three", new MyBean("three"));
    return answer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:8,代码来源:BeanInPipelineTest.java


示例13: createJndiContext

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();
    answer.bind("b", new B());
    answer.bind("p", Proxy.newProxyInstance(I1.class.getClassLoader(), new Class[]{I1.class}, new InvocationHandler() {
        @Override
        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
            if (method.getName().equals("m1")) {
                return args[0].toString() + args[1].toString();
            } else {
                return null;
            }
        }
    }));
    return answer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:16,代码来源:BeanWithAnnotationInheritedTest.java


示例14: createJndiContext

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
@Override
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();

    // add ActiveMQ with embedded broker
    ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
    JmsComponent amq = jmsComponentAutoAcknowledge(connectionFactory);
    amq.setCamelContext(context);

    answer.bind("jms", amq);
    return answer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:13,代码来源:RemoveEndpointsTest.java


示例15: createJndiContext

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
@Override
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();

    // add ActiveMQ with embedded broker
    ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
    JmsComponent amq = jmsComponentAutoAcknowledge(connectionFactory);
    amq.setCamelContext(context);

    answer.bind("activemq", amq);
    return answer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:13,代码来源:NettyAsyncRequestReplyTest.java


示例16: createJndiContext

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
@Override
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();
    answer.bind("myBean", myBean);

    // add ActiveMQ with embedded broker
    ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
    JmsComponent amq = jmsComponentAutoAcknowledge(connectionFactory);
    amq.setCamelContext(context);

    answer.bind("jms", amq);
    return answer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:14,代码来源:JmsIntegrationTest.java


示例17: createJndiContext

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
@Override
protected Context createJndiContext() throws Exception {
    deleteDirectory("activemq-data");

    JndiContext answer = new JndiContext();

    // add ActiveMQ with embedded broker which must be persistent
    ConnectionFactory connectionFactory = CamelJmsTestHelper.createPersistentConnectionFactory();
    JmsComponent amq = jmsComponentAutoAcknowledge(connectionFactory);
    amq.setCamelContext(context);

    answer.bind("jms", amq);
    return answer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:15,代码来源:JmsPollEnrichTest.java


示例18: createJndiContext

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
@Override
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();

    // add ActiveMQ with embedded broker
    ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
    JmsComponent amq = jmsComponentAutoAcknowledge(connectionFactory);
    amq.setCamelContext(context);
    answer.bind("activemq", amq);

    answer.bind("myBean1", b1);
    answer.bind("myBean2", b2);
    answer.bind("myBean3", b3);
    return answer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:16,代码来源:JmsResequencerTest.java


示例19: createJndiContext

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
@Override
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();
    answer.bind("myBean", new MyBean());

    // add AMQ client and make use of connection pooling we depend on because of the (large) number
    // of the JMS messages we do produce
    // add ActiveMQ with embedded broker
    ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
    JmsComponent amq = jmsComponentAutoAcknowledge(connectionFactory);
    amq.setCamelContext(context);

    answer.bind("activemq", amq);
    return answer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:16,代码来源:JmsPerformanceTest.java


示例20: createJndiContext

import org.apache.camel.util.jndi.JndiContext; //导入依赖的package包/类
@Override
protected Context createJndiContext() throws Exception {
    JndiContext answer = new JndiContext();

    // add ActiveMQ with embedded broker
    ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
    JmsComponent amq = jmsComponentAutoAcknowledge(connectionFactory);
    amq.setCamelContext(context);
    answer.bind("jms", amq);
    answer.bind("myBean", new MyBean());
    return answer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:13,代码来源:DynamicRouteTest.java



注:本文中的org.apache.camel.util.jndi.JndiContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HTMLStripCharFilter类代码示例发布时间:2022-05-22
下一篇:
Java DeleteUpdateCommand类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap