本文整理匯總了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();
}