Package com.caucho.hessian.client

Portable client code for using Hessian services.


Interface Summary
HessianConnection Internal connection to a server.
HessianConnectionFactory Internal factory for creating connections to the server.
HessianMetaInfoAPI API retrieving hessian meta information.

Class Summary
AbstractHessianConnection Internal connection to a server.
AbstractHessianConnectionFactory Internal factory for creating connections to the server.
HessianJMSProxy Proxy implementation for Hessian clients using JMS.
HessianProxy Proxy implementation for Hessian clients.
HessianProxyFactory Factory for creating Hessian client stubs.
HessianProxyResolver Looks up remote objects in the proxy.
HessianURLConnection Internal connection to a server.
HessianURLConnectionFactory Internal factory for creating connections to the server.

Exception Summary
HessianConnectionException Exception caused by failure of the client proxy to connect to the server.
HessianRuntimeException Wrapper for protocol exceptions thrown in the proxy.

Package com.caucho.hessian.client Description

Portable client code for using Hessian services. Since this package is independent of all Resin code, its classes can be copied to a non-Resin client jar.

RPC Proxy Clients - HessianProxyFactory

Most application clients will use HessianProxyFactory to create stub objects. The stub objects can be called with normal Java calls. Because the objects are remote, the client application needs to be able to deal with IOException caused by an unavailable server or a protocol error.
import com.caucho.hessian.client.HessianProxyFactory;


URL url = new URL("http://localhost:8080/ejb/hello");
HelloHome hello = (HelloHome) factory.create(HelloHome.class, url);

System.out.println("hello: " + hello.hello());


Since the Hessian protocol serializes Java objects to XML, the HessianSerializerOutput and HessianSerializerInput can be used for serialization.


OutputStream os = new FileOutputStream("test.xml");
HessianOutput out = new HessianSerializerOutput(os);



InputStream is = new FileInputStream("test.xml");
HessianInput in = new HessianSerializerInput(in);

Object obj = in.readObject();


MicroHessianInput and MicroHessianOutput

These two classes only require classes from Java MicroEdition. So they can be extracted separately into a hessian-micro.jar. Because of this restriction and their small size, these two classes are ideal for limited size devices like mobile phones and PDAs.