public void registerXAResource()

in tx-control-services/tx-control-service-xa/src/main/java/org/apache/aries/tx/control/service/xa/impl/TransactionContextImpl.java [220:236]


	public void registerXAResource(XAResource resource, String name) {
		TransactionStatus status = getTransactionStatus();
		if (status.compareTo(MARKED_ROLLBACK) > 0) {
			throw new IllegalStateException("The current transaction is in state " + status);
		}
		try {
			if(name == null) {
				currentTransaction.enlistResource(resource);
			} else {
				NamedXAResourceImpl res = new NamedXAResourceImpl(name, resource, transactionManager, true);
				postCompletion(x -> res.close());
				currentTransaction.enlistResource(res);
			}
		} catch (Exception e) {
			throw new TransactionException("The transaction was unable to enlist a resource", e);
		}
	}