本文整理了Java中com.tc.util.Assert.eval()
方法的一些代码示例,展示了Assert.eval()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.eval()
方法的具体详情如下:
包路径:com.tc.util.Assert
类名称:Assert
方法名:eval
[英]Evaluate the boolean exception and throw an assertion error if false
[中]计算布尔异常,如果为false,则抛出断言错误
代码示例来源:origin: org.terracotta/terracotta-ee
/**
* Evaluate the boolean exception and throw an assertion error if false
*
* @param expr Expression
*/
public static void assertTrue(boolean expr) {
eval(expr);
}
代码示例来源:origin: org.terracotta/terracotta-ee
@Override
public void setAddPredicate(AddPredicate predicate) {
Assert.eval(predicate != null);
this.predicate = predicate;
}
代码示例来源:origin: org.terracotta/terracotta-l1-ee
/**
* Evaluate the boolean exception and throw an assertion error if false
*
* @param expr Expression
*/
public static void assertTrue(boolean expr) {
eval(expr);
}
代码示例来源:origin: org.terracotta/terracotta-ee
@Override
public String getErrorContext() {
Assert.eval(hasErrorContext());
return this.errorContext;
}
代码示例来源:origin: org.terracotta/terracotta-l1
public final synchronized void pause() {
Assert.eval("started: " + started + ", paused: " + paused, started && !paused);
basicPause();
this.paused = true;
}
代码示例来源:origin: org.terracotta/terracotta-l1-ee
private void addConnection(TCConnectionImpl connection, int initialWeight) {
synchronized (managedConnectionsMap) {
Assert.eval(!managedConnectionsMap.containsKey(connection));
managedConnectionsMap.put(connection, initialWeight);
this.clientWeights += initialWeight;
connection.addListener(this);
}
}
代码示例来源:origin: org.terracotta/terracotta-ee
@Override
public void saveCopyOfBeanInAnticipationOfFutureMutation() {
Assert.eval(this.preMutateCopy == null);
this.preMutateCopy = this.bean.copy();
}
代码示例来源:origin: org.terracotta/terracotta-ee
public final synchronized void pause() {
Assert.eval("started: " + started + ", paused: " + paused, started && !paused);
basicPause();
this.paused = true;
}
代码示例来源:origin: org.terracotta/terracotta-l1-ee
@Override
public synchronized String readFieldName(final TCDataInput in) throws IOException {
final int stringID = in.readInt();
final String fieldName = stringForID(stringID);
Assert.eval(fieldName != null);
return fieldName;
}
代码示例来源:origin: org.terracotta/terracotta-l1-ee
/**
* Connects a new transport to an existing stack (server-side).
*/
@Override
public final MessageTransport attachNewConnection(TCConnection connection) throws IllegalReconnectException {
Assert.eval("Attempt to connect a transport to a stack that hasn't been finalized.", finalized.isSet());
this.transport.attachNewConnection(connection);
return this.transport;
}
代码示例来源:origin: org.terracotta/terracotta-l1-ee
@Override
public final int getUshort() {
int rv = 0;
rv += ((get() & 0xFF) << 8);
rv += ((get() & 0xFF));
Assert.eval((rv >= 0) && (rv <= 0xFFFF));
return rv;
}
代码示例来源:origin: org.terracotta/terracotta-ee
@Override
public void configurationChanged(XmlObject oldConfig, XmlObject newConfig) {
XmlObject oldChild = oldConfig == null ? null : this.childFetcher.getChild(oldConfig);
XmlObject newChild = newConfig == null ? null : this.childFetcher.getChild(newConfig);
Assert.eval(newChild == null || this.requiredBeanClass.isInstance(newChild));
if (oldChild != newChild) this.listeners.configurationChanged(oldChild, newChild);
}
代码示例来源:origin: org.terracotta/terracotta-ee
@Override
public void closeEvent(TCConnectionEvent event) {
synchronized (managedConnectionsMap) {
Assert.eval(managedConnectionsMap.containsKey(event.getSource()));
int closedCientWeight = managedConnectionsMap.get(event.getSource());
this.clientWeights -= closedCientWeight;
managedConnectionsMap.remove(event.getSource());
event.getSource().removeListener(this);
}
}
代码示例来源:origin: org.terracotta/terracotta-ee
void requestReadInterest(TCChannelReader reader, ScatteringByteChannel channel) {
Assert.eval(isReader());
handleRequest(InterestRequest.createAddInterestRequest((SelectableChannel) channel, reader, SelectionKey.OP_READ,
this));
}
代码示例来源:origin: org.terracotta/terracotta-ee
/**
* Unlike literalValueChange, this method is not synchronized on getResolveLock() because this method is called by the
* applicator thread which has been synchronized on getResolveLock() in TCObjectImpl.hydrate().
*/
@Override
public void setLiteralValue(Object newValue) {
Assert.eval(newValue != null);
setPeerObject(getObjectManager().newWeakObjectReference(getObjectID(), newValue));
}
代码示例来源:origin: org.terracotta/terracotta-ee
private void ensureFileExists(TCFile file) throws FileNotCreatedException {
if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
throw new FileNotCreatedException("Could not create file for startup lock: " + file
+ ". Please ensure that this file can be created.");
}
Assert.eval(file.exists());
}
}
代码示例来源:origin: org.terracotta/terracotta-l1
private void ensureFileExists(TCFile file) throws FileNotCreatedException {
if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
throw new FileNotCreatedException("Could not create file for startup lock: " + file
+ ". Please ensure that this file can be created.");
}
Assert.eval(file.exists());
}
}
代码示例来源:origin: org.terracotta/terracotta-l1
@Override
public void receiveMessage(OOOProtocolMessage msg) {
Assert.assertNotNull("Receive layer is null.", this.receiveLayer);
Assert.assertNotNull("Attempt to null msg", msg);
Assert.eval(msg.isSend());
this.receiveLayer.receive(msg.getPayload());
}
代码示例来源:origin: org.terracotta/terracotta-l1-ee
@Override
public void receiveMessage(OOOProtocolMessage msg) {
Assert.assertNotNull("Receive layer is null.", this.receiveLayer);
Assert.assertNotNull("Attempt to null msg", msg);
Assert.eval(msg.isSend());
this.receiveLayer.receive(msg.getPayload());
}
代码示例来源:origin: org.terracotta/terracotta-l1
public void receive(OOOProtocolMessage msg) {
if (msg.isSend()) {
// Handle the ACKed sequence from the message.
sender.execute(msg);
receiver.execute(msg);
} else if (msg.isAck() || msg.isHandshakeReplyOk()) {
sender.execute(msg);
} else {
Assert.eval("Unexpected OOO Msg: " + msg, false);
}
}
内容来源于网络,如有侵权,请联系作者删除!