当前位置: 首页>>代码示例>>Java>>正文


Java HessianProxyFactory.setPassword方法代码示例

本文整理汇总了Java中com.caucho.hessian.client.HessianProxyFactory.setPassword方法的典型用法代码示例。如果您正苦于以下问题:Java HessianProxyFactory.setPassword方法的具体用法?Java HessianProxyFactory.setPassword怎么用?Java HessianProxyFactory.setPassword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.caucho.hessian.client.HessianProxyFactory的用法示例。


在下文中一共展示了HessianProxyFactory.setPassword方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getInterface

import com.caucho.hessian.client.HessianProxyFactory; //导入方法依赖的package包/类
/**
 * Establish administrator credentials
 */
public Object getInterface(Class<?> clazz)
{
	HessianProxyFactory fact = new HessianProxyFactory();
	fact.setOverloadEnabled(true);
	if (this.getPrincipalName() != null)
	{
		fact.setUser(this.getPrincipalName());
		fact.setPassword(this.getPassword());
	}
	
	String url = WebApp.HOSTPORT + "/se/api/" + clazz.getSimpleName();
	
	try
	{
		return fact.create(clazz, url);
	}
	catch (MalformedURLException ex) { throw new RuntimeException(ex); }
}
 
开发者ID:voodoodyne,项目名称:subetha,代码行数:22,代码来源:BeanMixin.java

示例2: main

import com.caucho.hessian.client.HessianProxyFactory; //导入方法依赖的package包/类
/** 
 * Create a thread to listen for messages coming from threads generating load.
 * 
 * Note: This requires SubEtha running on port 2500!
 */
public static void main(String[] args) throws Exception
{
	if (args.length < 2 || args.length > 3)
	{
		System.err.println("Usage:  org.subethamail.loadtest.LoadGenerator [email protected] [email protected] [attachment]");
	}
	else
	{
		InternetAddress sender = new InternetAddress(args[0]);
		InternetAddress recipient = new InternetAddress(args[1]);
		
		File attachment = (args.length == 3) ? new File(args[2]) : null;

		HessianProxyFactory fact = new HessianProxyFactory();
		fact.setOverloadEnabled(true);
		fact.setUser("[email protected]");
		fact.setPassword("password");

		String url = "http://localhost:8080/se/api/" + Eegor.class.getSimpleName();
		
		Eegor eegor = null;
		try
		{
			System.out.println("Creating eegor: " + url);
			eegor = (Eegor)fact.create(Eegor.class, url);
			
			System.out.println("Creating wiser listener on port 2525!");
			//this will start the listening wiser instance at port 2525
			Thread countingThread  = new Thread(new LoadTester("localhost",2525));
			countingThread.start();

			System.out.println("Enabling test mode!");
			eegor.enableTestMode("localhost:2525");
			
			for (int i = 0; i < 50; i++)
			{
				System.out.println("Create LoadGen Thread!");
				(new Thread(new LoadGenerator(sender, recipient, attachment))).start();
			}
			
			System.out.println("countingThread.join() -- waiting for end");
			countingThread.join();
		}
		finally
		{
			System.out.println("Disabling test mode!");
			if (eegor != null) eegor.disableTestMode();
		}
	}
}
 
开发者ID:voodoodyne,项目名称:subetha,代码行数:56,代码来源:LoadGenerator.java


注:本文中的com.caucho.hessian.client.HessianProxyFactory.setPassword方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。