public synchronized int incrementActiveThreadCount(final ActiveProcessSessionFactory sessionFactory) { if (terminated) { throw new TerminatedTaskException(); } if (sessionFactory != null) { activeProcessSessionFactories.add(sessionFactory); } return activeThreadCount.incrementAndGet(); }
private void verifyNotTerminated() { if (taskTermination.isTerminated()) { throw new TerminatedTaskException(); } }
@Override public synchronized ProcessSession createSession() { if (terminated) { throw new TerminatedTaskException(); } final ProcessSession session = delegate.createSession(); sessionMap.put(session, Boolean.TRUE); return session; }
private void verifyTaskActive() { if (taskTermination.isTerminated()) { throw new TerminatedTaskException(); } }
private void verifyNotTerminated() { if (taskTermination.isTerminated()) { final TerminatedTaskException tte = new TerminatedTaskException(); if (terminatedCallback != null) { try { terminatedCallback.run(); } catch (final Exception e) { tte.addSuppressed(e); } } throw tte; } }
private void verifyNotTerminated() { if (taskTermination.isTerminated()) { final TerminatedTaskException tte = new TerminatedTaskException(); if (terminatedCallback != null) { try { terminatedCallback.run(); } catch (final Exception e) { tte.addSuppressed(e); } } throw tte; } }
private void verifyTaskActive() { if (taskTermination.isTerminated()) { rollback(false, true); throw new TerminatedTaskException(); } }
@Override public void close() throws IOException { try { delegate.close(); } catch (final Exception e) { if (taskTermination.isTerminated()) { final TerminatedTaskException tte = new TerminatedTaskException(); tte.addSuppressed(e); if (terminatedCallback != null) { try { terminatedCallback.run(); } catch (final Exception callbackException) { tte.addSuppressed(callbackException); } } throw tte; } } verifyNotTerminated(); }
@Override public void close() throws IOException { try { delegate.close(); } catch (final Exception e) { if (taskTermination.isTerminated()) { final TerminatedTaskException tte = new TerminatedTaskException(); tte.addSuppressed(e); if (terminatedCallback != null) { try { terminatedCallback.run(); } catch (final Exception callbackException) { tte.addSuppressed(callbackException); } } throw tte; } } verifyNotTerminated(); } }
public synchronized int incrementActiveThreadCount(final ActiveProcessSessionFactory sessionFactory) { if (terminated) { throw new TerminatedTaskException(); } if (sessionFactory != null) { activeProcessSessionFactories.add(sessionFactory); } return activeThreadCount.incrementAndGet(); }