Java 类java.util.concurrent.ConcurrentHashMap.KeySetView 实例源码

项目:Timo    文件:AutoTransactionSession.java   
@Override
public void clear() {
    front.reset();
    ArrayList<BackendConnection> rollbacks = new ArrayList<>();
    KeySetView<Integer, BackendConnection> keys = connections.keySet();
    for (Integer id : keys) {
        BackendConnection con = connections.remove(id);
        if (con.isClosed()) {
            continue;
        }
        if (con.isRunning()) {
            con.setHandler(null);
            con.close("cleared");
        } else {
            rollbacks.add(con);
        }
    }
    ResultHandler handler = new RollbackHandler();
    rollbacks.forEach(con -> con.query("rollback", handler));
}
项目:Timo    文件:TransactionSession.java   
@Override
public void clear() {
    front.reset();
    ArrayList<BackendConnection> rollbacks = new ArrayList<>();
    KeySetView<Integer, BackendConnection> keys = connections.keySet();
    for (Integer id : keys) {
        BackendConnection con = connections.remove(id);
        if (con.isClosed()) {
            continue;
        }
        if (con.isRunning()) {
            con.setHandler(null);
            con.close("cleared");
        } else {
            rollbacks.add(con);
        }
    }
    ResultHandler handler = new RollbackHandler();
    rollbacks.forEach(con -> con.query("rollback", handler));
}
项目:Timo    文件:XATransactionSession.java   
@Override
public void clear() {
    front.reset();
    KeySetView<Integer, BackendConnection> keys = connections.keySet();
    for (Integer id : keys) {
        BackendConnection con = connections.remove(id);
        if (con.isClosed()) {
            continue;
        }
        con.setHandler(null);
        con.close("cleared");
    }
    this.state = XAState.FINISHED;
    this.XID = null;
}
项目:Timo    文件:XATransactionSession.java   
public void release() {
    front.reset();
    KeySetView<Integer, BackendConnection> keys = connections.keySet();
    for (Integer id : keys) {
        BackendConnection con = connections.remove(id);
        con.release();
    }
    this.state = XAState.FINISHED;
    this.XID = null;
}
项目:Timo    文件:AutoCommitSession.java   
@Override
public void clear() {
    front.reset();
    KeySetView<Integer, BackendConnection> keys = connections.keySet();
    for (Integer id : keys) {
        BackendConnection con = connections.remove(id);
        con.setHandler(null);
        con.close("cleared");
    }
}
项目:Etheric    文件:StabilityWorldData.java   
public KeySetView<ChunkPos, StabilityData> getChunks() {
    return this.chunkData.keySet();
}
项目:Cotton    文件:ServiceLookup.java   
/**
 * Returns the key set in the hash map table. The order of the keys will be
 * unpredictable.
 *
 * @return the key set of the hash map.
 */
public ConcurrentHashMap.KeySetView<String, ServiceMetaData> getKeySet() {
    return hashMap.keySet();
}