Package com.caucho.hessian.client

Examples of com.caucho.hessian.client.HessianProxyFactory


import com.caucho.hessian.client.HessianProxyFactory;

public class SMSEngineServiceWorkTest {

    public static void main(String[] args) throws Exception {
        HessianProxyFactory factory = new HessianProxyFactory();
        SMSEngine engine = (SMSEngine) factory.create(SMSEngine.class, "http://localhost:9292/sms-engine/service");
        try {
            engine.sendSMS("79053673205", "sms sending test");
            System.out.println("sms sent");
            engine.sendSMS("79053673205", "sms sending test");
            System.out.println("sms sent");
View Full Code Here


              System.out.println(session.getPeerHost());
             return urlHostName.equals(session.getPeerHost())
           
       }
         HttpsURLConnection.setDefaultHostnameVerifier(hv);
    HessianProxyFactory factory = new HessianProxyFactory();
    factory.setUser("client1");
    factory.setPassword("client1");
    factory.setDebug(true);
    factory.setOverloadEnabled(true);
    // factory.setReadTimeout(100);
    final Hello basic = (Hello) factory.create(Hello.class, url);
    // 测试方法重载
    System.out.println(basic.hello("郭蕾"));
  }
View Full Code Here

public class Test {

  public static void main(String[] args) throws MalformedURLException {

    String url = "http://localhost:8081/apis/hello/";
    HessianProxyFactory factory = new HessianProxyFactory();
    factory.setUser("client1");

    factory.setPassword("client1");

    factory.setDebug(true);
    factory.setOverloadEnabled(true);
    // factory.setConnectTimeout(timeout);

    // factory.setReadTimeout(100);
    final Hello basic = (Hello) factory.create(Hello.class, url);

    // System.out.println("SayHello:" + basic.hello("guolei"));
    // System.out.println("SayHello:" + basic.test());
    // System.out.println(basic.getAppSecret("11"));
    // User user = basic.getUser(1);
View Full Code Here

  private FederatedServiceRegistry _service;

  @Before
  public void setup() throws MalformedURLException {
    String port = System.getProperty("org_onebusaway_test_port", "8080");
    HessianProxyFactory factory = new HessianProxyFactory();
    _service = (FederatedServiceRegistry) factory.create(
        FederatedServiceRegistry.class, "http://localhost:" + port
            + "/onebusaway-federations-webapp/remoting/service-registry");
  }
View Full Code Here

import com.caucho.hessian.client.HessianProxyFactory;

public class Hessian {
  @SuppressWarnings("unchecked")
  public static <T> T connect(String serviceUrl, Class<T> serviceInterface) {
    HessianProxyFactory factory = new HessianProxyFactory();
    try {
      return (T) factory.create(serviceInterface, serviceUrl);
    } catch (MalformedURLException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

  private RemoteJMX getProxy()
  {
    if (_jmxProxy == null) {
      try {
  HessianProxyFactory proxy = new HessianProxyFactory();
  proxy.getSerializerFactory().addFactory(new JMXSerializerFactory());
  _jmxProxy = (RemoteJMX) proxy.create(_url);
      } catch (Exception e) {
  throw new RuntimeException(e);
      }
    }
View Full Code Here

  private RemoteJMX getProxy()
  {
    if (_jmxProxy == null) {
      try {
        HessianProxyFactory proxy = new HessianProxyFactory();
        proxy.getSerializerFactory().addFactory(new JMXSerializerFactory());
        _jmxProxy = (RemoteJMX) proxy.create(_url);
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
View Full Code Here

 
  public Object getProxy(Class serviceInterface, String url)
    throws MalformedURLException
  {
    // XXX Go through com.caucho.soa.transport.TransportFactory?
    HessianProxyFactory proxyFactory = getProxyFactory();

    return proxyFactory.create(serviceInterface, url);
  }
View Full Code Here

  }

  private HessianProxyFactory getProxyFactory()
  {
    if (_proxyFactory == null)
      _proxyFactory = new HessianProxyFactory();

    return _proxyFactory;
  }
View Full Code Here

TOP

Related Classes of com.caucho.hessian.client.HessianProxyFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.