com.caucho.burlap.client
类 BurlapProxyFactory

java.lang.Object
  继承者 com.caucho.burlap.client.BurlapProxyFactory
所有已实现的接口:
ServiceProxyFactory, javax.naming.spi.ObjectFactory

public class BurlapProxyFactory
extends java.lang.Object
implements ServiceProxyFactory, javax.naming.spi.ObjectFactory

Factory for creating Burlap 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>
   <name>hessian/hello</name>
   <factory>com.caucho.hessian.client.HessianProxyFactory</factory>
   <init url="http://localhost:8080/ejb/hello"/>
         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/burlap/hello");

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

Authentication

The proxy can use HTTP basic authentication if the user and the password are set.


构造方法摘要
BurlapProxyFactory()
          Creates the new proxy factory.
 
方法摘要
 java.lang.Object create(java.lang.Class api, java.lang.String urlName)
          Creates a new proxy with the specified URL.
 java.lang.Object create(java.lang.String url)
          Creates a new proxy with the specified URL.
static char encode(long d)
           
 AbstractBurlapInput getBurlapInput(java.io.InputStream is)
           
 BurlapOutput getBurlapOutput(java.io.OutputStream os)
           
 java.lang.Object getObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context nameCtx, java.util.Hashtable<?,?> environment)
          JNDI object factory so the proxy can be used as a resource.
 BurlapRemoteResolver getRemoteResolver()
          Returns the remote resolver.
 boolean isOverloadEnabled()
          Returns true if overloaded methods are allowed (using mangling)
 void setOverloadEnabled(boolean isOverloadEnabled)
          set true if overloaded methods are allowed (using mangling)
 void setPassword(java.lang.String password)
          Sets the password.
 void setUser(java.lang.String user)
          Sets the user.
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

BurlapProxyFactory

public BurlapProxyFactory()
Creates the new proxy factory.

方法详细信息

setUser

public void setUser(java.lang.String user)
Sets the user.


setPassword

public void setPassword(java.lang.String password)
Sets the password.


isOverloadEnabled

public boolean isOverloadEnabled()
Returns true if overloaded methods are allowed (using mangling)


setOverloadEnabled

public void setOverloadEnabled(boolean isOverloadEnabled)
set true if overloaded methods are allowed (using mangling)


getRemoteResolver

public BurlapRemoteResolver getRemoteResolver()
Returns the remote resolver.


create

public java.lang.Object create(java.lang.String url)
                        throws java.net.MalformedURLException,
                               java.lang.ClassNotFoundException
Creates a new proxy with the specified URL. The API class uses the java.api.class value from _hessian_

参数:
url - the URL where the client object is located.
返回:
a proxy to the object with the specified interface.
抛出:
java.net.MalformedURLException
java.lang.ClassNotFoundException

create

public java.lang.Object create(java.lang.Class api,
                               java.lang.String urlName)
                        throws java.net.MalformedURLException
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);
 

指定者:
接口 ServiceProxyFactory 中的 create
参数:
api - the interface the proxy class needs to implement
url - the URL where the client object is located.
返回:
a proxy to the object with the specified interface.
抛出:
java.net.MalformedURLException

getBurlapInput

public AbstractBurlapInput getBurlapInput(java.io.InputStream is)

getBurlapOutput

public BurlapOutput getBurlapOutput(java.io.OutputStream os)

getObjectInstance

public java.lang.Object getObjectInstance(java.lang.Object obj,
                                          javax.naming.Name name,
                                          javax.naming.Context nameCtx,
                                          java.util.Hashtable<?,?> environment)
                                   throws java.lang.Exception
JNDI object factory so the proxy can be used as a resource.

指定者:
接口 javax.naming.spi.ObjectFactory 中的 getObjectInstance
抛出:
java.lang.Exception

encode

public static char encode(long d)