Examples of await()


Examples of org.apache.mina.core.future.IoFuture.await()

        Iterator<? extends IoFuture> i = futures.iterator();
        while (i.hasNext()) {
            IoFuture f = i.next();
            do {
                if (interruptable) {
                    lastComplete = f.await(waitTime);
                } else {
                    lastComplete = f.awaitUninterruptibly(waitTime);
                }
               
                waitTime = timeoutMillis - (System.currentTimeMillis() - startTime);
View Full Code Here

Examples of org.apache.mina.core.future.WriteFuture.await()

  }
    }
   
    private static void send(IoSession session, Object object) throws InterruptedException, IOException {
  WriteFuture writeFuture = session.write(object);
  writeFuture.await(TIMEOUT);
  if (!writeFuture.isWritten()) {
      Throwable exception = writeFuture.getException();
      if(exception!=null){
    throw new IOException("Error occured while writing!", exception);
      }
View Full Code Here

Examples of org.apache.openejb.util.OutputScanner.await()

            process = builder.start();

            if (timeout > 0) {
                final OutputScanner scanner = new OutputScanner(out, "Ready!");
                Pipe.pipe(process.getInputStream(), scanner);
                scanner.await(timeout, minutes);
            } else {
                out = System.out;
                Pipe.pipe(process.getInputStream(), out);
            }
        } catch (final InterruptedException e) {
View Full Code Here

Examples of org.apache.qpid.client.state.StateWaiter.await()

        StateWaiter waiter = _conn.getProtocolHandler().createWaiter(openOrClosedStates);
        _conn.getProtocolHandler().getProtocolSession().init(settings);
        // this blocks until the connection has been set up or when an error
        // has prevented the connection being set up

        AMQState state = waiter.await();

        if(state == AMQState.CONNECTION_OPEN)
        {
            _conn.getFailoverPolicy().attainedConnection();
            _conn.setConnected(true);
View Full Code Here

Examples of org.apache.qpid.test.utils.Piper.await()

            LOGGER.debug("Backup command is " + pb.command());
            backupProcess = pb.start();
            Piper piper = new Piper(backupProcess.getInputStream(), _testcaseOutputStream, null, BACKUP_COMPLETE_MESSAGE);
            piper.start();
            piper.await(2, TimeUnit.SECONDS);
            backupProcess.waitFor();
            piper.join();

            LOGGER.debug("Backup command completed " + backupProcess.exitValue());
            assertEquals("Unexpected exit value from backup script", 0, backupProcess.exitValue());
View Full Code Here

Examples of org.apache.qpid.transport.util.Waiter.await()

            send(new ProtocolHeader(1, 0, 10));

            Waiter w = new Waiter(lock, timeout);
            while (w.hasTime() && state == OPENING && error == null)
            {
                w.await();
            }

            if (error != null)
            {
                ConnectionException t = error;
View Full Code Here

Examples of org.apache.sshd.client.future.AuthFuture.await()

            } else {
                log.debug("Attempting to authenticate username '{}' using Password...", getUsername());
                authResult = session.authPassword(getUsername(), getPassword());
            }
   
            authResult.await(getTimeout());
   
            if (!authResult.isDone() || authResult.isFailure()) {
                log.debug("Failed to authenticate");
                throw new RuntimeCamelException("Failed to authenticate username " + getUsername());
            }
View Full Code Here

Examples of org.apache.sshd.client.future.ConnectFuture.await()

        }

        ConnectFuture connectFuture = client.connect(null, getHost(), getPort());

        // Wait getTimeout milliseconds for connect operation to complete
        connectFuture.await(getTimeout());

        if (!connectFuture.isDone() || !connectFuture.isConnected()) {
            final String msg = "Failed to connect to " + getHost() + ":" + getPort() + " within timeout " + getTimeout() + "ms";
            log.debug(msg);
            throw new RuntimeCamelException(msg);
View Full Code Here

Examples of org.apache.sshd.client.future.OpenFuture.await()

            channel.setOut(out);
   
            ByteArrayOutputStream err = new ByteArrayOutputStream();
            channel.setErr(err);
            OpenFuture openFuture = channel.open();
            openFuture.await(getTimeout());
            if (openFuture.isOpened()) {
                channel.waitFor(ClientChannel.CLOSED, 0);
                result = new SshResult(command, channel.getExitStatus(),
                        new ByteArrayInputStream(out.toByteArray()),
                        new ByteArrayInputStream(err.toByteArray()));
View Full Code Here

Examples of org.apache.sshd.common.future.CloseFuture.await()

        ClientSession session = client.connect("localhost", port).await().getSession();
        AuthFuture authFuture = session.authPassword("smx", "smx");
        CloseFuture closeFuture = session.close(false);
        authLatch.countDown();
        authFuture.await();
        closeFuture.await();
        assertNotNull(authFuture.getException());
        assertTrue(closeFuture.isClosed());
    }

    @Test
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.