com.caucho.ejb.hessian
Class HessianStubFactory

java.lang.Object
  extended by com.caucho.ejb.hessian.HessianStubFactory
All Implemented Interfaces:
HessianRemoteResolver

public class HessianStubFactory
extends java.lang.Object
implements HessianRemoteResolver

Factory for creating Hessian client stubs. The returned stub will call the remote object for all methods.

 String url = "http://localhost:8080/ejb/hello";
 HelloHome hello = (HelloHome) factory.create(HelloHome.class, url);
 
After creation, the stub can be like a regular Java class. Because it makes remote calls, it can throw more exceptions than a Java class. In particular, it may throw protocol exceptions.


Constructor Summary
HessianStubFactory()
           
 
Method Summary
 java.lang.Object create(java.lang.Class api, java.lang.String url)
          Creates a new proxy with the specified URL.
 AbstractHessianInput getHessianInput(java.io.InputStream is)
           
 HessianOutput getHessianOutput(java.io.OutputStream os)
           
 HessianRemoteResolver getRemoteResolver()
          Returns the remote resolver.
 Path getWorkPath()
           
 java.lang.Object lookup(java.lang.String type, java.lang.String url)
          Looks up a proxy object.
 void setWorkPath(Path path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HessianStubFactory

public HessianStubFactory()
Method Detail

getRemoteResolver

public HessianRemoteResolver getRemoteResolver()
Returns the remote resolver.


setWorkPath

public void setWorkPath(Path path)

getWorkPath

public Path getWorkPath()

create

public java.lang.Object create(java.lang.Class api,
                               java.lang.String url)
                        throws java.lang.Exception
Creates a new proxy with the specified URL. The returned object is a proxy with the interface specified by api.
 String url = "http://localhost:8080/ejb/hello");
 HelloHome hello = (HelloHome) factory.create(HelloHome.class, url);
 

Throws:
java.lang.Exception

getHessianInput

public AbstractHessianInput getHessianInput(java.io.InputStream is)

getHessianOutput

public HessianOutput getHessianOutput(java.io.OutputStream os)

lookup

public java.lang.Object lookup(java.lang.String type,
                               java.lang.String url)
                        throws java.io.IOException
Looks up a proxy object.

Specified by:
lookup in interface HessianRemoteResolver
Throws:
java.io.IOException