当前位置: 首页>>代码示例>>Java>>正文


Java PersistException类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:24,代码来源:JavaDBStorageEngine.java

示例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);
    }
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:19,代码来源:JavaDBStorageEngine.java

示例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();
    }
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:18,代码来源:JavaDBStorageEngine.java

示例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);
    }
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:24,代码来源:JavaDBStorageEngine.java

示例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();
    }
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:18,代码来源:JavaDBStorageEngine.java


注:本文中的org.sdnplatform.sync.error.PersistException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。