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

Java ClassPathXmlApplicationContext类代码示例

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

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



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

示例1: main

import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; //导入依赖的package包/类
public static final void main(final String[] args) throws Exception {
    final ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");

    final JmsProvider jmsQueueProvider = new SpringJmsProvider(applicationContext, "jmsConnectionFactory",
            "notificationQueue");

    final TopologyBuilder topologyBuilder = new TopologyBuilder();

    final JmsBolt jmsBolt = new JmsBolt();
    jmsBolt.setJmsProvider(jmsQueueProvider);
    jmsBolt.setJmsMessageProducer((session, input) -> {
        final String json = "{\"word\":\"" + input.getString(0) + "\", \"count\":" + String.valueOf(input.getInteger(1)) + "}";
        return session.createTextMessage(json);
    });

    topologyBuilder.setSpout("wordGenerator", new RandomWordFeeder());
    topologyBuilder.setBolt("counter", new WordCounterBolt()).shuffleGrouping("wordGenerator");
    topologyBuilder.setBolt("jmsBolt", jmsBolt).shuffleGrouping("counter");

    final Config config = new Config();
    config.setDebug(false);

    final LocalCluster cluster = new LocalCluster();
    cluster.submitTopology("word-count", config, topologyBuilder.createTopology());
}
 
开发者ID:P7h,项目名称:storm-camel-example,代码行数:26,代码来源:Runner.java


示例2: setUp

import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; //导入依赖的package包/类
@SuppressWarnings("resource")
protected void setUp() throws Exception {
	super.setUp();
	ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
			new String[] { "Spring-config.xml" });
	sysUserService = context.getBean(SysUserService.class);
}
 
开发者ID:guokezheng,项目名称:automat,代码行数:8,代码来源:SysUserTest.java


示例3: createApplicationContext

import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; //导入依赖的package包/类
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("org/apache/camel/itest/issues/BeanCallDerivedClassTest-context.xml");
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:BeanCallDerivedClassTest.java


示例4: createApplicationContext

import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; //导入依赖的package包/类
@Override
protected AbstractApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("org/apache/camel/itest/jms/AdviceWithTransactionIssueTest.xml");
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:AdviceWithTransactionIssueTest.java


示例5: createApplicationContext

import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; //导入依赖的package包/类
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("org/apache/camel/component/jms/tx/XMLQueueToProcessorTransactionTest.xml");
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:XMLQueueToProcessorTransactionTest.java


示例6: createApplicationContext

import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; //导入依赖的package包/类
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("org/apache/camel/component/jms/tx/XMLQueueToQueueTransactionTest.xml");
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:XMLQueueToQueueTransactionTest.java


示例7: createApplicationContext

import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; //导入依赖的package包/类
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("org/apache/camel/component/jms/tx/JavaDSLTransactionTest.xml");
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:AbstractTransactionTest.java


示例8: createApplicationContext

import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; //导入依赖的package包/类
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("org/apache/camel/component/jms/tx/ActiveMQWithoutTransactionManager.xml");
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:QueueToQueueTransactionWithoutDefineTransactionManagerTest.java


示例9: createApplicationContext

import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; //导入依赖的package包/类
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext(new String[]{"classpath:org/apache/camel/component/jms/issues/broker.xml",
        "classpath:org/apache/camel/component/jms/issues/camelBrokerClient.xml"});
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:JmsSendToAlotOfDestinationWithSameEndpointTest.java


示例10: createApplicationContext

import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; //导入依赖的package包/类
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("org/apache/camel/component/jms/tuning/PerformanceRoutePojoTest-context.xml");
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:PerformanceRoutePojoTest.java


示例11: createApplicationContext

import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; //导入依赖的package包/类
protected AbstractXmlApplicationContext createApplicationContext() {
    return new ClassPathXmlApplicationContext("classpath:org/apache/camel/component/jms/activemq/twoActiveMQBrokers.xml");
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:TwoEmbeddedActiveMQBrokersTest.java


示例12: createApplicationContext

import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; //导入依赖的package包/类
@Override
protected AbstractApplicationContext createApplicationContext() {
   return new ClassPathXmlApplicationContext("org/apache/activemq/network/jms/queue-xbean.xml");
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:5,代码来源:QueueBridgeXBeanTest.java


示例13: createApplicationContext

import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; //导入依赖的package包/类
@Override
protected AbstractApplicationContext createApplicationContext() {
   return new ClassPathXmlApplicationContext("org/apache/activemq/network/jms/topic-config.xml");
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:5,代码来源:TopicBridgeXBeanTest.java


示例14: main

import org.apache.xbean.spring.context.ClassPathXmlApplicationContext; //导入依赖的package包/类
public static final void main(final String[] args) throws Exception {
	final ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");

	final JmsProvider jmsProvider = new SpringJmsProvider(applicationContext, "jmsConnectionFactory",
			                                                          "notificationQueue");

	final TopologyBuilder topologyBuilder = new TopologyBuilder();

	final JmsBolt jmsBolt = new JmsBolt();
	jmsBolt.setJmsProvider(jmsProvider);
	jmsBolt.setJmsMessageProducer((session, input) -> {
           final String json = "{\"stateCode\":\"" + input.getString(0) + "\", \"sentiment\":" + input.getInteger(1) + "}";
           return session.createTextMessage(json);
       });

	try {
		final Config config = new Config();
		config.setMessageTimeoutSecs(120);
		config.setDebug(true);

		topologyBuilder.setSpout("twitterspout", new TwitterSpout());
		topologyBuilder.setBolt("statelocatorbolt", new StateLocatorBolt())
				.shuffleGrouping("twitterspout");
		topologyBuilder.setBolt("sentimentcalculatorbolt", new SentimentCalculatorBolt())
				.fieldsGrouping("statelocatorbolt", new Fields("state"));
		topologyBuilder.setBolt("jmsBolt", jmsBolt).fieldsGrouping("sentimentcalculatorbolt", new Fields("stateCode"));

		//Submit it to the cluster, or submit it locally
		if (null != args && 0 < args.length) {
			config.setNumWorkers(3);
			StormSubmitter.submitTopology(args[0], config, topologyBuilder.createTopology());
		} else {
			config.setMaxTaskParallelism(10);
			final LocalCluster localCluster = new LocalCluster();
			localCluster.submitTopology(Constants.TOPOLOGY_NAME, config, topologyBuilder.createTopology());
			//Run this topology for 600 seconds so that we can complete processing of decent # of tweets.
			Utils.sleep(600 * 1000);

			LOGGER.info("Shutting down the cluster...");
			localCluster.killTopology(Constants.TOPOLOGY_NAME);
			localCluster.shutdown();

			Runtime.getRuntime().addShutdownHook(new Thread()	{
				@Override
				public void run()	{
					LOGGER.info("Shutting down the cluster...");
					localCluster.killTopology(Constants.TOPOLOGY_NAME);
					localCluster.shutdown();
				}
			});
		}
	} catch (final Exception exception) {
		//Deliberate no op;
		exception.printStackTrace();
	}
	LOGGER.info("\n\n\n\t\t*****Please clean your temp folder \"{}\" now!!!*****", System.getProperty("java.io.tmpdir"));
}
 
开发者ID:P7h,项目名称:StormTweetsSentimentD3UKViz,代码行数:58,代码来源:SentimentAnalysisTopology.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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