Package org.vertx.java.core.eventbus

Examples of org.vertx.java.core.eventbus.ReplyException.failureType()


    eventBus.sendWithTimeout(inAddress, new JsonObject().putString("action", "connect"), 1000, new Handler<AsyncResult<Message<Boolean>>>() {
      @Override
      public void handle(AsyncResult<Message<Boolean>> result) {
        if (result.failed()) {
          ReplyException failure = (ReplyException) result.cause();
          if (failure.failureType().equals(ReplyFailure.RECIPIENT_FAILURE)) {
            log.warn(String.format("%s - Failed to connect to %s", DefaultOutputConnection.this, context.target()), result.cause());
            new DefaultFutureResult<Void>(failure).setHandler(doneHandler);
          } else if (failure.failureType().equals(ReplyFailure.TIMEOUT)) {
            log.warn(String.format("%s - Connection to %s failed, retrying", DefaultOutputConnection.this, context.target()));
            connect(doneHandler);
View Full Code Here


        if (result.failed()) {
          ReplyException failure = (ReplyException) result.cause();
          if (failure.failureType().equals(ReplyFailure.RECIPIENT_FAILURE)) {
            log.warn(String.format("%s - Failed to connect to %s", DefaultOutputConnection.this, context.target()), result.cause());
            new DefaultFutureResult<Void>(failure).setHandler(doneHandler);
          } else if (failure.failureType().equals(ReplyFailure.TIMEOUT)) {
            log.warn(String.format("%s - Connection to %s failed, retrying", DefaultOutputConnection.this, context.target()));
            connect(doneHandler);
          } else {
            log.debug(String.format("%s - Connection to %s failed, retrying", DefaultOutputConnection.this, context.target()));
            vertx.setTimer(500, new Handler<Long>() {
View Full Code Here

    eventBus.sendWithTimeout(inAddress, new JsonObject().putString("action", "disconnect"), 5000, new Handler<AsyncResult<Message<Boolean>>>() {
      @Override
      public void handle(AsyncResult<Message<Boolean>> result) {
        if (result.failed()) {
          ReplyException failure = (ReplyException) result.cause();
          if (failure.failureType().equals(ReplyFailure.RECIPIENT_FAILURE)) {
            log.warn(String.format("%s - Failed to disconnect from %s", DefaultOutputConnection.this, context.target()), result.cause());
            new DefaultFutureResult<Void>(failure).setHandler(doneHandler);
          } else if (failure.failureType().equals(ReplyFailure.NO_HANDLERS)) {
            log.info(String.format("%s - Disconnected from %s", DefaultOutputConnection.this, context.target()));
            new DefaultFutureResult<Void>((Void) null).setHandler(doneHandler);
View Full Code Here

        if (result.failed()) {
          ReplyException failure = (ReplyException) result.cause();
          if (failure.failureType().equals(ReplyFailure.RECIPIENT_FAILURE)) {
            log.warn(String.format("%s - Failed to disconnect from %s", DefaultOutputConnection.this, context.target()), result.cause());
            new DefaultFutureResult<Void>(failure).setHandler(doneHandler);
          } else if (failure.failureType().equals(ReplyFailure.NO_HANDLERS)) {
            log.info(String.format("%s - Disconnected from %s", DefaultOutputConnection.this, context.target()));
            new DefaultFutureResult<Void>((Void) null).setHandler(doneHandler);
          } else {
            log.debug(String.format("%s - Disconnection from %s failed, retrying", DefaultOutputConnection.this, context.target()));
            disconnect(doneHandler);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.