Examples of NioClient


Examples of com.cloud.utils.nio.NioClient

          s_logger.debug("Skipping " + agentIp + " because " + guidWithTail + " is already in the database.");
          return null;
        }
         
          // bootstrap SCVMM agent to connect back to management server
          NioClient _connection = new NioClient("HypervAgentClient", url.getHost(), 9000, 1, this)
          _connection.start();

          StartupVMMAgentCommand cmd = new StartupVMMAgentCommand(
              dcId,
              podId,
              clusterName,
              guid,
              InetAddress.getLocalHost().getHostAddress(),
              "8250",
              HypervServerDiscoverer.class.getPackage().getImplementationVersion());
         
          // send bootstrap command to agent running on SCVMM host 
          s_logger.info("sending bootstrap request to SCVMM agent on host "+ url.getHost());
          Request request = new Request(0, 0, cmd, false);

          // :FIXME without sleep link.send failing why??????
          Thread.currentThread().sleep(5000);
          _link.send(request.toBytes());

          //wait for SCVMM agent to connect back
      HostVO connectedHost = waitForHostConnect(dcId, podId, clusterId, guidWithTail);
      if (connectedHost == null)
      {
        s_logger.info("SCVMM agent did not connect back after sending bootstrap request");
        return null;
      }

          //disconnect
      s_logger.info("SCVMM agent connected back after sending bootstrap request");
          _connection.stop();       
 
          Map<HypervDummyResourceBase, Map<String, String>> resources = new HashMap<HypervDummyResourceBase, Map<String, String>>();
          Map<String, String> details = new HashMap<String, String>();
          Map<String, Object> params = new HashMap<String, Object>();
          HypervDummyResourceBase resource = new HypervDummyResourceBase();
View Full Code Here

Examples of com.cloud.utils.nio.NioClient

    // for simulator use only
    public Agent(IAgentShell shell) {
        _shell = shell;
        _link = null;

        _connection = new NioClient("Agent", _shell.getHost(), _shell.getPort(), _shell.getWorkers(), this);

        Runtime.getRuntime().addShutdownHook(new ShutdownThread(this));

        _ugentTaskPool = new ThreadPoolExecutor(shell.getPingRetries(), 2 * shell.getPingRetries(), 10, TimeUnit.MINUTES,
                                                new SynchronousQueue<Runnable>(), new NamedThreadFactory("UgentTask")
View Full Code Here

Examples of com.cloud.utils.nio.NioClient

        if (!_resource.configure(getResourceName(), params)) {
            throw new ConfigurationException("Unable to configure " + _resource.getName());
        }

        _connection = new NioClient("Agent", _shell.getHost(), _shell.getPort(), _shell.getWorkers(), this);

        // ((NioClient)_connection).setBindAddress(_shell.getPrivateIp());

        s_logger.debug("Adding shutdown hook");
        Runtime.getRuntime().addShutdownHook(new ShutdownThread(this));
View Full Code Here

Examples of com.cloud.utils.nio.NioClient

        }
  
        _connection.start();
       while (!_connection.isStartup()) {
           _shell.getBackoffAlgorithm().waitBeforeRetry();
           _connection = new NioClient("Agent", _shell.getHost(), _shell.getPort(), _shell.getWorkers(), this);
           _connection.start();
       }
    }
View Full Code Here

Examples of com.cloud.utils.nio.NioClient

        try {
            _connection.cleanUp();
        } catch (IOException e) {
            s_logger.warn("Fail to clean up old connection. " + e);
        }
        _connection = new NioClient("Agent", _shell.getHost(), _shell.getPort(), _shell.getWorkers(), this);
        do {
            s_logger.info("Reconnecting...");
            _connection.start();
            _shell.getBackoffAlgorithm().waitBeforeRetry();
        } while (!_connection.isStartup());
View Full Code Here

Examples of com.cloud.utils.nio.NioClient

        _completedCount = 0;

        _server = new NioServer("NioTestServer", 7777, 5, new NioTestServer());
        _server.start();

        _client = new NioClient("NioTestServer", "127.0.0.1", 7777, 5, new NioTestClient());
        _client.start();

        while (_clientLink == null) {
            try {
                s_logger.debug("Link is not up! Waiting ...");
View Full Code Here

Examples of com.cloud.utils.nio.NioClient

    // for simulator use only
    public Agent(IAgentShell shell) {
        _shell = shell;
        _link = null;

        _connection = new NioClient("Agent", _shell.getHost(), _shell.getPort(), _shell.getWorkers(), this);

        Runtime.getRuntime().addShutdownHook(new ShutdownThread(this));

        _ugentTaskPool = new ThreadPoolExecutor(shell.getPingRetries(), 2 * shell.getPingRetries(), 10, TimeUnit.MINUTES,
                                                new SynchronousQueue<Runnable>(), new NamedThreadFactory("UgentTask")
View Full Code Here

Examples of com.cloud.utils.nio.NioClient

        if (!_resource.configure(getResourceName(), params)) {
            throw new ConfigurationException("Unable to configure " + _resource.getName());
        }

        _connection = new NioClient("Agent", _shell.getHost(), _shell.getPort(), _shell.getWorkers(), this);

        // ((NioClient)_connection).setBindAddress(_shell.getPrivateIp());

        s_logger.debug("Adding shutdown hook");
        Runtime.getRuntime().addShutdownHook(new ShutdownThread(this));
View Full Code Here

Examples of com.cloud.utils.nio.NioClient

        }
  
        _connection.start();
       while (!_connection.isStartup()) {
           _shell.getBackoffAlgorithm().waitBeforeRetry();
           _connection = new NioClient("Agent", _shell.getHost(), _shell.getPort(), _shell.getWorkers(), this);
           _connection.start();
       }
    }
View Full Code Here

Examples of com.cloud.utils.nio.NioClient

        try {
            _connection.cleanUp();
        } catch (IOException e) {
            s_logger.warn("Fail to clean up old connection. " + e);
        }
        _connection = new NioClient("Agent", _shell.getHost(), _shell.getPort(), _shell.getWorkers(), this);
        do {
            s_logger.info("Reconnecting...");
            _connection.start();
            _shell.getBackoffAlgorithm().waitBeforeRetry();
        } while (!_connection.isStartup());
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.