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


Java Negative类代码示例

本文整理汇总了Java中se.sics.kompics.Negative的典型用法代码示例。如果您正苦于以下问题:Java Negative类的具体用法?Java Negative怎么用?Java Negative使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: hasNegativePort

import se.sics.kompics.Negative; //导入依赖的package包/类
@Override
public boolean hasNegativePort(Port<Network> port) {
    rwlock.readLock().lock();
    if (port == deadLetterBox) {
        return true;
    }
    try {
        for (Set<Negative<Network>> portSet : destinationPorts.values()) {
            if (portSet.contains(port)) {
                return true;
            }
        }
    } finally {
        rwlock.readLock().unlock();
    }
    return false;
}
 
开发者ID:kompics,项目名称:kompics,代码行数:18,代码来源:VirtualNetworkChannel.java

示例2: addConnection

import se.sics.kompics.Negative; //导入依赖的package包/类
public void addConnection(byte[] id, Negative<Network> destinationPort) {
    rwlock.writeLock().lock();
    try {
        if (id == null) {
            hostPorts.add(destinationPort);
        } else {
            Set<Negative<Network>> ports = destinationPorts.get(ByteBuffer.wrap(id));
            if (ports != null) {
                ports.add(destinationPort);
            } else {
                ports = new HashSet<Negative<Network>>();
                ports.add(destinationPort);
                destinationPorts.put(ByteBuffer.wrap(id), ports);
            }
        }
    } finally {
        rwlock.writeLock().unlock();
    }
    destinationPort.addChannel(this);
}
 
开发者ID:kompics,项目名称:kompics,代码行数:21,代码来源:VirtualNetworkChannel.java

示例3: removeConnection

import se.sics.kompics.Negative; //导入依赖的package包/类
public void removeConnection(byte[] id, Negative<Network> destinationPort) {
    rwlock.writeLock().lock();
    try {
        if (id == null) {
            hostPorts.remove(destinationPort);
        } else {
            Set<Negative<Network>> ports = destinationPorts.get(ByteBuffer.wrap(id));
            if (ports != null) {
                ports.remove(destinationPort);
            }
        }
    } finally {
        rwlock.writeLock().unlock();
    }
    destinationPort.removeChannel(this);
}
 
开发者ID:kompics,项目名称:kompics,代码行数:17,代码来源:VirtualNetworkChannel.java

示例4: ExtPort

import se.sics.kompics.Negative; //导入依赖的package包/类
public ExtPort(Positive<Timer> timerPort, Positive<Network> networkPort, Positive<CroupierPort> croupierPort,
  Negative<OverlayViewUpdatePort> viewUpdatePort) {
  this.networkPort = networkPort;
  this.timerPort = timerPort;
  this.croupierPort = croupierPort;
  this.viewUpdatePort = viewUpdatePort;
}
 
开发者ID:Decentrify,项目名称:id2210-vt17,代码行数:8,代码来源:AppMngrComp.java

示例5: ComponentBodyAdapter

import se.sics.kompics.Negative; //导入依赖的package包/类
ComponentBodyAdapter(ResolutionContext context, JDefinedClass clazz) {
    super(context, clazz);
    initBlock = clazz.instanceInit();
    handlerType = (JClass) context.unit._ref(Handler.class);
    posPortType = (JClass) context.unit._ref(Positive.class);
    negPortType = (JClass) context.unit._ref(Negative.class);
    componentType = (JClass) context.unit._ref(Component.class);
    initType = (JClass) context.unit._ref(Init.class);
}
 
开发者ID:kompics,项目名称:kola,代码行数:10,代码来源:ComponentBodyAdapter.java

示例6: DataNetwork

import se.sics.kompics.Negative; //导入依赖的package包/类
public DataNetwork(Init init) {
    Component dataInterceptorC = create(DataStreamInterceptor.class, Init.NONE);
    Component networkC = init.hook.setupNetwork(proxy);
    init.hook.connectTimer(proxy, dataInterceptorC);
    Positive<Network> nettyPort = networkC.getPositive(Network.class);
    Negative<Network> interceptorPortReq = dataInterceptorC.getNegative(Network.class);
    Positive<Network> interceptorPortProv = dataInterceptorC.getPositive(Network.class);
    connect(nettyPort, interceptorPortReq, Channel.TWO_WAY);
    connect(interceptorPortProv, net, new DataSelector(), Channel.ONE_WAY_POS);
    connect(interceptorPortProv, net, new DataNotifySelector(), Channel.ONE_WAY_POS);
    connect(nettyPort, net, new NotDataSelector(), Channel.ONE_WAY_POS);
    connect(nettyPort, net, new NotDataNotifySelector(), Channel.ONE_WAY_POS);
    connect(nettyPort, net, Channel.ONE_WAY_NEG);
}
 
开发者ID:kompics,项目名称:kompics,代码行数:15,代码来源:DataNetwork.java

示例7: connect

import se.sics.kompics.Negative; //导入依赖的package包/类
public static VirtualNetworkChannel connect(Positive<Network> sourcePort, Negative<Network> deadLetterBox) {
    VirtualNetworkChannel vnc = new VirtualNetworkChannel(sourcePort, deadLetterBox);
    sourcePort.addChannel(vnc);
    deadLetterBox.addChannel(vnc);

    return vnc;
}
 
开发者ID:kompics,项目名称:kompics,代码行数:8,代码来源:VirtualNetworkChannel.java

示例8: getNegative

import se.sics.kompics.Negative; //导入依赖的package包/类
@Override
public <P extends PortType> Negative<P> getNegative(Class<P> portType) {
    return negative(portType);
}
 
开发者ID:jimdowling,项目名称:nat-traverser,代码行数:5,代码来源:MsgRetryComponent.java

示例9: doConnect

import se.sics.kompics.Negative; //导入依赖的package包/类
@Override
public <P extends PortType> Channel<P> doConnect(
        Positive<P> positive, Negative<P> negative) {
    return connect(positive, negative);
}
 
开发者ID:jimdowling,项目名称:nat-traverser,代码行数:6,代码来源:MsgRetryComponent.java

示例10: doDisconnect

import se.sics.kompics.Negative; //导入依赖的package包/类
@Override
public <P extends PortType> void doDisconnect(Negative<P> negative,
        Positive<P> positive) {
    // TODO - tell cosmin that disconnect should return a portType
    disconnect(negative, positive);
}
 
开发者ID:jimdowling,项目名称:nat-traverser,代码行数:7,代码来源:MsgRetryComponent.java

示例11: doConnect

import se.sics.kompics.Negative; //导入依赖的package包/类
public <P extends PortType> Channel<P> doConnect(
Positive<P> positive, Negative<P> negative);
 
开发者ID:jimdowling,项目名称:nat-traverser,代码行数:3,代码来源:ComponentDelegator.java

示例12: doDisconnect

import se.sics.kompics.Negative; //导入依赖的package包/类
public <P extends PortType> void doDisconnect(Negative<P> negative,
Positive<P> positive);
 
开发者ID:jimdowling,项目名称:nat-traverser,代码行数:3,代码来源:ComponentDelegator.java

示例13: getNegative

import se.sics.kompics.Negative; //导入依赖的package包/类
@Override
public <P extends PortType> Negative<P> getNegative(Class<P> portType) {
    return null;
}
 
开发者ID:jimdowling,项目名称:nat-traverser,代码行数:5,代码来源:VodComponentTestCase.java

示例14: doConnect

import se.sics.kompics.Negative; //导入依赖的package包/类
@Override
public <P extends PortType> Channel<P> doConnect(
        Positive<P> positive, Negative<P> negative) {
    return null;
}
 
开发者ID:jimdowling,项目名称:nat-traverser,代码行数:6,代码来源:VodComponentTestCase.java

示例15: doDisconnect

import se.sics.kompics.Negative; //导入依赖的package包/类
@Override
public <P extends PortType> void doDisconnect(Negative<P> negative,
        Positive<P> positive) {
    // TODO - tell cosmin that disconnect should return a portType
    return;
}
 
开发者ID:jimdowling,项目名称:nat-traverser,代码行数:7,代码来源:VodComponentTestCase.java


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