BlazeDS server architecture

本文介绍了BlazeDS服务器架构,包括Flex客户端如何通过不同通道与服务器端点通信,MessageBroker如何路由消息到服务对象,以及适配器如何处理请求。还详细说明了配置文件的使用方法。

BlazeDS server architecture

The BlazeDS server is contained in a J2EE web application. A Flex client makes a request over a channel and the request is routed to an endpoint on the BlazeDS server. From the endpoint, the request is routed through a chain of Java objects that includes the MessageBroker object, a service object, a destination object, and finally an adapter object. The adapter fulfills the request either locally, or by contacting a backend system or a remote server such as Java Message Service (JMS) server.

The following illustration shows the BlazeDS server architecture:

Endpoints

BlazeDS servlet-based endpoints are inside the J2EE servlet container, which means that the servlet handles the I/O and HTTP sessions for the endpoints. Servlet-based endpoints are bootstrapped by the MessageBrokerServlet, which is configured in the web.xml file of the web application. In addition to the MessageBrokerServlet, an HTTP session listener is registered with the J2EE server in the web application's web.xml file so that BlazeDS has HTTP session attribute and binding listener support.

BlazeDSFlex client applications use channels to communicate with BlazeDS endpoints. There is a mapping between the channels on the client and the endpoints on the server. It is important that the channel and the endpoint use the same message format. A channel that uses the AMF message format, such as the AMFChannel, must be paired with an endpoint that also uses the AMF message format, such as the AMFEndpoint. A channel that uses the AMFX message format such as the HTTPChannel cannot be paired with an endpoint that uses the AMF message format. Also, a channel that uses streaming must be paired with an endpoint that uses streaming.

You configure endpoints in the services-config.xml file in the WEB-INF/flex directory of your BlazeDS web application. For more information about endpoints, see Channels and endpoints .

MessageBroker

The MessageBroker is responsible for routing messages to services and is at the core of BlazeDS on the server. After an endpoint initially processes the request, it extracts the message from the request and passes it to the MessageBroker. The MessageBroker inspects the message's destination and passes the message to its intended service. If the destination is protected by a security constraint, the MessageBroker runs the authentication and authorization checks before passing the message along (see Configuring security ). You configure the MessageBroker in the services-config.xml file in he WEB-INF/flex directory of your BlazeDS web application.

Services and destinations

Services and destinations are the next links in the message processing chain in the BlazeDS server. The system includes four services and their corresponding destinationsBlazeDS:

  • RemotingService and RemotingDestination
  • HTPProxyService and HTTPProxyDestination
  • MessageService and MessageDestination

Services are the targets of messages from client-side Flex components. Think of destinations as instances of a service configured in a certain way. For example, a RemoteObject component is used on the Flex client to communicate with the RemotingService. In the RemoteObject component, you must specify a destination id property that refers to a remoting destination with certain properties, such as the class you want to invoke methods on. The mapping between client-side Flex components and BlazeDS services is as follows:

  • HTTPService and WebService communicate with HTTPProxyService/HTTPProxyDestination
  • RemoteObject communicates with RemotingService/RemotingDestination
  • Producer and Consumer communicate with MessageService/MessageDestination

You can configure services and their destinations in the services-config.xml file, but it is best practice to put them in separate files as follows:

  • RemotingService configured in the remoting-config.xml file
  • HTTPProxyService configured in the proxy-config.xml file
  • MessageService configured in the messaging-config.xml file

For more information on RPC services (HTTPProxy Service and RemotingService) and MessageService, see the following topics:

Adapters and assemblers

Adapters, and optionally assemblers, are the last link in the message processing chain. When a message arrives at the correct destination, it is passed to an adapter that fulfills the request either locally or by contacting a backend system or a remote server such as a JMS server. BlazeDS uses the following mappings between destinations and adapters/assemblers:

  • RemotingDestination uses JavaAdapter
  • HTTPProxyDestination uses HTTPProxyAdapter or SOAPAdapter
  • MessageDestination uses ActionScriptAdapter or JMSAdapter

Adapters and assemblers are configured along with their corresponding destinations in the same configuration files.

Although the BlazeDS server comes with a rich set of adapters and assemblers to communicate with different systems, custom adapters and assemblers can be plugged into the BlazeDS server. Similarly, you do not have to create all destinations in configuration files, but instead you can create them dynamically at server startup or when the server is running; for more information, see Run-time configuration .

For information about the BlazeDS server-side classes, see the Javadoc API documentation.

本项目采用C++编程语言结合ROS框架构建了完整的双机械臂控制系统,实现了Gazebo仿真环境下的协同运动模拟,并完成了两台实体UR10工业机器人的联动控制。该毕业设计在答辩环节获得98分的优异成绩,所有程序代码均通过系统性调试验证,保证可直接部署运行。 系统架构包含三个核心模块:基于ROS通信架构的双臂协调控制器、Gazebo物理引擎下的动力学仿真环境、以及真实UR10机器人的硬件接口层。在仿真验证阶段,开发了双臂碰撞检测算法和轨迹规划模块,通过ROS控制包实现了末端执行器的同步轨迹跟踪。硬件集成方面,建立了基于TCP/IP协议的实时通信链路,解决了双机数据同步和运动指令分发等关键技术问题。 本资源适用于自动化、机械电子、人工智能等专业方向的课程实践,可作为高年级课程设计、毕业课题的重要参考案例。系统采用模块化设计理念,控制核心与硬件接口分离架构便于功能扩展,具备工程实践能力的学习者可在现有框架基础上进行二次开发,例如集成视觉感知模块或优化运动规划算法。 项目文档详细记录了环境配置流程、参数调试方法和实验验证数据,特别说明了双机协同作业时的时序同步解决方案。所有功能模块均提供完整的API接口说明,便于使用者快速理解系统架构并进行定制化修改。 资源来源于网络分享,仅用于学习交流使用,请勿用于商业,如有侵权请联系我删除!
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值