Java 类com.rabbitmq.client.Method 实例源码

项目:lyra    文件:Exceptions.java   
private static boolean isRetryable(ShutdownSignalException e) {
  if (e.isInitiatedByApplication())
    return false;
  Method method = e.getReason();
  if (method instanceof AMQP.Connection.Close)
    return isRetryable(((AMQP.Connection.Close) method).getReplyCode());
  if (method instanceof AMQP.Channel.Close)
    return isRetryable(((AMQP.Channel.Close) method).getReplyCode());
  return false;
}
项目:lyra    文件:AbstractFunctionalTest.java   
protected void callShutdownListener(RetryableResource resource, ShutdownSignalException e) {
  Method method = e.getReason();
  if (method instanceof AMQP.Connection.Close) {
    if (recoveryChannel != null)
      when(recoveryChannel.isOpen()).thenReturn(false);
    connectionHandler.shutdownListeners.get(0).shutdownCompleted(e);
  } else if (method instanceof AMQP.Channel.Close)
    resource.shutdownListeners.get(0).shutdownCompleted(e);
}
项目:java-rabbitmq-client    文件:TracingChannel.java   
@Override
public void asyncRpc(Method method) throws IOException {
  channel.asyncRpc(method);
}
项目:java-rabbitmq-client    文件:TracingChannel.java   
@Override
public Command rpc(Method method) throws IOException {
  return channel.rpc(method);
}
项目:java-rabbitmq-client    文件:TracingChannel.java   
@Override
public CompletableFuture<Command> asyncCompletableRpc(
    Method method) throws IOException {
  return channel.asyncCompletableRpc(method);
}
项目:lyra    文件:AbstractFunctionalTest.java   
protected ShutdownSignalException nonRetryableChannelShutdownSignal() {
  Method m = new AMQP.Channel.Close.Builder().replyCode(404).build();
  return new ShutdownSignalException(false, false, m, null);
}
项目:lyra    文件:AbstractFunctionalTest.java   
protected ShutdownSignalException retryableChannelShutdownSignal() {
  Method m = new AMQP.Channel.Close.Builder().replyCode(311).build();
  return new ShutdownSignalException(false, false, m, null);
}
项目:lyra    文件:AbstractFunctionalTest.java   
protected ShutdownSignalException retryableConnectionShutdownSignal() {
  Method m = new AMQP.Connection.Close.Builder().replyCode(320).build();
  return new ShutdownSignalException(true, false, m, null);
}
项目:lyra    文件:AbstractFunctionalTest.java   
protected ShutdownSignalException nonRetryableConnectionShutdownSignal() {
  Method m = new AMQP.Connection.Close.Builder().replyCode(530).build();
  return new ShutdownSignalException(true, false, m, null);
}
项目:rabbitmq-ha-client    文件:HaChannel.java   
/**
 * Asynchronously send a method over this channel.
 * @param method method to transmit over this channel.
 * @throws IOException Problem transmitting method.
 */
void asyncRpc(Method method) throws IOException;
项目:rabbitmq-ha-client    文件:HaChannel.java   
/**
 * Synchronously send a method over this channel.
 * @param method method to transmit over this channel.
 * @return command response to method. Caller should cast as appropriate.
 * @throws IOException Problem transmitting method.
 */
Command rpc(Method method) throws IOException;