Package org.rzo.yajsw.srvmgr.client

Examples of org.rzo.yajsw.srvmgr.client.AsyncServiceManagerServer


    synchronized(servicesList)
    {
    servicesList.clear();
    for (String host : hostsList.keySet())
    {
      AsyncServiceManagerServer proxy = proxies.get(host);
      Collection<ServiceInfo> services = null;
      try
      {
         services = (Collection<ServiceInfo>) ((Map<String, ServiceInfo>) proxy.getServiceList()).values();
      }
      catch (Exception ex)
      {
        ex.printStackTrace();
      }
View Full Code Here


    boolean changed = false;
    synchronized(hostsList)
    {
    for (Host host : hostsList.values())
    {
      AsyncServiceManagerServer proxy = null;
      synchronized(proxies)
      {
       proxy = proxies.get(host.getName());
      }
      boolean connected = false;
      if (proxy != null)
      {
        try
        {
          connected = ((Boolean)proxy.isServiceManager()).booleanValue();
        }
        catch (Exception e)
        {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
      else
      {
          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)
              {
            proxies.put(host.getName(), proxy);
View Full Code Here

    }
  }

  public void start(String serviceName, String hostName)
  {
    AsyncServiceManagerServer proxy = _proxies.get(hostName);
    if (proxy != null)
      proxy.start(serviceName);
  }
View Full Code Here

      proxy.start(serviceName);
  }

  public void stop(String serviceName, String hostName)
  {
    AsyncServiceManagerServer proxy = _proxies.get(hostName);
    if (proxy != null)
      proxy.stop(serviceName);
  }
View Full Code Here

TOP

Related Classes of org.rzo.yajsw.srvmgr.client.AsyncServiceManagerServer

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.