This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit a9dca3681cc92cdea2ed4d318ac0e4fc8f6ba00f Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Sat Jan 25 18:26:30 2020 +0100 CAMEL-14354: camel-core optimize --- .../java/org/apache/camel/support/EventHelper.java | 80 +++++++++++----------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/core/camel-support/src/main/java/org/apache/camel/support/EventHelper.java b/core/camel-support/src/main/java/org/apache/camel/support/EventHelper.java index 09781ae..bccd0e4 100644 --- a/core/camel-support/src/main/java/org/apache/camel/support/EventHelper.java +++ b/core/camel-support/src/main/java/org/apache/camel/support/EventHelper.java @@ -514,11 +514,6 @@ public final class EventHelper { } public static boolean notifyExchangeCreated(CamelContext context, Exchange exchange) { - if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) { - // do not generate events for an notify event - return false; - } - ManagementStrategy management = context.getManagementStrategy(); if (management == null) { return false; @@ -534,6 +529,11 @@ public final class EventHelper { return false; } + if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) { + // do not generate events for an notify event + return false; + } + boolean answer = false; CamelEvent event = null; // optimise for loop using index access to avoid creating iterator object @@ -560,11 +560,6 @@ public final class EventHelper { } public static boolean notifyExchangeDone(CamelContext context, Exchange exchange) { - if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) { - // do not generate events for an notify event - return false; - } - ManagementStrategy management = context.getManagementStrategy(); if (management == null) { return false; @@ -580,6 +575,11 @@ public final class EventHelper { return false; } + if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) { + // do not generate events for an notify event + return false; + } + boolean answer = false; CamelEvent event = null; // optimise for loop using index access to avoid creating iterator object @@ -606,11 +606,6 @@ public final class EventHelper { } public static boolean notifyExchangeFailed(CamelContext context, Exchange exchange) { - if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) { - // do not generate events for an notify event - return false; - } - ManagementStrategy management = context.getManagementStrategy(); if (management == null) { return false; @@ -626,6 +621,11 @@ public final class EventHelper { return false; } + if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) { + // do not generate events for an notify event + return false; + } + boolean answer = false; CamelEvent event = null; // optimise for loop using index access to avoid creating iterator object @@ -653,11 +653,6 @@ public final class EventHelper { public static boolean notifyExchangeFailureHandling(CamelContext context, Exchange exchange, Processor failureHandler, boolean deadLetterChannel, String deadLetterUri) { - if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) { - // do not generate events for an notify event - return false; - } - ManagementStrategy management = context.getManagementStrategy(); if (management == null) { return false; @@ -673,6 +668,11 @@ public final class EventHelper { return false; } + if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) { + // do not generate events for an notify event + return false; + } + boolean answer = false; CamelEvent event = null; // optimise for loop using index access to avoid creating iterator object @@ -700,11 +700,6 @@ public final class EventHelper { public static boolean notifyExchangeFailureHandled(CamelContext context, Exchange exchange, Processor failureHandler, boolean deadLetterChannel, String deadLetterUri) { - if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) { - // do not generate events for an notify event - return false; - } - ManagementStrategy management = context.getManagementStrategy(); if (management == null) { return false; @@ -720,6 +715,11 @@ public final class EventHelper { return false; } + if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) { + // do not generate events for an notify event + return false; + } + boolean answer = false; CamelEvent event = null; // optimise for loop using index access to avoid creating iterator object @@ -746,11 +746,6 @@ public final class EventHelper { } public static boolean notifyExchangeRedelivery(CamelContext context, Exchange exchange, int attempt) { - if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) { - // do not generate events for an notify event - return false; - } - ManagementStrategy management = context.getManagementStrategy(); if (management == null) { return false; @@ -766,6 +761,11 @@ public final class EventHelper { return false; } + if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) { + // do not generate events for an notify event + return false; + } + boolean answer = false; CamelEvent event = null; // optimise for loop using index access to avoid creating iterator object @@ -792,11 +792,6 @@ public final class EventHelper { } public static boolean notifyExchangeSending(CamelContext context, Exchange exchange, Endpoint endpoint) { - if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) { - // do not generate events for an notify event - return false; - } - ManagementStrategy management = context.getManagementStrategy(); if (management == null) { return false; @@ -812,6 +807,11 @@ public final class EventHelper { return false; } + if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) { + // do not generate events for an notify event + return false; + } + boolean answer = false; CamelEvent event = null; // optimise for loop using index access to avoid creating iterator object @@ -838,11 +838,6 @@ public final class EventHelper { } public static boolean notifyExchangeSent(CamelContext context, Exchange exchange, Endpoint endpoint, long timeTaken) { - if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) { - // do not generate events for an notify event - return false; - } - ManagementStrategy management = context.getManagementStrategy(); if (management == null) { return false; @@ -858,6 +853,11 @@ public final class EventHelper { return false; } + if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) { + // do not generate events for an notify event + return false; + } + boolean answer = false; CamelEvent event = null; // optimise for loop using index access to avoid creating iterator object