Spring Book – Chapter 18 – Remoting

Caucho’s Hessian

Hessian offers a binary HTTP-based remoting protocol. Spring supports Hessian via org.springframework.remoting.caucho.HessianProxyFactoryBean and org.springframework.remoting.caucho.HessianServiceExporter. Hessian is a slim, binary RPC protocol. It achieves cross-platform interoperability with minimal performance degradation. However, Hessian uses a custom reflection-based serialization mechanism which can be troublesome in certain scenarios.

HessianProxyFactoryBean is the FactoryBean for Hessian proxies. it exposes the proxied service for use as a bean reference, using the specified service interface. The service URL must be an HTTP URL exposing a Hessian service.

HessianServiceExporter is the servlet-API-based HTTP request handler that exports the specified service bean as Hessian service endpoint, accessible via a Hessian proxy. Hessian services exported with this class can be accessed by any Hessian client, as there isn’t any special handling involved. Spring also provides an alternative version of this exporter, for Sun’s JRE 1.6 HTTP server namely org.springframework.remoting.caucho.SimpleHessianServiceExporter. Configuring Hessian remoting technology in your application is as easy as configuring service exporter and client proxy in the Spring configuration file, applicationContext.xml as shown in Listing 19-10 and Listing 19-11 below respectively.

Listing 19-10. Service Exporter configuration in Spring configuration file applicationContext.xml in server side

Listing 19-11. Client proxy in Spring configuration file applicationContext.xml in client side

Caucho’s Burlap

Burlap is Caucho’s XML-based alternative to Hessian. Spring provides support classes such as org.springframework.remoting.caucho.BurlapProxyFactoryBean and org.springframework.remoting.caucho.BurlapServiceExporter. Burlap is a slim, XML-based RPC protocol.

BurlapProxyFactoryBean is the FactoryBean for Burlap proxies. It exposes the proxied service for use as a bean reference, using the specified service interface. The service URL must be an HTTP URL exposing a Burlap service.

BurlapServiceExporter is the servlet-API-based HTTP request handler that exports the specified service bean as Burlap service endpoint, accessible via a Burlap proxy. Spring also provides an alternative version of this exporter, for Sun’s JRE 1.6 HTTP server namely org.springframework.remoting.caucho.SimpleBurlapServiceExporter. Burlap services exported with this class can be accessed by any Burlap client, as there isn’t any special handling involved. Configuring Burlap remoting technology in your application is as easy as configuring service exporter and client proxy in the Spring configuration file, applicationContext.xml as shown in Listing 19-12 and Listing 19-13 below respectively.

Listing 19-12. Service Exporter configuration in Spring configuration file applicationContext.xml in server side

Listing 19-13. Client proxy in Spring configuration file applicationContext.xml in client side

Page Visitors: 4802

The following two tabs change content below.
Tomcy John

Tomcy John

Blogger & Author at javacodebook
He is an Enterprise Java Specialist holding a degree in Engineering (B-Tech) with over 10 years of experience in several industries. He's currently working as Principal Architect at Emirates Group IT since 2005. Prior to this he has worked with Oracle Corporation and Ernst & Young. His main specialization is on various web technologies and acts as chief mentor and Architect to facilitate incorporating Spring as Corporate Standard in the organization.
Tomcy John

Latest posts by Tomcy John (see all)

Leave a Reply

Your email address will not be published. Required fields are marked *