本文整理汇总了Java中org.sdnplatform.sync.error.PersistException类的典型用法代码示例。如果您正苦于以下问题:Java PersistException类的具体用法?Java PersistException怎么用?Java PersistException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PersistException类属于org.sdnplatform.sync.error包,在下文中一共展示了PersistException类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JavaDBStorageEngine
import org.sdnplatform.sync.error.PersistException; //导入依赖的package包/类
/**
* Construct a new storage engine that will use the provided engine
* as a delegate and provide persistence for its data. Note that
* the delegate engine must be empty when this object is constructed
* @param delegate the delegate engine to persist
* @throws SyncException
*/
public JavaDBStorageEngine(String name,
ConnectionPoolDataSource dataSource)
throws PersistException {
super();
this.name = name;
this.dbTableName = name.replace('.', '_');
this.dataSource = dataSource;
try {
initTable();
} catch (SQLException sqle) {
throw new PersistException("Could not initialize persistent storage",
sqle);
}
}
示例2: get
import org.sdnplatform.sync.error.PersistException; //导入依赖的package包/类
@Override
public List<Versioned<byte[]>> get(ByteArray key) throws SyncException {
StoreUtils.assertValidKey(key);
Connection dbConnection = null;
PreparedStatement stmt = null;
try {
dbConnection = getConnection();
stmt = dbConnection.prepareStatement(getSql(SELECT_KEY));
return doSelect(stmt, getKeyAsString(key));
} catch (Exception e) {
throw new PersistException("Could not retrieve key" +
" from database",
e);
} finally {
cleanupSQL(dbConnection, stmt);
}
}
示例3: next
import org.sdnplatform.sync.error.PersistException; //导入依赖的package包/类
@Override
public Pair<ByteArray, List<Versioned<byte[]>>> next() {
if (hasNext()) {
try {
ByteArray key = getStringAsKey(rs.getString("datakey"));
List<Versioned<byte[]>> vlist = getVersionedList(rs);
hasNextSet = false;
return new Pair<ByteArray,
List<Versioned<byte[]>>>(key, vlist);
} catch (Exception e) {
throw new SyncRuntimeException("Error in DB Iterator",
new PersistException(e));
}
} else {
throw new NoSuchElementException();
}
}
示例4: JavaDBStorageEngine
import org.sdnplatform.sync.error.PersistException; //导入依赖的package包/类
/**
* Construct a new storage engine that will use the provided engine
* as a delegate and provide persistence for its data. Note that
* the delegate engine must be empty when this object is constructed
* @param delegate the delegate engine to persist
* @throws SyncException
*/
public JavaDBStorageEngine(String name,
ConnectionPoolDataSource dataSource)
throws PersistException {
super();
this.name = name;
this.dbTableName = name.replace('.', '_');
this.dataSource = dataSource;
try {
initTable();
} catch (SQLException sqle) {
throw new PersistException("Could not initialize persistent storage",
sqle);
}
}
示例5: next
import org.sdnplatform.sync.error.PersistException; //导入依赖的package包/类
@Override
public Pair<ByteArray, List<Versioned<byte[]>>> next() {
if (hasNext()) {
try {
ByteArray key = getStringAsKey(rs.getString("datakey"));
List<Versioned<byte[]>> vlist = getVersionedList(rs);
hasNextSet = false;
return new Pair<ByteArray,
List<Versioned<byte[]>>>(key, vlist);
} catch (Exception e) {
throw new SyncRuntimeException("Error in DB Iterator",
new PersistException(e));
}
} else {
throw new NoSuchElementException();
}
}