Exemplo n.º 1
0
        public void WaitForDriverToFinish()
        {
            DriverStatus status = FetchFirstDriverStatus();

            if (DriverStatus.UNKNOWN == status)
            {
                // We were unable to connect to the Driver at least once.
                throw new WebException("Unable to connect to the Driver.");
            }

            while (status.IsActive())
            {
                // Add sleep in while loop, whose value alligns with default heart beat interval.
                Thread.Sleep(DriverStatusIntervalInMilliSecond);
                LOGGER.Log(Level.Info, "DriverStatus is {0}", status);

                try
                {
                    status = FetchDriverStatus();
                }
                catch (WebException e)
                {
                    // If we no longer can reach the Driver, it must have exited.
                    status = DriverStatus.UNKNOWN_EXITED;
                    LOGGER.Log(Level.Warning, "Driver unreacheable. Exiting now.", e);
                }
            }
        }
Exemplo n.º 2
0
        public void WaitForDriverToFinish()
        {
            DriverStatus status = FetchFirstDriverStatus();

            if (DriverStatus.UNKNOWN == status)
            {
                // We were unable to connect to the Driver at least once.
                throw new WebException("Unable to connect to the Driver.");
            }

            while (status.IsActive())
            {
                try
                {
                    status = FetchDriverStatus();
                }
                catch (WebException)
                {
                    // If we no longer can reach the Driver, it must have exited.
                    status = DriverStatus.UNKNOWN_EXITED;
                }
            }
        }