当前位置: 首页 > news >正文

视频网站切片怎么做如何做网站结构及栏目策划

视频网站切片怎么做,如何做网站结构及栏目策划,创建网站用突唯阿做响应式网站,企业注册号怎么查询这是Spring Integration Session 1的后续活动 第一部分是使用Spring Integration的简单Hello World应用程序。 我想通过考虑其他一些方案来进一步介绍它。 因此#xff0c;对Hello World应用程序的第一个更改是添加网关组件。 要快速重新访问较早的测试程序#xff0c;请执行… 这是Spring Integration Session 1的后续活动 第一部分是使用Spring Integration的简单Hello World应用程序。 我想通过考虑其他一些方案来进一步介绍它。 因此对Hello World应用程序的第一个更改是添加网关组件。 要快速重新访问较早的测试程序请执行以下操作 package org.bk.si.helloworld.hw1;import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.integration.Message; import org.springframework.integration.MessageChannel; import org.springframework.integration.message.GenericMessage; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;RunWith(SpringJUnit4ClassRunner.class) ContextConfiguration(helloworld.xml) public class HelloWorldTest {AutowiredQualifier(messageChannel)MessageChannel messageChannel;Testpublic void testHelloWorld() {MessageString helloWorld new GenericMessageString(Hello World);messageChannel.send(helloWorld);} } 在上面突出显示的行中测试依赖于特定于Spring Integration的组件-消息通道并且在测试中构造了显式的Spring Integration Message并将其发送到消息通道。 与Spring Integration这里的消息传递系统的耦合有点过多。 网关组件为消息传递系统提供了外观从而将用户应用程序在本例中为单元测试与消息传递系统的详细信息消息传递通道消息和消息的显式发送隔离开来。 首先通过一个示例来说明在使用网关组件的情况下测试的外观 package org.bk.si.helloworld.hw2;import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;RunWith(SpringJUnit4ClassRunner.class) ContextConfiguration(helloworld.xml) public class HelloWorldTest {Autowired Greeter greeter;Testpublic void testHelloWorld(){this.greeter.sendGreeting(Hello World);} } 上面的Greeter接口是网关组件。 既然已经引入了该组件那么在此测试中就不再依赖于Spring Integration了-在代码中根本没有提到MessageMessage Channel。 网关组件也是这样定义的非常简单的Java接口 package org.bk.si.helloworld.hw2;public interface Greeter {public void sendGreeting(String message); } 所以现在的问题是谁来负责创建消息传递并将消息发送到消息通道–是通过Spring Integration配置进行的 ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:inthttp://www.springframework.org/schema/integrationxmlns:int-streamhttp://www.springframework.org/schema/integration/streamxsi:schemaLocationhttp://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsdhttp://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream-2.1.xsdhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdint:channel idmessagesChannel/int:channelint:gateway service-interfaceorg.bk.si.helloworld.hw2.Greeter default-request-channelmessagesChannel/int:gatewayint-stream:stdout-channel-adapter channelmessagesChannel append-newlinetrue//beans 上面突出显示的行从Greeter界面创建了Gateway组件在后台创建了一个代理该代理处理了之前明确进行的所有操作-创建消息传递并将消息发送到消息通道。 现在为“ Hello World”示例增加更多的复杂性 考虑以下测试 package org.bk.si.helloworld.hw3;import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;RunWith(SpringJUnit4ClassRunner.class) ContextConfiguration(helloworld.xml) public class HelloWorldTest {Autowired Greeter greeter;Testpublic void testHelloWorld(){System.out.println(Started..);long start System.nanoTime();for (int i0;i10;i){this.greeter.sendMessage(String.format(Hello World %d,i));}System.out.println(Completed..);System.out.println(String.format(Took %f ms, (System.nanoTime()-start)/10e6));} } 这与先前的单元测试相同除了在这种情况下“ Hello World”消息被发送了10次。 支持的Spring Integration配置文件如下 ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:inthttp://www.springframework.org/schema/integrationxmlns:int-streamhttp://www.springframework.org/schema/integration/streamxsi:schemaLocationhttp://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsdhttp://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream-2.1.xsdhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdint:publish-subscribe-channel idmessagesChannel/int:gateway service-interfaceorg.bk.si.helloworld.hw3.Greeter default-request-channelmessagesChannel/int:gatewayint-stream:stderr-channel-adapter channelmessagesChannel append-newlinetrue/int-stream:stdout-channel-adapter channelmessagesChannel append-newlinetrue//beans 如果我现在运行此测试则输出如下 红色的行打印到syserr黑色的行打印到sysout。 因此问题在于为什么其中一些将进入sysout而另一些将进入syserr为什么不同时使用呢 答案是因为通道的类型-上面的“ messagesChannel”是Spring Integration术语中的“直接通道”并且具有“点对点”语义。 点对点语义基本上意味着当一条消息进入Messaging Channel时只有1个接收者接收到该消息–因此在这种情况下标准输出适配器或标准err适配器最终都会打印进入该消息的消息。消息通道。 因此要打印到两个适配器解决方法是简单地更改通道的语义–代替点对点通道将其设置为发布-订阅通道该通道是向多个接收者广播消息的通道。 使用Spring Integration进行更改非常简单 file:/C:/learn/scratch/target/test-classes/org/bk/htmlencode/content.txt ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:inthttp://www.springframework.org/schema/integrationxmlns:int-streamhttp://www.springframework.org/schema/integration/streamxsi:schemaLocationhttp://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsdhttp://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream-2.1.xsdhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdint:publish-subscribe-channel idmessagesChannel/int:gateway service-interfaceorg.bk.si.helloworld.hw3.Greeter default-request-channelmessagesChannel/int:gatewayint-stream:stderr-channel-adapter channelmessagesChannel append-newlinetrue/int-stream:stdout-channel-adapter channelmessagesChannel append-newlinetrue//beans 现在的输出将是同时打印到sysout和syserr的消息 这样就完成了对网关组件直接通道和发布订阅通道的介绍。 参考资料 Spring Integration –第2节–来自all和各式博客的JCG合作伙伴 Biju Kunjummen的更多Hello Worlds 。 翻译自: https://www.javacodegeeks.com/2012/07/spring-integration-session-2-more-hello.html
http://www.zqtcl.cn/news/595013/

相关文章:

  • 公司和网站备案查询龙江网站建设公司
  • 建一个平台网站需要多少钱安徽网站建设大全
  • 做网站接广告网站注册页面怎么做
  • 西安建站价格表电脑做视频的网站比较好
  • 建筑中级职称查询网站百度指数功能模块
  • 建设网站只慧聪网怎样做网站友情链接
  • 德阳网站开发dedecms5.7装饰公司网站模板
  • 下步我院将建设网站信息保密浙江温州网络公司
  • 一键建站网站seo关键词快速排名介绍
  • 自己做网站 什么wordpress博客文章加密
  • 怎样做音视频宣传网站wordpress 推送
  • 网站图片上传代码专业的企业进销存软件定制
  • 商品网站模板wordpress文章推荐
  • 十里堡网站建设做吃的教程网站
  • 比较好的源码网站河南网站seo推广
  • 做网站推广什么好网站界面结构
  • 龙岗网站优化常见的渠道推广方式有哪些
  • wordpress 后台乱码成都百度推广优化
  • 大连 响应式网站wordpress保存图片不显示
  • 二手车网站建站网站建设企业建站要求
  • 海山免费网站建设做视频网站如何赚钱
  • 网站增加点击率 怎样做小店面设计装修网
  • 一 美食 视频网站模板下载安装外国优秀网站欣赏
  • 网站服务器部署重庆涪陵网站建设公司
  • php网站开发实践要做网站照片怎么处理
  • 网站短期就业培训班搜集关键词的网站
  • 社区网站开发淘宝网站打算找人做
  • 政务类网站网页管理平台
  • 淘宝联盟微信里做网站花卉市场网站建设基本步骤
  • 做网站广告语网站注册建设