@Test(expected = ExecutionException.class) public void testAdaptedReadWriteTransactionCannotCancel() throws Exception { managedNewTransactionRunner.callWithNewReadWriteTransactionAndSubmit(OPERATIONAL, tx -> TransactionAdapter.toReadWriteTransaction(tx).cancel()).get(); }
public static ReadWriteTransaction toReadWriteTransaction( final TypedReadWriteTransaction<? extends Datastore> datastoreTx) { if (datastoreTx instanceof TypedReadWriteTransactionImpl) { final TypedReadWriteTransactionImpl<?> txImpl = (TypedReadWriteTransactionImpl<?>) datastoreTx; return new ReadWriteTransactionAdapter<>(txImpl.getDatastoreType(), txImpl); } throw new IllegalArgumentException("Unsupported TypedWriteTransaction implementation " + datastoreTx.getClass()); }
TransactionAdapter { public static ReadWriteTransaction toReadWriteTransaction( final TypedReadWriteTransaction<? extends Datastore> datastoreTx) { if (datastoreTx instanceof TypedReadWriteTransactionImpl) { final TypedReadWriteTransactionImpl<?> txImpl = (TypedReadWriteTransactionImpl<?>) datastoreTx; return new ReadWriteTransactionAdapter<>(txImpl.getDatastoreType(), txImpl); } throw new IllegalArgumentException("Unsupported TypedWriteTransaction implementation " + datastoreTx.getClass()); } }
TransactionAdapter { public static ReadWriteTransaction toReadWriteTransaction( final TypedReadWriteTransaction<? extends Datastore> datastoreTx) { if (datastoreTx instanceof TypedReadWriteTransactionImpl) { final TypedReadWriteTransactionImpl<?> txImpl = (TypedReadWriteTransactionImpl<?>) datastoreTx; return new ReadWriteTransactionAdapter<>(txImpl.getDatastoreType(), txImpl); } throw new IllegalArgumentException("Unsupported TypedWriteTransaction implementation " + datastoreTx.getClass()); } private  TransactionAdapter(); }
TransactionAdapter { public static ReadWriteTransaction toReadWriteTransaction( final TypedReadWriteTransaction<? extends Datastore> datastoreTx) { if (datastoreTx instanceof TypedReadWriteTransactionImpl) { final TypedReadWriteTransactionImpl<?> txImpl = (TypedReadWriteTransactionImpl<?>) datastoreTx; return new ReadWriteTransactionAdapter<>(txImpl.getDatastoreType(), txImpl); } throw new IllegalArgumentException("Unsupported TypedWriteTransaction implementation " + datastoreTx.getClass()); } private  TransactionAdapter(); static ReadWriteTransaction toReadWriteTransaction(
            final TypedReadWriteTransaction<? extends Datastore> datastoreTx); static WriteTransaction toWriteTransaction(final TypedWriteTransaction<? extends Datastore> datastoreTx); }
TransactionAdapter { public static ReadWriteTransaction toReadWriteTransaction( final TypedReadWriteTransaction<? extends Datastore> datastoreTx) { if (datastoreTx instanceof TypedReadWriteTransactionImpl) { final TypedReadWriteTransactionImpl<?> txImpl = (TypedReadWriteTransactionImpl<?>) datastoreTx; return new ReadWriteTransactionAdapter<>(txImpl.getDatastoreType(), txImpl); } throw new IllegalArgumentException("Unsupported TypedWriteTransaction implementation " + datastoreTx.getClass()); } private  TransactionAdapter(); static ReadWriteTransaction toReadWriteTransaction(
            final TypedReadWriteTransaction<? extends Datastore> datastoreTx); static WriteTransaction toWriteTransaction(final TypedWriteTransaction<? extends Datastore> datastoreTx);  }