/** Sets the transaction associated with the state. */ public void setTransaction(Transaction tx) { this.tx = tx; if (tx != Transaction.AUTO_COMMIT) { tx.putState(this.entry, transactionState); } }
private ArcTransactionState getState(final Transaction transaction) { if (Transaction.AUTO_COMMIT.equals(transaction)) { return null; } ArcTransactionState state = (ArcTransactionState) transaction.getState(this); if (state == null) { state = new ArcTransactionState(this, listenerManager); transaction.putState(this, state); } return state; }
t.putState(this, tstate); return cx;
/** * EventContentFeatureWriter construction. * * @param reader * @param diff * @param filter */ public EventContentFeatureWriter( ContentFeatureStore store, FeatureWriter<SimpleFeatureType, SimpleFeature> writer) { this.store = store; this.writer = writer; this.state = store.getState(); Transaction t = state.getTransaction(); if (t != Transaction.AUTO_COMMIT) { // auto commit does not issue batch events t.putState(this, new EventContentTransactionState()); } }
/** * Creates the right sort of In-Process Lock. * * @param transaction * @param featureLock * @return In-Process Lock * @throws FeatureLockException When a Transaction lock is requested against * Transaction.AUTO_COMMIT */ protected synchronized Lock createLock(Transaction transaction, FeatureLock featureLock) throws FeatureLockException { if (featureLock == FeatureLock.TRANSACTION) { // we need a Transacstion Lock if (transaction == Transaction.AUTO_COMMIT) { throw new FeatureLockException( "We cannot issue a Transaction lock against AUTO_COMMIT"); } TransactionLock lock = (TransactionLock) transaction.getState(this); if (lock == null) { lock = new TransactionLock(); transaction.putState(this, lock); return lock; } else { return lock; } } else { return new MemoryLock(featureLock); } }
transaction.putState(pool, state);
/** Sets the transaction associated with the state. */ @Override public void setTransaction(Transaction tx) { super.setTransaction(tx); if (tx != Transaction.AUTO_COMMIT) { synchronized (WFSRemoteTransactionState.class) { WFSDataStore dataStore = (WFSDataStore) entry.getDataStore(); WFSRemoteTransactionState remoteStateKeeper; remoteStateKeeper = (WFSRemoteTransactionState) tx.getState(dataStore); if (remoteStateKeeper == null) { remoteStateKeeper = new WFSRemoteTransactionState(dataStore); tx.putState(dataStore, remoteStateKeeper); } WFSLocalTransactionState localTransactionState = getLocalTransactionState(); remoteStateKeeper.watch(localTransactionState.getState()); } } } }
/** * Sets the transaction associated with the state. */ public void setTransaction(Transaction tx) { this.tx = tx; if (tx != Transaction.AUTO_COMMIT) { tx.putState(this.entry, transactionState); } }
private ArcTransactionState getState(final Transaction transaction) { if (Transaction.AUTO_COMMIT.equals(transaction)) { return null; } ArcTransactionState state = (ArcTransactionState) transaction.getState(this); if (state == null) { state = new ArcTransactionState(this, listenerManager); transaction.putState(this, state); } return state; }
TransactionStateDiff state(Transaction transaction) { synchronized (transaction) { TransactionStateDiff state = (TransactionStateDiff) transaction .getState(this); if (state == null) { state = new TransactionStateDiff(this); transaction.putState(this, state); } return state; } }
private TransactionStateDiff state(Transaction transaction) { synchronized (transaction) { TransactionStateDiff state = (TransactionStateDiff) transaction .getState(this); if (state == null) { state = new TransactionStateDiff(this); transaction.putState(this, state); } return state; } }
TypeDiffState state(Transaction transaction) { synchronized (transaction) { TypeDiffState state = (TypeDiffState) transaction.getState(this); if (state == null) { state = new TypeDiffState(this); transaction.putState(this, state); } return state; } } public void fireAdded( Feature newFeature, Transaction transaction ){
/** * * @see org.geotools.data.FeatureStore#setTransaction(org.geotools.data.Transaction) */ public void setTransaction(Transaction transaction) { if(transaction == null) throw new NullPointerException("Should this not be Transaction.AutoCommit?"); trans = transaction; if(trans != Transaction.AUTO_COMMIT){ WFSTransactionState ts = (WFSTransactionState) trans.getState(ds); if(ts == null){ trans.putState(ds,new WFSTransactionState(ds)); } } } }
/** * This method is identical to the super class WHY? */ protected TransactionStateDiff state(Transaction transaction) { synchronized (transaction) { TransactionStateDiff state = (TransactionStateDiff) transaction .getState(this); if (state == null) { state = new TransactionStateDiff(this); transaction.putState(this, state); } return state; } }
/** * This method is identical to the super class WHY? */ protected TransactionStateDiff state(Transaction transaction) { synchronized (transaction) { TransactionStateDiff state = (TransactionStateDiff) transaction .getState(this); if (state == null) { state = new TransactionStateDiff(this); transaction.putState(this, state); } return state; } }
/** * Used to retrive the TransactionStateDiff for this transaction. * If you subclass is doing its own thing (ArcSDE I am talking to * you) then you should arrange for this method to return null. * <p> * By default a TransactionStateDiff will be created that holds * any changes in memory. * <p> * @param transaction * @return TransactionStateDiff or null if subclass is handling differences */ protected TransactionStateDiff state(Transaction transaction) { synchronized (transaction) { TransactionStateDiff state = (TransactionStateDiff) transaction .getState(this); if (state == null) { state = new TransactionStateDiff(this); transaction.putState(this, state); } return state; } }
private void unlock( Transaction transaction, String featureID, Set<String> authorizations, long expiryInMinutes) { AuthorizedLock lock = transaction == Transaction.AUTO_COMMIT ? null : (AuthorizedLock) transaction.getState(this); if (lock == null) { lock = new AuthorizedLock(this, authorizations, expiryInMinutes); if (transaction != Transaction.AUTO_COMMIT) transaction.putState(this, lock); } unlock(lock, featureID); }
private void lock( Transaction transaction, String featureID, Set<String> authorizations, long expiryInMinutes) { AuthorizedLock lock = transaction == Transaction.AUTO_COMMIT ? null : (AuthorizedLock) transaction.getState(this); if (lock == null) { lock = new AuthorizedLock(this, authorizations, expiryInMinutes); if (transaction != Transaction.AUTO_COMMIT) transaction.putState(this, lock); } lock(lock, featureID); }
/** * EventContentFeatureWriter construction. * * @param reader * @param diff * @param filter */ public EventContentFeatureWriter(ContentFeatureStore store, FeatureWriter<SimpleFeatureType, SimpleFeature> writer) { this.store = store; this.writer = writer; this.state = store.getState(); Transaction t = state.getTransaction(); if( t != Transaction.AUTO_COMMIT ){ // auto commit does not issue batch events t.putState(this,new EventContentTransactionState()); } }
@Override public synchronized void setTransaction(Transaction transaction) { // we need to set both super and delegate transactions. super.setTransaction(transaction); // this guard ensures that a recursive loop will not form if (delegate.getTransaction() != transaction) { delegate.setTransaction(transaction); } if (!Transaction.AUTO_COMMIT.equals(transaction)) { GeogigTransactionState geogigTx; geogigTx = (GeogigTransactionState) transaction.getState(GeogigTransactionState.class); if (geogigTx == null) { geogigTx = new GeogigTransactionState(getEntry()); transaction.putState(GeogigTransactionState.class, geogigTx); } } }