| java.lang.Object com.caucho.hessian.client.HessianProxyFactory
HessianProxyFactory | public class HessianProxyFactory implements ServiceProxyFactory,ObjectFactory(Code) | | 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.
The factory can also be configured as a JNDI resource. The factory
expects to parameters: "type" and "url", corresponding to the two
arguments to create
In Resin 3.0, the above example would be configured as:
<reference>
<jndi-name>hessian/hello</jndi-name>
<factory>com.caucho.hessian.client.HessianProxyFactory</factory>
<init-param url="http://localhost:8080/ejb/hello"/>
<init-param type="test.HelloHome"/>
</reference>
To get the above resource, use JNDI as follows:
Context ic = new InitialContext();
HelloHome hello = (HelloHome) ic.lookup("java:comp/env/hessian/hello");
System.out.println("Hello: " + hello.helloWorld());
Authentication
The proxy can use HTTP basic authentication if the user and the
password are set.
|
HessianProxyFactory | public HessianProxyFactory()(Code) | | Creates the new proxy factory.
|
create | public Object create(String url) throws MalformedURLException, ClassNotFoundException(Code) | | Creates a new proxy with the specified URL. The API class uses
the java.api.class value from _hessian_
Parameters: url - the URL where the client object is located. a proxy to the object with the specified interface. |
create | public Object create(Class api, String urlName) throws MalformedURLException(Code) | | 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);
Parameters: api - the interface the proxy class needs to implement Parameters: url - the URL where the client object is located. a proxy to the object with the specified interface. |
create | public Object create(Class api, String urlName, ClassLoader loader) throws MalformedURLException(Code) | | 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);
Parameters: api - the interface the proxy class needs to implement Parameters: url - the URL where the client object is located. a proxy to the object with the specified interface. |
encode | public static char encode(long d)(Code) | | |
getReadTimeout | public long getReadTimeout()(Code) | | The socket timeout on requests in milliseconds.
|
isChunkedPost | public boolean isChunkedPost()(Code) | | Set true if should use chunked encoding on the request.
|
isDebug | public boolean isDebug()(Code) | | Gets the debug
|
isOverloadEnabled | public boolean isOverloadEnabled()(Code) | | Returns true if overloaded methods are allowed (using mangling)
|
setChunkedPost | public void setChunkedPost(boolean isChunked)(Code) | | Set true if should use chunked encoding on the request.
|
setConnectionFactoryName | public void setConnectionFactoryName(String connectionFactoryName)(Code) | | Sets the name of the connection factory to use when connecting
to JMS Hessian services.
|
setDebug | public void setDebug(boolean isDebug)(Code) | | Sets the debug
|
setHessian2Reply | public void setHessian2Reply(boolean isHessian2)(Code) | | True if the proxy can read Hessian 2 responses.
|
setHessian2Request | public void setHessian2Request(boolean isHessian2)(Code) | | True if the proxy should send Hessian 2 requests.
|
setOverloadEnabled | public void setOverloadEnabled(boolean isOverloadEnabled)(Code) | | set true if overloaded methods are allowed (using mangling)
|
setPassword | public void setPassword(String password)(Code) | | Sets the password.
|
setReadTimeout | public void setReadTimeout(long timeout)(Code) | | The socket timeout on requests in milliseconds.
|
setUser | public void setUser(String user)(Code) | | Sets the user.
|
|
|