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


Java HessianProxyFactory类代码示例

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


HessianProxyFactory类属于com.caucho.hessian.client包,在下文中一共展示了HessianProxyFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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包/类
public static void main(String args[]) throws IOException {

        String url = "http://localhost:8080/bingo";
//        String url = "http://localhost:8080";

        HessianProxyFactory factory = new HessianProxyFactory();
        BasicAPI basic = null;
        try {
            basic = (BasicAPI) factory.create(BasicAPI.class, url);
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }

//        InputStream inputStream = Files.newInputStream(Paths.get("/Users/whthomas/development/dev_test/ssqian/d.png"));

        Vo vo = new Vo();

        vo.setAge(10);
        vo.setName("whthomas");

        System.out.println("hello(): " + basic.bingo(vo));

    }
 
开发者ID:whthomas,项目名称:nessian,代码行数:24,代码来源:ClientTest.java

示例3: doRefer

import com.caucho.hessian.client.HessianProxyFactory; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected <T> T doRefer(Class<T> serviceType, URL url) throws RpcException {
    HessianProxyFactory hessianProxyFactory = new HessianProxyFactory();
    String client = url.getParameter(Constants.CLIENT_KEY, Constants.DEFAULT_HTTP_CLIENT);
    if ("httpclient".equals(client)) {
        hessianProxyFactory.setConnectionFactory(new HttpClientConnectionFactory());
    } else if (client != null && client.length() > 0 && ! Constants.DEFAULT_HTTP_CLIENT.equals(client)) {
        throw new IllegalStateException("Unsupported http protocol client=\"" + client + "\"!");
    }
    int timeout = url.getParameter(Constants.TIMEOUT_KEY, Constants.DEFAULT_TIMEOUT);
    hessianProxyFactory.setConnectTimeout(timeout);
    hessianProxyFactory.setReadTimeout(timeout);
    return (T) hessianProxyFactory.create(serviceType, url.setProtocol("http").toJavaURL(), Thread.currentThread().getContextClassLoader());
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:15,代码来源:HessianProtocol.java

示例4: hessianTest

import com.caucho.hessian.client.HessianProxyFactory; //导入依赖的package包/类
@Test
public void hessianTest() throws MalformedURLException {
    String url = "http://localhost:8080/hessian/helloService";
    HessianProxyFactory factory = new HessianProxyFactory();
    IHelloService basic = (IHelloService) factory.create(IHelloService.class, url);
    System.out.println("hello(): " + basic.sayHi("233333333333333333333333333333333始发地"));

}
 
开发者ID:paullyphang,项目名称:nebo,代码行数:9,代码来源:NeboTestCase.java

示例5: main

import com.caucho.hessian.client.HessianProxyFactory; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
  HessianProxyFactory proxyFactory = new HessianProxyFactory();
  RecordManager recMgr = (RecordManager)proxyFactory.create(
      RecordManager.class, "http://localhost:8080/bisis/RecMgr");
  
  Record rec = recMgr.getRecord(1);
  System.out.println(rec);
  String user = recMgr.lock(1, "branko");
  System.out.println("record locked by: " + user);
  recMgr.unlock(1);
  System.out.println("unlocked");
  recMgr.update(rec);
  System.out.println("record updated");
  
}
 
开发者ID:unsftn,项目名称:bisis-v4,代码行数:16,代码来源:RemotingTest.java

示例6: main

import com.caucho.hessian.client.HessianProxyFactory; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
  System.out.println("Creating Hessian proxy factory...");
  HessianProxyFactory proxyFactory = new HessianProxyFactory();
  System.out.println("Creating RecordManager proxy...");
  RecordManager recMgr = (RecordManager)proxyFactory.create(
      RecordManager.class, "http://localhost:8080/bisis/RecMgr");
  
  System.out.println("Retrieving record...");
  Record rec = recMgr.getRecord(1);
  System.out.println("Updating record...");
  recMgr.update(rec);
  System.out.println("Done.");
}
 
开发者ID:unsftn,项目名称:bisis-v4,代码行数:14,代码来源:JMSTest1.java

示例7: doRefer

import com.caucho.hessian.client.HessianProxyFactory; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected <T> T doRefer(Class<T> serviceType, URL url) throws JahhanException {
    HessianProxyFactory hessianProxyFactory = new HessianProxyFactory();
    String client = url.getParameter(Constants.CLIENT_KEY, Constants.DEFAULT_HTTP_CLIENT);
    if ("httpclient".equals(client)) {
        hessianProxyFactory.setConnectionFactory(new HttpClientConnectionFactory());
    } else if (client != null && client.length() > 0 && ! Constants.DEFAULT_HTTP_CLIENT.equals(client)) {
        throw new IllegalStateException("Unsupported http protocol client=\"" + client + "\"!");
    }
    int timeout = url.getParameter(Constants.TIMEOUT_KEY, Constants.DEFAULT_TIMEOUT);
    hessianProxyFactory.setConnectTimeout(timeout);
    hessianProxyFactory.setReadTimeout(timeout);
    return (T) hessianProxyFactory.create(serviceType, url.setProtocol("http").toJavaURL(), Thread.currentThread().getContextClassLoader());
}
 
开发者ID:nince-wyj,项目名称:jahhan,代码行数:15,代码来源:HessianProtocol.java

示例8: testEpgClassify

import com.caucho.hessian.client.HessianProxyFactory; //导入依赖的package包/类
/**
 * 测试电视台分类
 */
public void testEpgClassify() {
	HessianProxyFactory proxy = new HessianProxyFactory();
	try {
		JolynnTv tv = (JolynnTv) proxy.create(JolynnTv.class, url);
		String classify = tv.getMyTvClassify();
		JSONArray array = JSON.parseArray(classify);
		assertNotNull(array);
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:52Jolynn,项目名称:MyTv,代码行数:15,代码来源:HessianTest.java

示例9: testEpgStation

import com.caucho.hessian.client.HessianProxyFactory; //导入依赖的package包/类
/**
 * 测试电视台
 */
public void testEpgStation() {
	HessianProxyFactory proxy = new HessianProxyFactory();
	try {
		JolynnTv tv = (JolynnTv) proxy.create(JolynnTv.class, url);
		String stations = tv.getMyTvByClassify("番禺有线");
		JSONArray array = JSON.parseArray(stations);
		assertNotNull(array);
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:52Jolynn,项目名称:MyTv,代码行数:15,代码来源:HessianTest.java

示例10: testEpgProgram

import com.caucho.hessian.client.HessianProxyFactory; //导入依赖的package包/类
/**
 * 测试电视节目
 */
public void testEpgProgram() {
	HessianProxyFactory proxy = new HessianProxyFactory();
	try {
		JolynnTv tv = (JolynnTv) proxy.create(JolynnTv.class, url);
		String program = tv.getProgramTable("CCTV-1 综合", "番禺有线",
				DateUtils.today());
		JSONArray array = JSON.parseArray(program);
		assertNotNull(array);
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:52Jolynn,项目名称:MyTv,代码行数:16,代码来源:HessianTest.java

示例11: getHelloHessian

import com.caucho.hessian.client.HessianProxyFactory; //导入依赖的package包/类
public static HelloHessian getHelloHessian() throws Exception {
	// servlet发布的服务
	String url = "http://localhost:8080/jCodes-hessian/HessianService1";
	// spring发布的Hessian服务
	// url = "http://localhost:8080/jCodes-hessian/HessianService2";
	HessianProxyFactory factory = new HessianProxyFactory();
	HelloHessian hello = (HelloHessian) factory.create(HelloHessian.class, url);
	return hello;
}
 
开发者ID:dreajay,项目名称:jcode,代码行数:10,代码来源:HessianClientTest.java

示例12: main

import com.caucho.hessian.client.HessianProxyFactory; //导入依赖的package包/类
public static void main(String[] args) {
    HessianProxyFactory factory = new HessianProxyFactory();
    try {
        HelloHessian helloHessian = (HelloHessian) factory.create(HelloHessian.class, url);
        String msg = helloHessian.say("Hessian");
        System.out.println(msg);
    } catch (MalformedURLException e) {
        e.printStackTrace();
    }
}
 
开发者ID:zoopaper,项目名称:rpc4j,代码行数:11,代码来源:HelloHessianTest.java

示例13: DistributedRunner

import com.caucho.hessian.client.HessianProxyFactory; //导入依赖的package包/类
public DistributedRunner(List<String> hosts) {
    for (String slave : hosts) {
        try {
            HessianProxyFactory factory = new HessianProxyFactory();
            SlaveAPI service = (SlaveAPI) factory.create(SlaveAPI.class, "http://" + slave + Slave.PATH);
            this.slaveService.add(service);
        } catch (MalformedURLException e) {
            throw new RuntimeException(e);
        }
    }

    this.threadPool = Executors.newFixedThreadPool(this.slaveService.size());
}
 
开发者ID:tamuri,项目名称:swmutsel,代码行数:14,代码来源:DistributedRunner.java

示例14: doRefer

import com.caucho.hessian.client.HessianProxyFactory; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected <T> T doRefer(Class<T> serviceType, URL url) throws RpcException {
    HessianProxyFactory hessianProxyFactory = new HessianProxyFactory();
    String client = url.getParameter(Constants.CLIENT_KEY, Constants.DEFAULT_HTTP_CLIENT);
    if ("httpclient".equals(client)) {
        hessianProxyFactory.setConnectionFactory(new HttpClientConnectionFactory());
    } else if (client != null && client.length() > 0 && !Constants.DEFAULT_HTTP_CLIENT.equals(client)) {
        throw new IllegalStateException("Unsupported http protocol client=\"" + client + "\"!");
    }
    int timeout = url.getParameter(Constants.TIMEOUT_KEY, Constants.DEFAULT_TIMEOUT);
    hessianProxyFactory.setConnectTimeout(timeout);
    hessianProxyFactory.setReadTimeout(timeout);
    return (T) hessianProxyFactory.create(serviceType, url.setProtocol("http").toJavaURL(), Thread.currentThread().getContextClassLoader());
}
 
开发者ID:hufeng,项目名称:dubbo2.js,代码行数:15,代码来源:HessianProtocol.java

示例15: setHessianProxyFactory

import com.caucho.hessian.client.HessianProxyFactory; //导入依赖的package包/类
public void setHessianProxyFactory(HessianProxyFactory factory) {
    HttpConnectionParams.setConnectionTimeout(httpClient.getParams(), (int) factory.getConnectTimeout());
    HttpConnectionParams.setSoTimeout(httpClient.getParams(), (int) factory.getReadTimeout());
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:5,代码来源:HttpClientConnectionFactory.java


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