Examples of HessianProxyFactory


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

Examples of com.caucho.hessian.client.HessianProxyFactory

              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

Examples of com.caucho.hessian.client.HessianProxyFactory

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

Examples of com.caucho.hessian.client.HessianProxyFactory

  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

Examples of com.caucho.hessian.client.HessianProxyFactory

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

Examples of com.caucho.hessian.client.HessianProxyFactory

  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

Examples of com.caucho.hessian.client.HessianProxyFactory

  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

Examples of com.caucho.hessian.client.HessianProxyFactory

 
  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

Examples of com.caucho.hessian.client.HessianProxyFactory

  }

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

    return _proxyFactory;
  }
View Full Code Here

Examples of org.rzo.netty.ahessian.rpc.client.HessianProxyFactory

            "remoteAddress", new InetSocketAddress("localhost", 8080));

    bootstrap.setOption("reuseAddress", true);

   
    final HessianProxyFactory factory = new HessianProxyFactory(executor, "localhost:8080");
    bootstrap.setPipelineFactory(
            new RPCClientSessionPipelineFactory(new RPCClientMixinPipelineFactory(executor, factory), bootstrap));
   

    factory.setDisconnectedListener(new Runnable()
    {
      public void run()
      {
      //stop = true;
      }
    });

factory.setNewSessionListener(new Runnable()
{
  public void run()
  {
    stop = false;
    executor.execute(new Runnable()
    {
      public void run()
      {
          System.out.println("started work thread");
          Map options = new HashMap();
          options.put("sync", true);
          options.put("timeout", (long)10000);
          AsyncMBeanServerConnection service = (AsyncMBeanServerConnection) factory.create(AsyncMBeanServerConnection.class, Client.class.getClassLoader(), options);
          server = new MBeanServerConnectionAsyncAdapter(service);

            while (!stop)
            {
            try
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.