@Override public void init() { try { ResourceRegistrar.register(this); } catch (RecoveryException ex) { throw new BitronixRuntimeException("error recovering " + this, ex); } }
public void waitFor(Object future, long timeout) { Future<?> f = (Future<?>) future; try { f.get(timeout, TimeUnit.MILLISECONDS); } catch (InterruptedException ex) { throw new BitronixRuntimeException("job interrupted", ex); } catch (ExecutionException ex) { throw new BitronixRuntimeException("job execution exception", ex); } catch (TimeoutException ex) { // ok, just return } }
public void waitFor(Object future, long timeout) { Future<?> f = (Future<?>) future; try { f.get(timeout, TimeUnit.MILLISECONDS); } catch (InterruptedException ex) { throw new BitronixRuntimeException("job interrupted", ex); } catch (ExecutionException ex) { throw new BitronixRuntimeException("job execution exception", ex); } catch (TimeoutException ex) { // ok, just return } }
/** * {@inheritDoc} */ @Override public void init() { try { ResourceRegistrar.register(this); } catch (RecoveryException ex) { throw new BitronixRuntimeException("error recovering " + this, ex); } }
/** * {@inheritDoc} */ public void init() { try { ResourceRegistrar.register(this); } catch (RecoveryException ex) { throw new BitronixRuntimeException("error recovering " + this, ex); } }
/** * {@inheritDoc} */ @Override public void init() { try { ResourceRegistrar.register(this); } catch (RecoveryException ex) { throw new BitronixRuntimeException("error recovering " + this, ex); } }
public Object getResource(Object key) { try { if (key == null) throw new NullPointerException("key cannot be null"); if (currentTransaction() == null || currentTransaction().getStatus() == Status.STATUS_NO_TRANSACTION) throw new IllegalStateException("no transaction started on current thread"); return getResources().get(key); } catch (SystemException ex) { throw new BitronixRuntimeException("cannot get current transaction status", ex); } }
@Override public Object getResource(Object key) { try { if (key == null) throw new NullPointerException("key cannot be null"); if (currentTransaction() == null || currentTransaction().getStatus() == Status.STATUS_NO_TRANSACTION) throw new IllegalStateException("no transaction started on current thread"); return getResources().get(key); } catch (SystemException ex) { throw new BitronixRuntimeException("cannot get current transaction status", ex); } }
public void putResource(Object key, Object value) { try { if (key == null) throw new NullPointerException("key cannot be null"); if (currentTransaction() == null || currentTransaction().getStatus() == Status.STATUS_NO_TRANSACTION) throw new IllegalStateException("no transaction started on current thread"); getResources().put(key, value); } catch (SystemException ex) { throw new BitronixRuntimeException("cannot get current transaction status", ex); } }
public void putResource(Object key, Object value) { try { if (key == null) throw new NullPointerException("key cannot be null"); if (currentTransaction() == null || currentTransaction().getStatus() == Status.STATUS_NO_TRANSACTION) throw new IllegalStateException("no transaction started on current thread"); getResources().put(key, value); } catch (SystemException ex) { throw new BitronixRuntimeException("cannot get current transaction status", ex); } }
@Override public Object getResource(Object key) { try { if (key == null) throw new NullPointerException("key cannot be null"); if (currentTransaction() == null || currentTransaction().getStatus() == Status.STATUS_NO_TRANSACTION) throw new IllegalStateException("no transaction started on current thread"); return getResources().get(key); } catch (SystemException ex) { throw new BitronixRuntimeException("cannot get current transaction status", ex); } }
@Override public int getTransactionStatus() { try { if (currentTransaction() == null) return Status.STATUS_NO_TRANSACTION; return currentTransaction().getStatus(); } catch (SystemException ex) { throw new BitronixRuntimeException("cannot get current transaction status", ex); } }
@Override public int getTransactionStatus() { try { if (currentTransaction() == null) return Status.STATUS_NO_TRANSACTION; return currentTransaction().getStatus(); } catch (SystemException ex) { throw new BitronixRuntimeException("cannot get current transaction status", ex); } }
public boolean getRollbackOnly() { try { if (currentTransaction() == null || currentTransaction().getStatus() == Status.STATUS_NO_TRANSACTION) throw new IllegalStateException("no transaction started on current thread"); return currentTransaction().getStatus() == Status.STATUS_MARKED_ROLLBACK; } catch (SystemException e) { throw new BitronixRuntimeException("cannot get current transaction status"); } }
@Override public boolean getRollbackOnly() { try { if (currentTransaction() == null || currentTransaction().getStatus() == Status.STATUS_NO_TRANSACTION) throw new IllegalStateException("no transaction started on current thread"); return currentTransaction().getStatus() == Status.STATUS_MARKED_ROLLBACK; } catch (SystemException e) { throw new BitronixRuntimeException("cannot get current transaction status"); } }
public boolean getRollbackOnly() { try { if (currentTransaction() == null || currentTransaction().getStatus() == Status.STATUS_NO_TRANSACTION) throw new IllegalStateException("no transaction started on current thread"); return currentTransaction().getStatus() == Status.STATUS_MARKED_ROLLBACK; } catch (SystemException e) { throw new BitronixRuntimeException("cannot get current transaction status"); } }
@Override public void setRollbackOnly() { try { if (currentTransaction() == null || currentTransaction().getStatus() == Status.STATUS_NO_TRANSACTION) throw new IllegalStateException("no transaction started on current thread"); currentTransaction().setStatus(Status.STATUS_MARKED_ROLLBACK); } catch (SystemException ex) { throw new BitronixRuntimeException("cannot get or set current transaction status", ex); } }
public Object getTransactionKey() { try { if (currentTransaction() == null || currentTransaction().getStatus() == Status.STATUS_NO_TRANSACTION) return null; return currentTransaction().getGtrid(); } catch (SystemException ex) { throw new BitronixRuntimeException("cannot get current transaction status", ex); } }
@Override public Object getTransactionKey() { try { if (currentTransaction() == null || currentTransaction().getStatus() == Status.STATUS_NO_TRANSACTION) return null; return currentTransaction().getGtrid(); } catch (SystemException ex) { throw new BitronixRuntimeException("cannot get current transaction status", ex); } }
public Object getTransactionKey() { try { if (currentTransaction() == null || currentTransaction().getStatus() == Status.STATUS_NO_TRANSACTION) return null; return currentTransaction().getGtrid(); } catch (SystemException ex) { throw new BitronixRuntimeException("cannot get current transaction status", ex); } }