Package org.rzo.netty.ahessian.rpc.client

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


          ClientBootstrap bootstrap = new ClientBootstrap(
                  new NioClientSocketChannelFactory(
                      executor,
                      executor));
         
          HessianProxyFactory factory = new HessianProxyFactory(executor, host.getName()+":"+host.getPort());
          bootstrap.setPipelineFactory(
                  new RPCClientPipelineFactory(executor, factory));
         
           // Start the connection attempt.
          ChannelFuture future = bootstrap.connect(new InetSocketAddress(host.getName(), host.getPort()));
          try
        {
          future.await(10000);
          connected = future.isSuccess();


          if (connected)
          {
              Map options = new HashMap();
              options.put("sync", true);
              options.put("timeout", new Long(10000));
            proxy = (AsyncServiceManagerServer) factory.create(AsyncServiceManagerServer.class, HubMain.class.getClassLoader(), options);
            connected = ((Boolean)proxy.isServiceManager()).booleanValue();
            if (connected)
            {
              synchronized(proxies)
              {
View Full Code Here

  String          currentHost  = null;
  HessianProxyFactory    factory;

  public AHessianJmxClient(String discoveryName, int port) throws Exception
  {
    factory = new HessianProxyFactory(executor, "AHessianJMX", null);

    // in case we are disconnected: start the discovery
    factory.setDisconnectedListener(new Runnable()
    {
      public void run()
View Full Code Here

          ClientBootstrap bootstrap = new ClientBootstrap(
                  new NioClientSocketChannelFactory(
                      executor,
                      executor));
         
          HessianProxyFactory factory = new HessianProxyFactory(executor, host.getName()+":"+host.getPort());
          bootstrap.setPipelineFactory(
                  new RPCClientPipelineFactory(executor, factory));
         
           // Start the connection attempt.
          ChannelFuture future = bootstrap.connect(new InetSocketAddress(host.getName(), host.getPort()));
          try
        {
          future.await(10000);
          connected = future.isSuccess();


          if (connected)
          {
              Map options = new HashMap();
            proxy = (AsyncServiceManagerServer) factory.create(AsyncServiceManagerServer.class, ClientMain.class.getClassLoader(), options);
            connected = ((Boolean)((Future)proxy.isServiceManager()).get(10, TimeUnit.SECONDS)).booleanValue();
            if (connected)
            {
            proxies.put(host.getName(), proxy);
            Host newHost = new Host(host.getName(), host.getPort());
View Full Code Here

TOP

Related Classes of org.rzo.netty.ahessian.rpc.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.