All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.antelopeframework.remoting.client.HessianProxyFactory Maven / Gradle / Ivy

There is a newer version: 1.1.5
Show newest version
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