- 浏览: 103224 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
u013246812:
谢谢博主帮我解决了问题,就是那个process.exitVal ...
Java执行Shell脚本超时控制 -
fireinjava:
fireinjava 写道配置好多哦 =.=
刚看了下,原来是 ...
Java Spring2.5 Remote Invoke HTTP Invoker -
fireinjava:
配置好多哦 =.=
Java Spring2.5 Remote Invoke HTTP Invoker -
lee79:
呵呵,讲的很对
Java执行Shell脚本超时控制 -
fangwei:
非常感谢!!!btw 你虽然用到了slf4j,却没有用到它的强 ...
Java执行Shell脚本超时控制
New Protocol Offers Simple, Efficient Java RMI
Burlap/Hessian is an alternative remote object invocation and Web services protocol that's available as an open source Java framework. Learn how it enables simpler, more efficient Java RMI. by Edmon Begoli
|
he Burlap/Hessian protocol is an alternative remote object invocation and Web services protocol supplied as an open source Java framework through Caucho Technology. If you want POJO (Plain Old Java Objects)-based object distribution, efficient serialization, distributed Java objects that hardly need a Web container, maximal ease of use, and a minimal learning curve, then you should give Burlap/Hessian a serious look. Although primarily a Java remote object invocation protocol, it offers stable implementations for C++, C#, Python, and PHP as well.
I first ran across Burlap/Hessian while working with the Spring framework. Its exceptional simplicity and efficiency inspired me to write this article. I begin with an explanation of how the protocol works, follow that with a demonstration for establishing a Hessian-based distributed architecture, and close with some practical suggestions for how to use the protocol. Burlap/Hessian Architecture Burlap/Hessian remote objects are just ordinary Java objects that implement some interfaces. They don't require special proxy, home, or remote classes. One of the inherent benefits of this object-and-interface model is that it promotes the good object-oriented design practice of design by interface. Design by interface mandates that client objects depend on abstractions and never on concrete classes. Furthermore, the Burlap/Hessian protocol fully leverages the host environment's Web container capabilities. Hessian server is nothing more than a servlet that can dispatch Burlap or Hessian serialized objects via the Web. Hessian remote objects are configured in a web.xml file (as examples will demonstrate shortly). As previously mentioned, Burlap/Hessian serializes Java objects using a proprietary serialization mechanism. The serialization process is completely transparent to the application (i.e., you do not need to implement any special interfaces to make objects serializable). Burlap/Hessian serialization is very efficient, and the produced serialized object snapshots (either XML or binary) are very compact.
|
Application Development in a Hessian-Based Distributed Architecture This section demonstrates the typical steps involved in establishing a Hessian-based distributed architecture. The sample scenario involves two applications: one for inventory management and the other for order management. The inventory management app is a standalone J2EE application that enables its users to track and manage their parts inventory over the Web. This example takes a plain Java object ( InventoryTracker ) and exposes it to the ordering management application that needs inventory lookup services.
Step 1. Enable server components for the remote invocation [Hint: If you want to expose the server objects but you cannot make any changes to them, you can apply the Adapter design pattern. Expose the Adapter object that implements the needed interface and then have it delegate the remote method invocations to the actual business component.] As previously stated, this example exposes the plain Java object
The following is the
Step 2. Configure the server component for the remote invocation (over the Web) Using the standard Servlet parameter settings in the web.xml file, specify the service implementation object (parameter:
The Burlap/Hessian protocol fully leverages the Web container capabilities of the host environment. As you can see, the Hessian server is nothing more than a servlet that can dispatch either Burlap or Hessian serialized objects via the Web. As the service provider, you can choose whether to have a special-purpose Web application for the remote services or to have an already functional Web application expose the remote objects. Step 3. Invocation on the client
It is actually a very simple interaction. The client code needs to know the URL of the Hessian servlet. It will use this URL along with the interface class to obtain the interface implementation from the As you probably noticed, the only actual coupling point between the clients' application code and the Burlap- or Hessian-specific classes is through the The most attractive aspect of the Burlap or Hessian client-to-server interaction is that it is accomplished in a true Web services fashion. The client effectively locates the remote object (as a URL) over HTTP (or HTTPS), and from that point it interacts with the object in a true POJO fashion.
|
Suggested Practical Uses for Burlap/Hessian The following are practical implementations for Burlap/Hessian that can benefit your development today:
If you develop enterprise applications using the Spring framework, Burlap and Hessian are already available to you through the framework in a completely transparent fashion. Spring does not require your application to use a particular remoting protocol, since the framework transparently injects the remote dependencies. In this scenario, I recommend using the Burlap/Hessian protocol to take full advantage of Hessian's performance, simple Web application deployment model, and ease of use. With Spring, switching from the Burlap or the Hessian protocol to a more conservative JSR-endorsed protocol such as RMI is a matter of changing configuration.
Some developers may take issue with using a Java distributed computing framework that is not endorsed by the official Java specification. However, if you have to perform distributed computing between just a few applications, Hessian may be the practical way to go. You would save a significant amount of money that you would otherwise spend on EJB training, development, administration, and maintenance. Moreover, Hessian's lightweight architecture and mild—almost non-existent—coupling with the application code will keep your applications from becoming strategically dependent on this proprietary framework.
The authors of the Burlap/Hessian protocol have proposed using it for small devices such as cell phones. This is a rather interesting proposal, and I think it warrants serious consideration. Its small deployment footprint (it can be deployed with only a few core classes), efficient serialization algorithm, and simple infrastructural requirement make Burlap/Hessian a good candidate for a remote protocol implementation in small devices.
Edmon Begoli is a software architect with 10 years of professional experience on large commercial and public software projects. He currently works for a large public institution.
|
发表评论
-
Spring声明式事务管理与配置详解
2015-08-18 09:00 01、Spring声明式事务配置的五种方式 前段时间对 ... -
Log4j的配置与使用详解
2015-08-18 08:44 7261、介绍 Log4j是Apache的一个开放源代码项目 ... -
Web.xml
2015-08-18 08:35 386web.xml文件详解 前言:一般的 ... -
Spring Filter
2015-08-18 08:23 4721、简介 Filter也称 ... -
springSecurity源码分析——DelegatingFilterProxy类的作用
2014-12-16 13:56 664http://www.cnblogs.com/hzhu ... -
spring data jpa 中的OpenEntityManagerInViewFilter 取代OpenSessionInViewFilter
2014-12-05 13:52 0http://blog.csdn.net/lzwglory/ ... -
servlet tomcat web.xml配备信息说明
2014-12-05 13:50 0servlet tomcat web.xml配置信息说明 ... -
Spring IntrospectorCleanupListener
2014-12-05 12:40 625spring中提供了一个名为 org.springfr ... -
Spring IOC容器实例化Bean的方式与RequestContextListener应用
2014-12-05 12:35 1029spring IOC容器实例化Be ... -
SpringBean的5种作用域
2014-12-05 12:33 756org.springframework.web.contex ... -
Lobback日志文件
2014-12-05 12:29 1137Logback是由log4j创始人Ceki Gülcü设计的 ... -
HTML Element
2012-08-05 17:16 9251. select 1) Clear Select O ... -
Prototype Study (转)
2012-08-05 16:49 753什么是Prototype Prototype 是由 S ... -
Prototype Element
2012-08-05 16:46 8971. select <select name=&q ... -
IE Firefox 一些组件的特殊处理
2012-07-29 09:04 8431、html alt 在IE下控件的alt属性使用赋值后,当 ... -
log4j 自动生成 appender
2011-05-04 21:55 1631一般log4j的配置是通过log4j.properties或x ... -
Java ASP Post
2011-03-06 20:32 1151用Java编写的模拟ASP Post请求写的一个上海的违章查询 ... -
Java Spring2.5 Remote Invoke HTTP Invoker
2011-03-06 20:16 2628近日,一个项目涉及到 ... -
Java Spring1.2 Remote Invoke HTTP Invoker
2011-02-25 09:12 1260近日,一个项目涉及到系统间接口调用,考虑到系统间用的都是jav ... -
File Encoding Converter
2009-11-13 16:52 1641在Java应用开发中,经常会遇到不同的开发人员的IDE设置的文 ...
相关推荐
java rmi java rmijava rmi javajava rmi java rmi rmi
java RMI技术实现的网络聊天室 编译通过,很完整的。代码很有参考价值
采用JAVA rmi,带图形界面,完全由自己实现的聊天室,具备基本的聊天功能,可以自己扩充功能
检测javaRMI反序列化漏洞
java RMI实现代码。分为客户端和服务器端,有清楚的代码注释。
java RMI
Java RMI 简单示例
最近在学习代理模式,用到了java rmi远程调用,包含服务端和客户端,之前一直没有接触过,学习了java rmi远程调用,一方面可以了解代理模式,一方面熟悉java低层的远程
JavaRMI.pdf
在这次的项目中,对于客户端与服务器之间的通信,想了许多办法,由于做的是富客户端应用,最终将技术选定在了RMI和Java-sockets两种之间,其中RMI的灵活性不高,客户端和服务器端都必须是java编写,但使用比较方便,...
Java RMI的应用——学习RMI的简单编程应用。编写一个课程成绩管理程序,要求用Java RMI实现
《Java RMI》一书的英文版本,With Java RMI, you'll learn tips and tricks for making your RMI code excel. This book provides strategies for working with serialization, threading, the RMI registry, ...
javaRMI完整版.pdf
Java RMI实例
这是本人搜集整理的Java RMI规范,中文版,经过排版 共包括10个章节,2个附录
Java编程rmi实例,给出远程方法调用技术在java方面的具体例子。
我的博客《Java中的RMI(远程方法调用)》的示例代码
JavaRMI的原理和实现方法 分布式对象计算 来源于青岛大学学报
这是原创的最简单的Java RMI入门项目,内含二个Eclipse项目,一是服务器端,二是客户端。非常简单,只看其中的注释就能理解(当然先要知道什么是RMI了),只供入门用。 这是用Java 1.7编辑的,如果你用的版本低,则...
JAVARMI实例[文].pdf