tx-control/tx-control-api/src/main/java/org/osgi/service/transaction/control/TransactionBuilder.java
@SafeVarargs
	public final TransactionBuilder rollbackFor(Class< ? extends Throwable> t,
			Class< ? extends Throwable>... throwables) {
		Objects.requireNonNull(t,
				"The supplied exception types must be non Null");
		for (Class< ? extends Throwable> t2 : throwables) {
			Objects.requireNonNull(t2,
					"The supplied exception types must be non-null");
		}
		rollbackFor.clear();
		rollbackFor.add(t);
		rollbackFor.addAll(Arrays.asList(throwables));
		return this;
	}
/**
	 * Declare a list of Exception types (and their subtypes) that <em>must</em>
	 * trigger a rollback. By default the transaction will rollback for all
	 * {@link Exception}s. If a more specific type is registered using
	 * {@link #noRollbackFor(Class, Class...)} then that type will not trigger
	 * rollback. If the same type is registered using both
	 * {@link #rollbackFor(Class, Class...)} and
	 * {@link #noRollbackFor(Class, Class...)} then the transaction
	 * <em>will not</em> begin and will instead throw a
	 * {@link TransactionException}
	 * <p>
	 * Note that the behaviour of this method differs from Java EE and Spring in
	 * two ways:
	 * <ul>
	 * <li>In Java EE and Spring transaction management checked exceptions are
	 * considered "normal returns" and do not trigger rollback. Using an
	 * Exception as a normal return value is considered a <em>bad</em> design
	 * practice. In addition this means that checked Exceptions such as
	 * java.sql.SQLException do not trigger rollback by default. This, in turn,
	 * leads to implementation mistakes that break the transactional behaviour
	 * of applications.</li>
	 * <li>In Java EE it is legal to specify the same Exception type in
	 * {@link #rollbackFor} and {@link #noRollbackFor}. Stating that the same
	 * Exception should both trigger <em>and</em> not trigger rollback is a
	 * logical impossibility, and clearly indicates an API usage error. This API
	 * therefore enforces usage by triggering an exception in this invalid case.
	 * </li>
	 * </ul>
	 * 
	 * @param t
	 * @param throwables The Exception types that should trigger rollback
	 * @return this builder
	 */
Declare a list of Exception types (and their subtypes) that must
trigger a rollback. By default the transaction will rollback for all
Exceptions. If a more specific type is registered using
#noRollbackFor(Class, Class...) then that type will not trigger
rollback. If the same type is registered using both
#rollbackFor(Class, Class...) and
#noRollbackFor(Class, Class...) then the transaction
will not begin and will instead throw a
TransactionException

Note that the behaviour of this method differs from Java EE and Spring in
two ways:

In Java EE and Spring transaction management checked exceptions are
considered "normal returns" and do not trigger rollback. Using an
Exception as a normal return value is considered a bad design
practice. In addition this means that checked Exceptions such as
java.sql.SQLException do not trigger rollback by default. This, in turn,
leads to implementation mistakes that break the transactional behaviour
of applications.
In Java EE it is legal to specify the same Exception type in
#rollbackFor and  #noRollbackFor. Stating that the same
Exception should both trigger and not trigger rollback is a
logical impossibility, and clearly indicates an API usage error. This API
therefore enforces usage by triggering an exception in this invalid case.

@param t
@param throwables The Exception types that should trigger rollback
@return this builder
Declare a list of Exception types ( and their subtypes ) that must trigger a rollback . By default the transaction will rollback for all Exceptions . If a more specific type is registered using #noRollbackFor ( Class Class ... ) then that type will not trigger rollback . If the same type is registered using both #rollbackFor ( Class Class ... ) and #noRollbackFor ( Class Class ... ) then the transaction will not begin and will instead throw a TransactionException Note that the behaviour of this method differs from Java EE and Spring in two ways : In Java EE and Spring transaction management checked exceptions are considered " normal returns " and do not trigger rollback . Using an Exception as a normal return value is considered a bad design practice . In addition this means that checked Exceptions such as java . sql . SQLException do not trigger rollback by default . This in turn leads to implementation mistakes that break the transactional behaviour of applications . In Java EE it is legal to specify the same Exception type in #rollbackFor and #noRollbackFor . Stating that the same Exception should both trigger and not trigger rollback is a logical impossibility and clearly indicates an API usage error . This API therefore enforces usage by triggering an exception in this invalid case . @param t @param throwables The Exception types that should trigger rollback @return this builder
@SafeVarargs
	public final TransactionBuilder rollbackFor(Class< ? extends Throwable> t,
			Class< ? extends Throwable>... throwables) {
		Objects.requireNonNull(t,
				"The supplied exception types must be non Null");
		for (Class< ? extends Throwable> t2 : throwables) {
			Objects.requireNonNull(t2,
					"The supplied exception types must be non-null");
		}
		rollbackFor.clear();
		rollbackFor.add(t);
		rollbackFor.addAll(Arrays.asList(throwables));
		return this;
	}
@ SafeVarargs public final TransactionBuilder rollbackFor ( Class < ? extends Throwable > t , Class < ? extends Throwable > ... throwables ) { Objects . requireNonNull ( t , "The supplied exception types must be non Null" ) ; for ( Class < ? extends Throwable > t2 : throwables ) { Objects . requireNonNull ( t2 , "The supplied exception types must be non-null" ) ; } rollbackFor . clear ( ) ; rollbackFor . add ( t ) ; rollbackFor . addAll ( Arrays . asList ( throwables ) ) ; return this ; }
Declare a list of Exception types (and their subtypes) that <em>must</em>
 trigger a rollback.
Declare a list of Exception types ( and their subtypes ) that <em > must< / em > trigger a rollback .