本文整理汇总了Java中com.rabbitmq.client.ShutdownSignalException.isHardError方法的典型用法代码示例。如果您正苦于以下问题:Java ShutdownSignalException.isHardError方法的具体用法?Java ShutdownSignalException.isHardError怎么用?Java ShutdownSignalException.isHardError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.rabbitmq.client.ShutdownSignalException
的用法示例。
在下文中一共展示了ShutdownSignalException.isHardError方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: primitiveCall
import com.rabbitmq.client.ShutdownSignalException; //导入方法依赖的package包/类
private byte[] primitiveCall( AMQP.BasicProperties props, byte[] message )
throws IOException,
ShutdownSignalException,
TimeoutException
{
checkConsumer();
BlockingCell<Object> k = new BlockingCell<>();
String replyId = RabbitMQ.newCorrelationId();
props = ((props == null) ? new AMQP.BasicProperties.Builder() : props.builder())
.correlationId( replyId )
.replyTo( replyQueue )
.build();
continuationMap.put( replyId, k );
publish( props, message );
Object reply = k.uninterruptibleGet( timeout );
if( reply instanceof ShutdownSignalException ) {
ShutdownSignalException sig = (ShutdownSignalException) reply;
ShutdownSignalException wrapper = new ShutdownSignalException( sig.isHardError(),
sig.isInitiatedByApplication(),
sig.getReason(),
sig.getReference() );
wrapper.initCause( sig );
throw wrapper;
}
else {
return (byte[]) reply;
}
}
示例2: handleShutdownSignal
import com.rabbitmq.client.ShutdownSignalException; //导入方法依赖的package包/类
@Override
public void handleShutdownSignal(final String consumerTag, final ShutdownSignalException ex)
{
Log.i("libretalk::LibretalkMessageReceiver::MessageConsumer", "Received shutdown signal from "
+ consumerTag + ": " + ex);
if (ex.isHardError())
{
handler.post(new PostErrorTask(ex));
}
}
示例3: isConnectionClosure
import com.rabbitmq.client.ShutdownSignalException; //导入方法依赖的package包/类
/**
* Reliably returns whether the shutdown signal represents a connection closure.
*/
public static boolean isConnectionClosure(ShutdownSignalException e) {
return e instanceof AlreadyClosedException ? e.getReference() instanceof Connection
: e.isHardError();
}