public void registerLocalResource()

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


	public void registerLocalResource(LocalResource resource) {
		TransactionStatus status = getTransactionStatus();
		if (status.compareTo(MARKED_ROLLBACK) > 0) {
			throw new IllegalStateException("The current transaction is in state " + status);
		}
		
		switch (localResourceSupport) {
			case ENFORCE_SINGLE:
				if(!resources.isEmpty()) {
					throw new TransactionException(
							"Only one local resource may be added. Adding multiple local resources increases the risk of inconsistency on failure.");
				}
			case ENABLED:
				resources.add(resource);
				break;
			case DISABLED:
				throw new TransactionException(
						"This Transaction Control Service does not support local resources");
			default :
				throw new IllegalArgumentException("Unknown local resources configuration option");
		}
	}