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


Java ReadWriteTransaction.cancel方法代码示例

本文整理汇总了Java中org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction.cancel方法的典型用法代码示例。如果您正苦于以下问题:Java ReadWriteTransaction.cancel方法的具体用法?Java ReadWriteTransaction.cancel怎么用?Java ReadWriteTransaction.cancel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction的用法示例。


在下文中一共展示了ReadWriteTransaction.cancel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initializeOvsdbTopology

import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
private void initializeOvsdbTopology(LogicalDatastoreType type) {
    InstanceIdentifier<Topology> path = InstanceIdentifier
            .create(NetworkTopology.class)
            .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID));
    ReadWriteTransaction transaction = db.newReadWriteTransaction();
    CheckedFuture<Optional<Topology>, ReadFailedException> ovsdbTp = transaction.read(type, path);
    try {
        if (!ovsdbTp.get().isPresent()) {
            TopologyBuilder tpb = new TopologyBuilder();
            tpb.setTopologyId(SouthboundConstants.OVSDB_TOPOLOGY_ID);
            transaction.put(type, path, tpb.build(), true);
            transaction.submit();
        } else {
            transaction.cancel();
        }
    } catch (InterruptedException | ExecutionException e) {
        LOG.error("Error initializing ovsdb topology", e);
    }
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:20,代码来源:SouthboundProvider.java

示例2: initializeHwvtepTopology

import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
private void initializeHwvtepTopology(LogicalDatastoreType type) {
    InstanceIdentifier<Topology> path = InstanceIdentifier
            .create(NetworkTopology.class)
            .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID));
    ReadWriteTransaction transaction = db.newReadWriteTransaction();
    CheckedFuture<Optional<Topology>, ReadFailedException> hwvtepTp = transaction.read(type, path);
    try {
        if (!hwvtepTp.get().isPresent()) {
            TopologyBuilder tpb = new TopologyBuilder();
            tpb.setTopologyId(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID);
            transaction.put(type, path, tpb.build(), true);
            transaction.submit();
        } else {
            transaction.cancel();
        }
    } catch (Exception e) {
        LOG.error("Error initializing hwvtep topology", e);
    }
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:20,代码来源:HwvtepSouthboundProvider.java

示例3: add

import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
private boolean add(S input, ReadWriteTransaction tx) throws InterruptedException, ExecutionException {
    Preconditions.checkNotNull(tx);
    if (exists(input.getID(), tx)) {
        tx.cancel();
        return false;
    }
    addMd(input, tx);
    return true;
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:10,代码来源:AbstractTranscriberInterface.java

示例4: remove

import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
private boolean remove(String uuid, ReadWriteTransaction tx) throws InterruptedException, ExecutionException {
    Preconditions.checkNotNull(tx);
    if (!exists(uuid, tx)) {
        tx.cancel();
        return false;
    }
    removeMd(toMd(uuid), tx);
    return true;
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:10,代码来源:AbstractTranscriberInterface.java

示例5: update

import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
private boolean update(String uuid, S delta, ReadWriteTransaction tx)
        throws InterruptedException, ExecutionException {
    Preconditions.checkNotNull(tx);
    if (!exists(uuid, tx)) {
        tx.cancel();
        return false;
    }
    updateMd(delta, tx);
    return true;
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:11,代码来源:AbstractTranscriberInterface.java


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