本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例8: getNegative
import se.sics.kompics.Negative; //导入依赖的package包/类
@Override
public <P extends PortType> Negative<P> getNegative(Class<P> portType) {
return negative(portType);
}
示例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);
}
示例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);
}
示例11: doConnect
import se.sics.kompics.Negative; //导入依赖的package包/类
public <P extends PortType> Channel<P> doConnect(
Positive<P> positive, Negative<P> negative);
示例12: doDisconnect
import se.sics.kompics.Negative; //导入依赖的package包/类
public <P extends PortType> void doDisconnect(Negative<P> negative,
Positive<P> positive);
示例13: getNegative
import se.sics.kompics.Negative; //导入依赖的package包/类
@Override
public <P extends PortType> Negative<P> getNegative(Class<P> portType) {
return null;
}
示例14: doConnect
import se.sics.kompics.Negative; //导入依赖的package包/类
@Override
public <P extends PortType> Channel<P> doConnect(
Positive<P> positive, Negative<P> negative) {
return null;
}
示例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;
}