@Override public boolean waitUntilStarted(int timeout) throws InterruptedException { return startLatch.await(timeout, TimeUnit.MILLISECONDS); }
public void awaitTermination() throws InterruptedException { this.messageProcessedLatch.await(); } }
public void doExecute(WorkerContext work, Executor executor) throws WorkException, InterruptedException { Latch latch = work.provideStartLatch(); executor.execute(work); latch.await(); }
@Override public void messageProcessingEnded() { try { this.suspendLatch.await(); } catch (InterruptedException e) { Thread.interrupted(); } this.continuation.resume(); } }
public void run() { try { startLatch.await(); } catch (InterruptedException e) { logger.warn("Retry thread interupted for callback: " + callback.getWorkDescription()); return; } try { context.setDelegateContext(delegate.execute(callback, workManager)); } catch (Exception e) { this.exception = e; logger.fatal(e, e); } }
@Override public MuleEvent beforeRouteEvent(MuleEvent muleEvent) throws MuleException { try { long timeout = ((HttpsConnector) getConnector()).getSslHandshakeTimeout(); boolean handshakeComplete = getHttpServerConnection().getSslSocketHandshakeCompleteLatch().await(timeout, TimeUnit.MILLISECONDS); if (!handshakeComplete) { throw new MessagingException(HttpMessages.sslHandshakeDidNotComplete(), muleEvent); } } catch (InterruptedException e) { throw new MessagingException(HttpMessages.sslHandshakeDidNotComplete(), muleEvent, e); } if (getHttpServerConnection().getPeerCertificateChain() != null) { muleEvent.getMessage().setOutboundProperty(HttpsConnector.PEER_CERTIFICATES, getHttpServerConnection().getPeerCertificateChain()); } if (getHttpServerConnection().getLocalCertificateChain() != null) { muleEvent.getMessage().setOutboundProperty(HttpsConnector.LOCAL_CERTIFICATES, getHttpServerConnection().getLocalCertificateChain()); } super.beforeRouteEvent(muleEvent); return muleEvent; } }