void addTransactionAware(TransactionAware txAware) { if (this.txContext != null) { txContext.addTransactionAware(txAware); } else if (this.tx != null) { txAwares.add(txAware); assert (tx != null); txAware.startTx(tx); } }
@Override public void startTx(Transaction tx) { for (TransactionAware txAware : this) { txAware.startTx(tx); } }
@Override public void startTx(Transaction tx) { if (txAware != null) { txAware.startTx(tx); } }
@Override public void startTx(Transaction tx) { if (consumer instanceof TransactionAware) { ((TransactionAware) consumer).startTx(tx); } }
@Override public void startTx(Transaction tx) { txAwares.startTx(tx); }
/** * Adds a new transaction-aware to participate in the transaction. * @param txAware the new transaction-aware */ public boolean addTransactionAware(TransactionAware txAware) { // If the txAware is newly added, call startTx as well if there is an active transaction boolean added = txAwares.add(txAware); if (added && currentTx != null) { txAware.startTx(currentTx); } return added; }
@Override public final boolean addTransactionAware(TransactionAware txAware) { boolean added = doAddTransactionAware(txAware); // If there is an active transaction, call startTx on the given txAware as well if (added && currentTx != null) { txAware.startTx(currentTx); } return added; }
public void initialize() throws IOException, DatasetManagementException, DatasetNotFoundException, ClassNotFoundException { dataset = datasetInstantiator.getDataset(datasetId); if (dataset instanceof TransactionAware) { ((TransactionAware) dataset).startTx(transaction); } }
void addTransactionAware(TransactionAware txAware) { if (this.txContext != null) { txContext.addTransactionAware(txAware); } else if (this.tx != null) { txAwares.add(txAware); assert (tx != null); txAware.startTx(tx); } }
void addTransactionAware(TransactionAware txAware) { if (this.txContext != null) { txContext.addTransactionAware(txAware); } else if (this.tx != null) { txAwares.add(txAware); assert (tx != null); txAware.startTx(tx); } }
@Override public final boolean addTransactionAware(TransactionAware txAware) { boolean added = doAddTransactionAware(txAware); // If there is an active transaction, call startTx on the given txAware as well if (added && currentTx != null) { txAware.startTx(currentTx); } return added; }
public void initialize() throws IOException, DatasetManagementException, DatasetNotFoundException, ClassNotFoundException { dataset = datasetInstantiator.getDataset(datasetId); if (dataset instanceof TransactionAware) { ((TransactionAware) dataset).startTx(transaction); } }
@Override public <T extends Dataset> T getDataset(String name, Map<String, String> arguments, AccessType accessType) throws DatasetInstantiationException { T dataset = datasetCache.getDataset(name, arguments, accessType); // Only call startTx if the dataset hasn't been seen before // It is ok because there is only one transaction in this DatasetContext // If a dataset instance is being reused, we don't need to call startTx again. // It's also true for the case when a dataset instance was released and reused. if (datasets.add(dataset) && dataset instanceof TransactionAware) { ((TransactionAware) dataset).startTx(transaction); } return dataset; }
@Override public final void startTx(Transaction transaction) { getCurrentThreadTransactionAware().startTx(transaction); }
@Override public void startTx(Transaction tx) { delegate().startTx(tx); }
@Override public <T extends Dataset> T getDataset(String name, Map<String, String> arguments, AccessType accessType) throws DatasetInstantiationException { T dataset = datasetCache.getDataset(name, arguments, accessType); // Only call startTx if the dataset hasn't been seen before // It is ok because there is only one transaction in this DatasetContext // If a dataset instance is being reused, we don't need to call startTx again. // It's also true for the case when a dataset instance was released and reused. if (datasets.add(dataset) && dataset instanceof TransactionAware) { ((TransactionAware) dataset).startTx(transaction); } return dataset; }
@Override public void startTx(Transaction tx) { delegate().startTx(tx); }
@Override public final void startTx(Transaction transaction) { getCurrentThreadTransactionAware().startTx(transaction); }
@Override public <T extends Dataset> T getDataset(String name, Map<String, String> arguments, AccessType accessType) throws DatasetInstantiationException { T dataset = datasetCache.getDataset(name, arguments, accessType); // Only call startTx if the dataset hasn't been seen before // It is ok because there is only one transaction in this DatasetContext // If a dataset instance is being reused, we don't need to call startTx again. // It's also true for the case when a dataset instance was released and reused. if (datasets.add(dataset) && dataset instanceof TransactionAware) { ((TransactionAware) dataset).startTx(transaction); } return dataset; }
/** * Initializes the transaction-awares. */ private void initializeTransactionAwares() { if (transaction == null) { return; } Iterable<TransactionAware> txAwares = Iterables.concat(getDatasetCache().getStaticTransactionAwares(), getDatasetCache().getExtraTransactionAwares()); for (TransactionAware txAware : txAwares) { this.txAwares.add(txAware); txAware.startTx(transaction); } }