本文整理汇总了Java中org.geotools.data.Transaction.getState方法的典型用法代码示例。如果您正苦于以下问题:Java Transaction.getState方法的具体用法?Java Transaction.getState怎么用?Java Transaction.getState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.geotools.data.Transaction
的用法示例。
在下文中一共展示了Transaction.getState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unlock
import org.geotools.data.Transaction; //导入方法依赖的package包/类
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);
}
示例2: getMyTransactionState
import org.geotools.data.Transaction; //导入方法依赖的package包/类
/**
* Used to retrieve the TransactionStateDiff for this transaction.
* <p>
*
* @param transaction
* @return GeoWaveTransactionState or null if subclass is handling
* differences
* @throws IOException
*/
protected GeoWaveTransactionState getMyTransactionState(
final Transaction transaction,
final GeoWaveFeatureSource source )
throws IOException {
synchronized (transaction) {
GeoWaveTransactionState state = null;
if (transaction == Transaction.AUTO_COMMIT) {
state = new GeoWaveAutoCommitTransactionState(
source);
}
else {
state = (GeoWaveTransactionState) transaction.getState(this);
if (state == null) {
state = new GeoWaveTransactionManagementState(
transactionBufferSize,
source.getComponents(),
transaction,
(LockingManagement) lockingManager);
transaction.putState(
this,
state);
}
}
return state;
}
}
示例3: release
import org.geotools.data.Transaction; //导入方法依赖的package包/类
@Override
public boolean release(
String authID,
Transaction transaction )
throws IOException {
AuthorizedLock lock = transaction == Transaction.AUTO_COMMIT ? null : (AuthorizedLock) transaction
.getState(this);
if (lock == null) lock = new AuthorizedLock(
this,
authID,
1 /* minutes */);
releaseAll(lock);
return true;
}
示例4: refresh
import org.geotools.data.Transaction; //导入方法依赖的package包/类
@Override
public boolean refresh(
String authID,
Transaction transaction )
throws IOException {
AuthorizedLock lock = transaction == Transaction.AUTO_COMMIT ? null : (AuthorizedLock) transaction
.getState(this);
if (lock == null) lock = new AuthorizedLock(
this,
authID,
1 /* minutes */);
resetAll(lock);
return true;
}