Spring Remoting by Burlap Example
Both, Hessian and Burlap are provided by Coucho. Burlap is the xml-based alternative of Hessian.
By the help of BurlapServiceExporter and BurlapProxyFactoryBean classes, we can implement the remoting service provided by burlap.
Example of Burlap is same as Hessian, you need to change Hessian to Burlap only.
Example of Remoting by Burlap
You need to create following files for creating a simple burlap application:
It is the simple interface containing one method cube.
This class provides the implementation of Calculation interface.
In this xml file, we are defining DispatcherServlet as the front controller. If any request is followed by .http extension, it will be forwarded to DispatcherServlet.
It must be created inside the WEB-INF folder. Its name must be servletname-servlet.xml. It defines bean for CalculationImpl and BurlapServiceExporter.
In this xml file, we are defining bean for BurlapProxyFactoryBean. You need to define two properties of this class.
In this example, our project name is burlap, i.e. used as the context root in the serviceURL.
This class gets the instance of Calculation and calls the cube method.
How to run this example
Start and deploy the project, here we are assuming that server is running on 8888 port number. If the port number is different, change the serviceURL in client-beans.xml.
Then, Compile and Run the Client.java file.