本文整理了Java中com.tc.util.Assert.inv()
方法的一些代码示例,展示了Assert.inv()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.inv()
方法的具体详情如下:
包路径:com.tc.util.Assert
类名称:Assert
方法名:inv
[英]Assert invariant
[中]断言不变量
代码示例来源:origin: org.terracotta/terracotta-ee
private void handleSendMessage(OOOProtocolMessage msg) {
final long r = msg.getSent();
if (r <= received) {
// we already got message
debugLog("Received dup msg " + r);
sendAck(received);
} else if (r > (received + 1)) {
// message missed, resend ack, receive to resend message.
debugLog("Received out of order msg " + r);
sendAck(received);
} else {
Assert.inv(r == (received + 1));
putMessage(msg);
ackIfNeeded(received = r);
}
}
}
代码示例来源:origin: org.terracotta/terracotta-l1
private void handleSendMessage(OOOProtocolMessage msg) {
final long r = msg.getSent();
if (r <= received) {
// we already got message
debugLog("Received dup msg " + r);
sendAck(received);
} else if (r > (received + 1)) {
// message missed, resend ack, receive to resend message.
debugLog("Received out of order msg " + r);
sendAck(received);
} else {
Assert.inv(r == (received + 1));
putMessage(msg);
ackIfNeeded(received = r);
}
}
}
代码示例来源:origin: org.terracotta/terracotta-l1-ee
private void handleSendMessage(OOOProtocolMessage msg) {
final long r = msg.getSent();
if (r <= received) {
// we already got message
debugLog("Received dup msg " + r);
sendAck(received);
} else if (r > (received + 1)) {
// message missed, resend ack, receive to resend message.
debugLog("Received out of order msg " + r);
sendAck(received);
} else {
Assert.inv(r == (received + 1));
putMessage(msg);
ackIfNeeded(received = r);
}
}
}
代码示例来源:origin: org.terracotta/terracotta-ee
@Override
public void execute(OOOProtocolMessage msg) {
if (msg.isSend()) {
handleSendMessage(msg);
} else {
// these message should be handled at higher level
Assert.inv(msg.isAck() || msg.isGoodbye());
Assert.inv(false);
}
}
代码示例来源:origin: org.terracotta/terracotta-l1-ee
@Override
public void execute(OOOProtocolMessage msg) {
if (msg.isSend()) {
handleSendMessage(msg);
} else {
// these message should be handled at higher level
Assert.inv(msg.isAck() || msg.isGoodbye());
Assert.inv(false);
}
}
代码示例来源:origin: org.terracotta/terracotta-l1
@Override
public void execute(OOOProtocolMessage msg) {
if (msg.isSend()) {
handleSendMessage(msg);
} else {
// these message should be handled at higher level
Assert.inv(msg.isAck() || msg.isGoodbye());
Assert.inv(false);
}
}
代码示例来源:origin: org.terracotta/terracotta-l1-ee
private boolean sendAck(long seq) {
OOOProtocolMessage opm = delivery.createAckMessage(seq);
Assert.inv(!opm.getSessionId().equals(UUID.NULL_ID));
if (delivery.sendMessage(opm)) {
lastAcked = seq;
return true;
} else {
return false;
}
}
代码示例来源:origin: org.terracotta/terracotta-ee
private boolean sendAck(long seq) {
OOOProtocolMessage opm = delivery.createAckMessage(seq);
Assert.inv(!opm.getSessionId().equals(UUID.NULL_ID));
if (delivery.sendMessage(opm)) {
lastAcked = seq;
return true;
} else {
return false;
}
}
代码示例来源:origin: org.terracotta/terracotta-l1
private boolean sendAck(long seq) {
OOOProtocolMessage opm = delivery.createAckMessage(seq);
Assert.inv(!opm.getSessionId().equals(UUID.NULL_ID));
if (delivery.sendMessage(opm)) {
lastAcked = seq;
return true;
} else {
return false;
}
}
代码示例来源:origin: org.terracotta/terracotta-ee
Assert.inv(!isClient);
if (debug) {
debugLog("Got Handshake message...");
Assert.inv(isClient);
Assert.inv(handshakeMode.get());
debugLog("Got reply OK");
debugLog("Received handshake fail reply - request for OOO reset channelConnected " + channelConnected);
Assert.inv(isClient);
Assert.inv(handshakeMode.get());
Assert.inv(false);
代码示例来源:origin: org.terracotta/terracotta-l1
Assert.inv(!isClient);
if (debug) {
debugLog("Got Handshake message...");
Assert.inv(isClient);
Assert.inv(handshakeMode.get());
debugLog("Got reply OK");
debugLog("Received handshake fail reply - request for OOO reset channelConnected " + channelConnected);
Assert.inv(isClient);
Assert.inv(handshakeMode.get());
Assert.inv(false);
代码示例来源:origin: org.terracotta/terracotta-l1-ee
Assert.inv(!isClient);
if (debug) {
debugLog("Got Handshake message...");
Assert.inv(isClient);
Assert.inv(handshakeMode.get());
debugLog("Got reply OK");
debugLog("Received handshake fail reply - request for OOO reset channelConnected " + channelConnected);
Assert.inv(isClient);
Assert.inv(handshakeMode.get());
Assert.inv(false);
内容来源于网络,如有侵权,请联系作者删除!