/** * Throws a {@link UserException} if a transaction is active. The thrown * exception will contain all the Brokers with active transactions as * failed objects in the nested exceptions. */ private void assertNoActiveTransaction() { Collection excs; if (_transactional.isEmpty()) return; excs = new ArrayList(_transactional.size()); for (Iterator trans = _transactional.values().iterator(); trans.hasNext();) { Collection brokers = (Collection) trans.next(); for (Iterator itr = brokers.iterator(); itr.hasNext();) { excs.add(new InvalidStateException(_loc.get("active")). setFailedObject(itr.next())); } } if (!excs.isEmpty()) throw new InvalidStateException(_loc.get("nested-exceps")). setNestedThrowables((Throwable[]) excs.toArray (new Throwable[excs.size()])); }
/** * Throws a {@link UserException} if a transaction is active. The thrown * exception will contain all the Brokers with active transactions as * failed objects in the nested exceptions. */ private void assertNoActiveTransaction() { Collection<Throwable> excs; if (_transactional.isEmpty()) return; excs = new ArrayList<Throwable>(_transactional.size()); for (Collection<Broker> brokers : _transactional.values()) { for (Broker broker : brokers) { excs.add(new InvalidStateException(_loc.get("active")).setFailedObject(broker)); } } if (!excs.isEmpty()) throw new InvalidStateException(_loc.get("nested-exceps")). setNestedThrowables((Throwable[]) excs.toArray(new Throwable[excs.size()])); }
/** * Throws a {@link UserException} if a transaction is active. The thrown * exception will contain all the Brokers with active transactions as * failed objects in the nested exceptions. */ private void assertNoActiveTransaction() { Collection<Throwable> excs; if (_transactional.isEmpty()) return; excs = new ArrayList<Throwable>(_transactional.size()); for (Collection<Broker> brokers : _transactional.values()) { for (Broker broker : brokers) { excs.add(new InvalidStateException(_loc.get("active")).setFailedObject(broker)); } } if (!excs.isEmpty()) throw new InvalidStateException(_loc.get("nested-exceps")). setNestedThrowables((Throwable[]) excs.toArray(new Throwable[excs.size()])); }
/** * Throws a {@link UserException} if a transaction is active. The thrown * exception will contain all the Brokers with active transactions as * failed objects in the nested exceptions. */ private void assertNoActiveTransaction() { Collection<Throwable> excs; if (_transactional.isEmpty()) return; excs = new ArrayList<Throwable>(_transactional.size()); for (Collection<Broker> brokers : _transactional.values()) { for (Broker broker : brokers) { excs.add(new InvalidStateException(_loc.get("active")).setFailedObject(broker)); } } if (!excs.isEmpty()) throw new InvalidStateException(_loc.get("nested-exceps")). setNestedThrowables((Throwable[]) excs.toArray(new Throwable[excs.size()])); }
/** * Throws a {@link UserException} if a transaction is active. The thrown * exception will contain all the Brokers with active transactions as * failed objects in the nested exceptions. */ private void assertNoActiveTransaction() { Collection<Throwable> excs; if (_transactional.isEmpty()) return; excs = new ArrayList<Throwable>(_transactional.size()); for (Collection<Broker> brokers : _transactional.values()) { for (Broker broker : brokers) { excs.add(new InvalidStateException(_loc.get("active")).setFailedObject(broker)); } } if (!excs.isEmpty()) throw new InvalidStateException(_loc.get("nested-exceps")). setNestedThrowables((Throwable[]) excs.toArray(new Throwable[excs.size()])); }