public void afterCompletion(int status) { if (status == Status.STATUS_COMMITTED) { if (log.isDebugEnabled()) log.debug("sending '" + event + "' notification"); Semaphore eventSemaphore = getEventSemaphore(event); eventSemaphore.release(); } } };
public void afterCompletion(int status) { if (status == Status.STATUS_COMMITTED) { if (log.isDebugEnabled()) log.debug("sending '" + event + "' notification"); Semaphore eventSemaphore = getEventSemaphore(event); eventSemaphore.release(); } } };
public static void waitForEvent(int occurrences, String event, long timeout) { boolean debug = log.isDebugEnabled(); if (debug) log.debug("waiting for " + event); Semaphore eventSemaphore = getEventSemaphore(event); try { if (!eventSemaphore.tryAcquire(occurrences, timeout)) { throw new JbpmException("event '" + event + "' did not occur within " + timeout + " ms"); } if (debug) log.debug("received '" + event + "' notification"); } catch (InterruptedException e) { throw new JbpmException("wait for event '" + event + "' was interrupted", e); } }
public static void waitForEvent(int occurrences, String event, long timeout) { boolean debug = log.isDebugEnabled(); if (debug) log.debug("waiting for " + event); Semaphore eventSemaphore = getEventSemaphore(event); try { if (!eventSemaphore.tryAcquire(occurrences, timeout)) { throw new JbpmException("event '" + event + "' did not occur within " + timeout + " ms"); } if (debug) log.debug("received '" + event + "' notification"); } catch (InterruptedException e) { throw new JbpmException("wait for event '" + event + "' was interrupted", e); } }