@Override public void messageProcessingEnded() { messageProcessedLatch.release(); }
public void awaitTermination() throws InterruptedException { this.messageProcessedLatch.await(); } }
/** * Creates the lock used to synchronize a given event * @return a new Latch instance */ protected Latch createEventLock() { return new Latch(); }
public RetryWorker(RetryPolicyTemplate delegate, RetryCallback callback, WorkManager workManager, Latch startLatch) { this.callback = callback; this.workManager = workManager; this.delegate = delegate; this.startLatch = startLatch; if (this.startLatch == null) { this.startLatch = new Latch(); this.startLatch.countDown(); } }
private void countDown() { latch.countDown(); }
public void whenNotEqual(boolean condition, Runnable action) throws InterruptedException { this.whenEqual(!condition, action); }
protected String getThreadPoolName(String stageName, MuleContext muleContext) { return ThreadNameHelper.flow(muleContext, stageName); }
public int compareTo(Object other) { return this.compareTo((WaitableBoolean) other); }
public void whenFalse(Runnable action) throws InterruptedException { this.whenNotEqual(true, action); }
public void release() { running.set(false); }
public int hashCode() { return (this.get() ? 3412688 : 8319343); // entirely arbitrary }
public void onTransition(String phaseName, SedaStageInterceptingMessageProcessor object) throws MuleException { try { running.whenFalse(null); } catch (InterruptedException e) { // we can ignore this } SedaStageInterceptingMessageProcessor.super.stop(); } });
public Thread newThread(Runnable runnable) { Thread t = new Thread(runnable); configureThread(t); return t; }
protected void configureThread(Thread t) { if (contextClassLoader != null) { t.setContextClassLoader(contextClassLoader); } doConfigureThread(t); }
@Override public boolean waitUntilStarted(int timeout) throws InterruptedException { return startLatch.await(timeout, TimeUnit.MILLISECONDS); }
public void release() { countDown(); }
public JettyContinuationsMessageProcessTemplate(HttpServletRequest request, HttpServletResponse response, AbstractMessageReceiver messageReceiver, MuleContext muleContext, Continuation continuation) { super(request, response, messageReceiver, muleContext); this.continuation = continuation; this.suspendLatch = new Latch(); }
public void whenTrue(Runnable action) throws InterruptedException { this.whenEqual(true, action); }
public void suspended() { this.suspendLatch.countDown(); }