@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 } }
@Override 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 } }
@Override 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); } }
/** * {@inheritDoc} */ public void init() { try { ResourceRegistrar.register(this); } catch (RecoveryException ex) { throw new BitronixRuntimeException("error recovering " + this, ex); } }
@Override public void init() { try { ResourceRegistrar.register(this); } catch (RecoveryException ex) { throw new BitronixRuntimeException("error recovering " + this, ex); } }
private synchronized XAStatefulHolder getInPool() throws Exception { if (log.isDebugEnabled()) log.debug("getting a IN_POOL connection from " + this); if (inPoolSize() == 0) { if (log.isDebugEnabled()) log.debug("no more free connection in " + this + ", trying to grow it"); grow(); } waitForConnectionInPool(); for (XAStatefulHolder xaStatefulHolder : objects) { if (xaStatefulHolder.getState() == XAStatefulHolder.STATE_IN_POOL) return xaStatefulHolder; } throw new BitronixRuntimeException("pool does not contain IN_POOL connection while it should !"); }
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); } }
private synchronized XAStatefulHolder getInPool() throws Exception { if (log.isDebugEnabled()) log.debug("getting a IN_POOL connection from " + this); if (inPoolSize() == 0) { if (log.isDebugEnabled()) log.debug("no more free connection in " + this + ", trying to grow it"); grow(); } waitForConnectionInPool(); for (XAStatefulHolder xaStatefulHolder : objects) { if (xaStatefulHolder.getState() == XAStatefulHolder.STATE_IN_POOL) return xaStatefulHolder; } throw new BitronixRuntimeException("pool does not contain IN_POOL connection while it should !"); }
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); } }
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); } }
private void reinitializePool() { try { if (log.isDebugEnabled()) { log.debug("resource '" + bean.getUniqueName() + "' is marked as failed, resetting and recovering it before trying connection acquisition"); } close(); init(); IncrementalRecoverer.recover(xaResourceProducer); } catch (RecoveryException ex) { throw new BitronixRuntimeException("incremental recovery failed when trying to acquire a connection from failed resource '" + bean.getUniqueName() + "'", ex); } catch (Exception ex) { throw new BitronixRuntimeException("pool reset failed when trying to acquire a connection from failed resource '" + bean.getUniqueName() + "'", ex); } }
private void reinitializePool() { try { if (log.isDebugEnabled()) { log.debug("resource '" + bean.getUniqueName() + "' is marked as failed, resetting and recovering it before trying connection acquisition"); } close(); init(); IncrementalRecoverer.recover(xaResourceProducer); } catch (RecoveryException ex) { throw new BitronixRuntimeException("incremental recovery failed when trying to acquire a connection from failed resource '" + bean.getUniqueName() + "'", ex); } catch (Exception ex) { throw new BitronixRuntimeException("pool reset failed when trying to acquire a connection from failed resource '" + bean.getUniqueName() + "'", ex); } }