Source:
public Boolean call() { log.debug("Events postcommit execution starting in thread: {}", Thread.currentThread().getName()); SequenceTracer.startFrom(callerThread, "Postcommit", "#ff410f"); long t0 = System.currentTimeMillis(); EventStats stats = Framework.getService(EventStats.class); for (EventListenerDescriptor listener : listeners) { EventBundle filtered = listener.filterBundle(bundle); if (filtered.isEmpty()) { continue; } log.debug("Events postcommit execution start for listener: {}", listener.getName()); SequenceTracer.start("run listener " + listener.getName()); long t1 = System.currentTimeMillis(); boolean ok = false; ReconnectedEventBundle reconnected = null; boolean tx = TransactionHelper.startTransaction(); try { reconnected = new ReconnectedEventBundleImpl(filtered, listeners.toString()); listener.asPostCommitListener().handleEvent(reconnected); ok = true; } catch (RuntimeException e) { log.error("Events postcommit execution encountered exception for listener: {}", listener.getName(), e); } finally { try { if (reconnected != null) { reconnected.disconnect(); } } finally { if (tx) { if (!ok) { TransactionHelper.setTransactionRollbackOnly(); log.error("Rolling back transaction"); } TransactionHelper.commitOrRollbackTransaction(); } long elapsed = System.currentTimeMillis() - t1; if (stats != null) { stats.logAsyncExec(listener, elapsed); } log.debug("Events postcommit execution end for listener: in {}ms", listener.getName(), elapsed); SequenceTracer.stop("listener done " + elapsed + " ms"); } } } long elapsed = System.currentTimeMillis() - t0; log.debug("Events postcommit execution finished in {}ms", elapsed); SequenceTracer.stop("postcommit done" + elapsed + " ms"); return Boolean.TRUE; }

Target:
public Boolean call() { log.debug("Events postcommit execution starting in thread: {}", () -> Thread.currentThread().getName()); SequenceTracer.startFrom(callerThread, "Postcommit", "#ff410f"); long t0 = System.currentTimeMillis(); EventStats stats = Framework.getService(EventStats.class); for (EventListenerDescriptor listener : listeners) { EventBundle filtered = listener.filterBundle(bundle); if (filtered.isEmpty()) { continue; } log.debug("Events postcommit execution start for listener: {}", listener::getName); SequenceTracer.start("run listener " + listener.getName()); long t1 = System.currentTimeMillis(); boolean ok = false; ReconnectedEventBundle reconnected = null; boolean tx = TransactionHelper.startTransaction(); try { reconnected = new ReconnectedEventBundleImpl(filtered, listeners.toString()); listener.asPostCommitListener().handleEvent(reconnected); ok = true; } catch (RuntimeException e) { log.error("Events postcommit execution encountered exception for listener: {}", listener::getName, () -> e); } finally { try { if (reconnected != null) { reconnected.disconnect(); } } finally { if (tx) { if (!ok) { TransactionHelper.setTransactionRollbackOnly(); log.error("Rolling back transaction"); } TransactionHelper.commitOrRollbackTransaction(); } long elapsed = System.currentTimeMillis() - t1; if (stats != null) { stats.logAsyncExec(listener, elapsed); } log.debug("Events postcommit execution end for listener: in {}ms", listener::getName, () -> elapsed); SequenceTracer.stop("listener done " + elapsed + " ms"); } } } long elapsed = System.currentTimeMillis() - t0; log.debug("Events postcommit execution finished in {}ms", elapsed); SequenceTracer.stop("postcommit done" + elapsed + " ms"); return Boolean.TRUE; }