public void commitDtx(Xid xid, boolean onePhase) throws UnknownDtxBranchException, IncorrectDtxStateException, StoreException, RollbackOnlyDtxException, TimeoutDtxException { getAddressSpace().getDtxRegistry().commit(toDtxXid(xid), onePhase); }
public void forgetDtx(Xid xid) throws UnknownDtxBranchException, IncorrectDtxStateException { getAddressSpace().getDtxRegistry().forget(toDtxXid(xid)); }
public void setTimeout(Xid id, long timeout) throws UnknownDtxBranchException { DtxBranch branch = getBranch(id); if(branch != null) { branch.setTimeout(timeout); } else { throw new UnknownDtxBranchException(id); } }
DtxBranch branch = getBranch(id); if(branch != null) unregisterBranch(branch); throw new TimeoutDtxException(id); branch.rollback(); branch.setState(DtxBranch.State.FORGOTTEN); unregisterBranch(branch);
DtxBranch branch = _dtxRegistry.getBranch(id); if(_dtxRegistry.registerBranch(branch))
public DistributedTransaction(AMQPSession<?,?> session, DtxRegistry dtxRegistry) { _session = session; _dtxRegistry = dtxRegistry; _autoCommitTransaction = new AutoCommitTransaction(dtxRegistry.getMessageStore()); }
public List<Xid> recoverDtx() { List<Xid> xids = new ArrayList<>(); Iterator<org.apache.qpid.server.txn.Xid> dtxXids = getAddressSpace().getDtxRegistry().recover().iterator(); while(dtxXids.hasNext()) { org.apache.qpid.server.txn.Xid dtxXid = dtxXids.next(); xids.add(new Xid(dtxXid.getFormat(), dtxXid.getGlobalId(), dtxXid.getBranchId())); } return xids; }
public long getTimeoutDtx(Xid xid) throws UnknownDtxBranchException { return getAddressSpace().getDtxRegistry().getTimeout(toDtxXid(xid)); }
public void prepareDtx(Xid xid) throws UnknownDtxBranchException, IncorrectDtxStateException, StoreException, RollbackOnlyDtxException, TimeoutDtxException { getAddressSpace().getDtxRegistry().prepare(toDtxXid(xid)); }
private ListenableFuture<Void> onCloseOrDelete() { _dtxRegistry.close(); shutdownHouseKeeping(); if (_deleteRequested) { deleteLinkRegistry(); } closeMessageStore(); stopPreferenceTaskExecutor(); closePreferenceStore(); if (_deleteRequested) { deleteMessageStore(); deletePreferenceStore(); } closeNetworkConnectionScheduler(); _eventLogger.message(VirtualHostMessages.CLOSED(getName())); stopLogging(_virtualHostLoggersToClose); _systemNodeRegistry.close(); return Futures.immediateFuture(null); }
public AbstractVirtualHost(final Map<String, Object> attributes, VirtualHostNode<?> virtualHostNode) { super(virtualHostNode, attributes); _broker = (Broker<?>) virtualHostNode.getParent(); _virtualHostNode = virtualHostNode; _dtxRegistry = new DtxRegistry(this); final SystemConfig systemConfig = (SystemConfig) _broker.getParent(); _eventLogger = systemConfig.getEventLogger(); _eventLogger.message(VirtualHostMessages.CREATED(getName())); _principal = new VirtualHostPrincipal(this); if (systemConfig.isManagementMode()) { _accessControl = AccessControl.ALWAYS_ALLOWED; } else { _accessControl = new CompoundAccessControl( Collections.<AccessControl<?>>emptyList(), Result.DEFER ); } _defaultDestination = new DefaultDestination(this, _accessControl); _housekeepingJobContext = getSystemTaskControllerContext("Housekeeping["+getName()+"]", _principal); _fileSystemSpaceCheckerJobContext = getSystemTaskControllerContext("FileSystemSpaceChecker["+getName()+"]", _principal); _fileSystemSpaceChecker = new FileSystemSpaceChecker(); }
getAddressSpace().getDtxRegistry().endAssociations(_modelObject);
public void forget(Xid id) throws UnknownDtxBranchException, IncorrectDtxStateException { DtxBranch branch = getBranch(id); if(branch != null) { synchronized (branch) { if(!branch.hasAssociatedSessions()) { if(branch.getState() != DtxBranch.State.HEUR_COM && branch.getState() != DtxBranch.State.HEUR_RB) { throw new IncorrectDtxStateException("Branch should not be forgotten - " + "it is not heuristically complete", id); } branch.setState(DtxBranch.State.FORGOTTEN); unregisterBranch(branch); } else { throw new IncorrectDtxStateException("Branch was still associated with a session", id); } } } else { throw new UnknownDtxBranchException(id); } }
DtxBranch branch = dtxRegistry.getBranch(id); if(branch == null) dtxRegistry.registerBranch(branch);
public void prepare() throws StoreException { LOGGER.debug("Performing prepare for DtxBranch {}", _xid); Transaction txn = _dtxRegistry.getMessageStore().newTransaction(); _storedXidRecord = txn.recordXid(_xid.getFormat(), _xid.getGlobalId(), _xid.getBranchId(), _enqueueRecords.toArray(new EnqueueRecord[_enqueueRecords.size()]), _dequeueRecords.toArray(new DequeueRecord[_dequeueRecords.size()])); txn.commitTran(); prePrepareTransaction(); }
public synchronized void commit(Xid id, boolean onePhase) throws IncorrectDtxStateException, UnknownDtxBranchException, StoreException, RollbackOnlyDtxException, TimeoutDtxException DtxBranch branch = getBranch(id); if(branch != null) unregisterBranch(branch); throw new TimeoutDtxException(id); unregisterBranch(branch);
DtxBranch branch = dtxRegistry.getBranch(id); if (branch == null) dtxRegistry.registerBranch(branch);
public synchronized void rollback() throws StoreException { LOGGER.debug("Performing rollback for DtxBranch {}", _xid); if(_timeoutFuture != null) { LOGGER.debug("Attempting to cancel previous timeout task future for DtxBranch {}", _xid); boolean succeeded = _timeoutFuture.cancel(false); _timeoutFuture = null; LOGGER.debug("Cancelling previous timeout task {} for DtxBranch {}", (succeeded ? "succeeded" : "failed"), _xid); } if(_transaction != null) { // prepare has previously been called Transaction txn = _dtxRegistry.getMessageStore().newTransaction(); txn.removeXid(_storedXidRecord); txn.commitTran(); _transaction.abortTran(); } for(ServerTransaction.Action action : _postTransactionActions) { action.onRollback(); } _postTransactionActions.clear(); }
public long getTimeout(Xid id) throws UnknownDtxBranchException { DtxBranch branch = getBranch(id); if(branch != null) { return branch.getTimeout(); } else { throw new UnknownDtxBranchException(id); } }
IncorrectDtxStateException, StoreException, RollbackOnlyDtxException, TimeoutDtxException DtxBranch branch = getBranch(id); if(branch != null) unregisterBranch(branch); throw new TimeoutDtxException(id);