com.github.antelopeframework.remoting.client.HessianProxyFactory Maven / Gradle / Ivy
package com.github.antelopeframework.remoting.client;
import java.lang.reflect.Proxy;
import java.net.URL;
import com.caucho.hessian.io.HessianRemoteObject;
import lombok.Setter;
public class HessianProxyFactory extends com.caucho.hessian.client.HessianProxyFactory {
@Setter
private String app;
private String user;
private String password;
public Object create(Class> api, URL url, ClassLoader loader) {
if (api == null)
throw new NullPointerException("api must not be null for HessianProxyFactory.create()");
HessianProxy hessianProxy = new HessianProxy(url, this, api);
hessianProxy.setApp(app);
hessianProxy.setUser(user);
hessianProxy.setPassword(password);
return Proxy.newProxyInstance(loader, new Class[] { api, HessianRemoteObject.class }, hessianProxy);
}
@Override
public void setUser(String user) {
super.setUser(user);
this.user = user;
}
@Override
public void setPassword(String password) {
super.setPassword(password);
this.password = password;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy