FAQ
Repository: camel
Updated Branches:
   refs/heads/master 5fcb5ab20 -> 7474d9d16


Fixed CS


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7474d9d1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7474d9d1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7474d9d1

Branch: refs/heads/master
Commit: 7474d9d169cc2ca5595a7bcf6bd7a1acdb589d67
Parents: 5fcb5ab
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Jun 8 13:15:19 2016 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Jun 8 13:15:19 2016 +0200

----------------------------------------------------------------------
  .../camel/spring/handler/CamelNamespaceHandler.java | 11 ++++++-----
  1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7474d9d1/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java b/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
index 01c6246..ca38795 100644
--- a/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
+++ b/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
@@ -25,6 +25,12 @@ import javax.xml.bind.Binder;
  import javax.xml.bind.JAXBContext;
  import javax.xml.bind.JAXBException;

+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
  import org.apache.camel.builder.xml.Namespaces;
  import org.apache.camel.core.xml.CamelJMXAgentDefinition;
  import org.apache.camel.core.xml.CamelPropertyPlaceholderDefinition;
@@ -66,11 +72,6 @@ import org.springframework.beans.factory.parsing.BeanComponentDefinition;
  import org.springframework.beans.factory.support.BeanDefinitionBuilder;
  import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
  import org.springframework.beans.factory.xml.ParserContext;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;

  /**
   * Camel namespace for the spring XML configuration file.

Search Discussions

  • Acosentino at Jun 10, 2016 at 1:04 pm
    Repository: camel
    Updated Branches:
       refs/heads/master 014520ca1 -> 81f5a3395


    Fixed CS


    Project: http://git-wip-us.apache.org/repos/asf/camel/repo
    Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/81f5a339
    Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/81f5a339
    Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/81f5a339

    Branch: refs/heads/master
    Commit: 81f5a3395c4f61bfb752ecfa33698f84d9a70a9c
    Parents: 014520c
    Author: Andrea Cosentino <ancosen@gmail.com>
    Authored: Fri Jun 10 15:04:28 2016 +0200
    Committer: Andrea Cosentino <ancosen@gmail.com>
    Committed: Fri Jun 10 15:04:28 2016 +0200

    ----------------------------------------------------------------------
      .../org/apache/camel/converter/jaxb/FallbackTypeConverter.java | 4 ++--
      1 file changed, 2 insertions(+), 2 deletions(-)
    ----------------------------------------------------------------------


    http://git-wip-us.apache.org/repos/asf/camel/blob/81f5a339/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
    ----------------------------------------------------------------------
    diff --git a/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java b/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
    index 0ca881a..8283af6 100644
    --- a/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
    +++ b/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
    @@ -70,7 +70,7 @@ public class FallbackTypeConverter extends ServiceSupport implements TypeConvert
          private final StaxConverter staxConverter = new StaxConverter();
          private TypeConverter parentTypeConverter;
          private boolean prettyPrint = true;
    - private boolean objectFactory = false;
    + private boolean objectFactory;
          private CamelContext camelContext;

          public boolean isPrettyPrint() {
    @@ -216,7 +216,7 @@ public class FallbackTypeConverter extends ServiceSupport implements TypeConvert
              if (isObjectFactory()) {
                  return hasXmlRootElement(type) || JaxbHelper.getJaxbElementFactoryMethod(camelContext, type) != null;
              } else {
    - return hasXmlRootElement(type);
    + return hasXmlRootElement(type);
              }
          }
  • Acosentino at Jun 10, 2016 at 1:05 pm
    Repository: camel
    Updated Branches:
       refs/heads/camel-2.17.x 6c63eb100 -> b230af99f


    Fixed CS


    Project: http://git-wip-us.apache.org/repos/asf/camel/repo
    Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b230af99
    Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b230af99
    Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b230af99

    Branch: refs/heads/camel-2.17.x
    Commit: b230af99f39c509278a9dd810e309ad6d7f3c3c8
    Parents: 6c63eb1
    Author: Andrea Cosentino <ancosen@gmail.com>
    Authored: Fri Jun 10 15:04:28 2016 +0200
    Committer: Andrea Cosentino <ancosen@gmail.com>
    Committed: Fri Jun 10 15:05:24 2016 +0200

    ----------------------------------------------------------------------
      .../org/apache/camel/converter/jaxb/FallbackTypeConverter.java | 4 ++--
      1 file changed, 2 insertions(+), 2 deletions(-)
    ----------------------------------------------------------------------


    http://git-wip-us.apache.org/repos/asf/camel/blob/b230af99/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
    ----------------------------------------------------------------------
    diff --git a/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java b/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
    index 0ca881a..8283af6 100644
    --- a/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
    +++ b/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
    @@ -70,7 +70,7 @@ public class FallbackTypeConverter extends ServiceSupport implements TypeConvert
          private final StaxConverter staxConverter = new StaxConverter();
          private TypeConverter parentTypeConverter;
          private boolean prettyPrint = true;
    - private boolean objectFactory = false;
    + private boolean objectFactory;
          private CamelContext camelContext;

          public boolean isPrettyPrint() {
    @@ -216,7 +216,7 @@ public class FallbackTypeConverter extends ServiceSupport implements TypeConvert
              if (isObjectFactory()) {
                  return hasXmlRootElement(type) || JaxbHelper.getJaxbElementFactoryMethod(camelContext, type) != null;
              } else {
    - return hasXmlRootElement(type);
    + return hasXmlRootElement(type);
              }
          }
  • Davsclaus at Jun 12, 2016 at 8:54 am
    Repository: camel
    Updated Branches:
       refs/heads/camel-2.16.x f44d8652e -> 63f851c29
       refs/heads/camel-2.17.x a4c031b0f -> 2207aafb6
       refs/heads/master 1c73dfc5e -> 40cda4711


    CAMEL-10049: Context scoped processors should be shutdown when CamelContext is shutting down


    Project: http://git-wip-us.apache.org/repos/asf/camel/repo
    Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d473d460
    Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d473d460
    Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d473d460

    Branch: refs/heads/master
    Commit: d473d460717bdad1633d68fa1b15cf5c749157c0
    Parents: 1c73dfc
    Author: Claus Ibsen <davsclaus@apache.org>
    Authored: Sun Jun 12 10:47:09 2016 +0200
    Committer: Claus Ibsen <davsclaus@apache.org>
    Committed: Sun Jun 12 10:47:09 2016 +0200

    ----------------------------------------------------------------------
      .../camel/processor/DelegateAsyncProcessor.java | 4 ++
      .../OnCompletionShutdownProcessorTest.java | 75 ++++++++++++++++++++
      2 files changed, 79 insertions(+)
    ----------------------------------------------------------------------


    http://git-wip-us.apache.org/repos/asf/camel/blob/d473d460/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java
    ----------------------------------------------------------------------
    diff --git a/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java
    index 7411b8a..ddca1fe 100644
    --- a/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java
    +++ b/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java
    @@ -83,6 +83,10 @@ public class DelegateAsyncProcessor extends ServiceSupport implements DelegatePr
              ServiceHelper.stopServices(processor);
          }

    + protected void doShutdown() throws Exception {
    + ServiceHelper.stopAndShutdownServices(processor);
    + }
    +
          public void process(Exchange exchange) throws Exception {
              AsyncProcessorHelper.process(this, exchange);
          }

    http://git-wip-us.apache.org/repos/asf/camel/blob/d473d460/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java
    ----------------------------------------------------------------------
    diff --git a/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java b/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java
    new file mode 100644
    index 0000000..d1846f2
    --- /dev/null
    +++ b/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java
    @@ -0,0 +1,75 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements. See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License. You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.camel.processor;
    +
    +import org.apache.camel.ContextTestSupport;
    +import org.apache.camel.Exchange;
    +import org.apache.camel.Processor;
    +import org.apache.camel.builder.RouteBuilder;
    +import org.apache.camel.component.mock.MockEndpoint;
    +import org.apache.camel.support.ServiceSupport;
    +
    +public class OnCompletionShutdownProcessorTest extends ContextTestSupport {
    +
    + private MyProcessor processor = new MyProcessor();
    +
    + public void testSynchronizeComplete() throws Exception {
    + assertEquals("Started", processor.getStatus().name());
    +
    + MockEndpoint mock = getMockEndpoint("mock:result");
    + mock.expectedBodiesReceived("Hello World");
    +
    + template.sendBody("direct:start", "Hello World");
    +
    + assertMockEndpointsSatisfied();
    +
    + context.stop();
    +
    + assertEquals("Stopped", processor.getStatus().name());
    + }
    +
    + @Override
    + protected RouteBuilder createRouteBuilder() throws Exception {
    + return new RouteBuilder() {
    + @Override
    + public void configure() throws Exception {
    + onCompletion().process(processor);
    +
    + from("direct:start")
    + .to("mock:result");
    + }
    + };
    + }
    +
    + public static class MyProcessor extends ServiceSupport implements Processor {
    +
    + public MyProcessor() {
    + }
    +
    + public void process(Exchange exchange) throws Exception {
    + exchange.getIn().setBody("Bye World");
    + }
    +
    + protected void doStart() throws Exception {
    + // noop
    + }
    +
    + protected void doStop() throws Exception {
    + // noop
    + }
    + }
    +}
    \ No newline at end of file
  • Davsclaus at Jun 12, 2016 at 8:54 am
    CAMEL-10049: Context scoped processors should be shutdown when CamelContext is shutting down


    Project: http://git-wip-us.apache.org/repos/asf/camel/repo
    Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2207aafb
    Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2207aafb
    Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2207aafb

    Branch: refs/heads/camel-2.17.x
    Commit: 2207aafb6326c80305cb4c835e721d20136b48cb
    Parents: a4c031b
    Author: Claus Ibsen <davsclaus@apache.org>
    Authored: Sun Jun 12 10:47:09 2016 +0200
    Committer: Claus Ibsen <davsclaus@apache.org>
    Committed: Sun Jun 12 10:54:01 2016 +0200

    ----------------------------------------------------------------------
      .../camel/processor/DelegateAsyncProcessor.java | 4 ++
      .../OnCompletionShutdownProcessorTest.java | 75 ++++++++++++++++++++
      2 files changed, 79 insertions(+)
    ----------------------------------------------------------------------


    http://git-wip-us.apache.org/repos/asf/camel/blob/2207aafb/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java
    ----------------------------------------------------------------------
    diff --git a/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java
    index 7411b8a..ddca1fe 100644
    --- a/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java
    +++ b/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java
    @@ -83,6 +83,10 @@ public class DelegateAsyncProcessor extends ServiceSupport implements DelegatePr
              ServiceHelper.stopServices(processor);
          }

    + protected void doShutdown() throws Exception {
    + ServiceHelper.stopAndShutdownServices(processor);
    + }
    +
          public void process(Exchange exchange) throws Exception {
              AsyncProcessorHelper.process(this, exchange);
          }

    http://git-wip-us.apache.org/repos/asf/camel/blob/2207aafb/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java
    ----------------------------------------------------------------------
    diff --git a/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java b/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java
    new file mode 100644
    index 0000000..d1846f2
    --- /dev/null
    +++ b/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java
    @@ -0,0 +1,75 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements. See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License. You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.camel.processor;
    +
    +import org.apache.camel.ContextTestSupport;
    +import org.apache.camel.Exchange;
    +import org.apache.camel.Processor;
    +import org.apache.camel.builder.RouteBuilder;
    +import org.apache.camel.component.mock.MockEndpoint;
    +import org.apache.camel.support.ServiceSupport;
    +
    +public class OnCompletionShutdownProcessorTest extends ContextTestSupport {
    +
    + private MyProcessor processor = new MyProcessor();
    +
    + public void testSynchronizeComplete() throws Exception {
    + assertEquals("Started", processor.getStatus().name());
    +
    + MockEndpoint mock = getMockEndpoint("mock:result");
    + mock.expectedBodiesReceived("Hello World");
    +
    + template.sendBody("direct:start", "Hello World");
    +
    + assertMockEndpointsSatisfied();
    +
    + context.stop();
    +
    + assertEquals("Stopped", processor.getStatus().name());
    + }
    +
    + @Override
    + protected RouteBuilder createRouteBuilder() throws Exception {
    + return new RouteBuilder() {
    + @Override
    + public void configure() throws Exception {
    + onCompletion().process(processor);
    +
    + from("direct:start")
    + .to("mock:result");
    + }
    + };
    + }
    +
    + public static class MyProcessor extends ServiceSupport implements Processor {
    +
    + public MyProcessor() {
    + }
    +
    + public void process(Exchange exchange) throws Exception {
    + exchange.getIn().setBody("Bye World");
    + }
    +
    + protected void doStart() throws Exception {
    + // noop
    + }
    +
    + protected void doStop() throws Exception {
    + // noop
    + }
    + }
    +}
    \ No newline at end of file
  • Davsclaus at Jun 12, 2016 at 8:54 am
    Fixed CS


    Project: http://git-wip-us.apache.org/repos/asf/camel/repo
    Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/40cda471
    Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/40cda471
    Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/40cda471

    Branch: refs/heads/master
    Commit: 40cda4711e222d0100746eb797bb6d567ce08be6
    Parents: d473d46
    Author: Claus Ibsen <davsclaus@apache.org>
    Authored: Sun Jun 12 10:53:37 2016 +0200
    Committer: Claus Ibsen <davsclaus@apache.org>
    Committed: Sun Jun 12 10:53:37 2016 +0200

    ----------------------------------------------------------------------
      .../management/mbean/CamelOpenMBeanTypes.java | 47 ++++++++++++--------
      .../apache/camel/impl/DefaultCamelContext.java | 21 +--------
      .../management/mbean/ManagedCamelContext.java | 7 ++-
      3 files changed, 34 insertions(+), 41 deletions(-)
    ----------------------------------------------------------------------


    http://git-wip-us.apache.org/repos/asf/camel/blob/40cda471/camel-core/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java
    ----------------------------------------------------------------------
    diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java b/camel-core/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java
    index cb39d62..25edc09 100644
    --- a/camel-core/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java
    +++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java
    @@ -36,7 +36,8 @@ public final class CamelOpenMBeanTypes {
          }

          public static CompositeType listTypeConvertersCompositeType() throws OpenDataException {
    - return new CompositeType("types", "From/To types", new String[]{"from", "to"},
    + return new CompositeType("types", "From/To types",
    + new String[]{"from", "to"},
                      new String[]{"From type", "To type"},
                      new OpenType[]{SimpleType.STRING, SimpleType.STRING});
          }
    @@ -47,10 +48,9 @@ public final class CamelOpenMBeanTypes {
          }

          public static CompositeType listRestServicesCompositeType() throws OpenDataException {
    - return new CompositeType("rests", "Rest Services", new String[]{"url", "baseUrl", "basePath", "uriTemplate", "method", "consumes",
    - "produces", "inType", "outType", "state", "routeId", "description"},
    - new String[]{"Url", "Base Url", "Base Path", "Uri Template", "Method", "Consumes",
    - "Produces", "Input Type", "Output Type", "State", "Route Id", "Description"},
    + return new CompositeType("rests", "Rest Services",
    + new String[]{"url", "baseUrl", "basePath", "uriTemplate", "method", "consumes", "produces", "inType", "outType", "state", "routeId", "description"},
    + new String[]{"Url", "Base Url", "Base Path", "Uri Template", "Method", "Consumes", "Produces", "Input Type", "Output Type", "State", "Route Id", "Description"},
                      new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING,
                                     SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING});
          }
    @@ -61,7 +61,8 @@ public final class CamelOpenMBeanTypes {
          }

          public static CompositeType listEndpointsCompositeType() throws OpenDataException {
    - return new CompositeType("endpoints", "Endpoints", new String[]{"url", "static", "dynamic"},
    + return new CompositeType("endpoints", "Endpoints",
    + new String[]{"url", "static", "dynamic"},
                      new String[]{"Url", "Static", "Dynamic"},
                      new OpenType[]{SimpleType.STRING, SimpleType.BOOLEAN, SimpleType.BOOLEAN});
          }
    @@ -72,7 +73,8 @@ public final class CamelOpenMBeanTypes {
          }

          public static CompositeType listRuntimeEndpointsCompositeType() throws OpenDataException {
    - return new CompositeType("endpoints", "Endpoints", new String[]{"index", "url", "routeId", "direction", "static", "dynamic", "hits"},
    + return new CompositeType("endpoints", "Endpoints",
    + new String[]{"index", "url", "routeId", "direction", "static", "dynamic", "hits"},
                      new String[]{"Index", "Url", "Route Id", "Direction", "Static", "Dynamic", "Hits"},
                      new OpenType[]{SimpleType.INTEGER, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.BOOLEAN, SimpleType.BOOLEAN, SimpleType.LONG});
          }
    @@ -95,7 +97,8 @@ public final class CamelOpenMBeanTypes {
          }

          public static CompositeType explainDataFormatsCompositeType() throws OpenDataException {
    - return new CompositeType("dataformats", "DataFormats", new String[]{"option", "kind", "label", "type", "java type", "deprecated", "secret", "value", "default value", "description"},
    + return new CompositeType("dataformats", "DataFormats",
    + new String[]{"option", "kind", "label", "type", "java type", "deprecated", "secret", "value", "default value", "description"},
                      new String[]{"Option", "Kind", "Label", "Type", "Java Type", "Deprecated", "Secret", "Value", "Default Value", "Description"},
                      new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING,
                                     SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING});
    @@ -108,7 +111,8 @@ public final class CamelOpenMBeanTypes {
          }

          public static CompositeType explainEndpointsCompositeType() throws OpenDataException {
    - return new CompositeType("endpoints", "Endpoints", new String[]{"option", "kind", "group", "label", "type", "java type", "deprecated", "secret", "value", "default value", "description"},
    + return new CompositeType("endpoints", "Endpoints",
    + new String[]{"option", "kind", "group", "label", "type", "java type", "deprecated", "secret", "value", "default value", "description"},
                      new String[]{"Option", "Kind", "Group", "Label", "Type", "Java Type", "Deprecated", "Secret", "Value", "Default Value", "Description"},
                      new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING,
                                     SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING});
    @@ -120,7 +124,8 @@ public final class CamelOpenMBeanTypes {
          }

          public static CompositeType explainEipsCompositeType() throws OpenDataException {
    - return new CompositeType("eips", "EIPs", new String[]{"option", "kind", "label", "type", "java type", "deprecated", "value", "default value", "description"},
    + return new CompositeType("eips", "EIPs",
    + new String[]{"option", "kind", "label", "type", "java type", "deprecated", "value", "default value", "description"},
                      new String[]{"Option", "Kind", "Label", "Type", "Java Type", "Deprecated", "Value", "Default Value", "Description"},
                      new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING,
                                     SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING});
    @@ -132,8 +137,8 @@ public final class CamelOpenMBeanTypes {
          }

          public static CompositeType listComponentsCompositeType() throws OpenDataException {
    - return new CompositeType("components", "Components", new String[]{"name", "title", "syntax", "description", "label", "deprecated",
    - "secret", "status", "type", "groupId", "artifactId", "version"},
    + return new CompositeType("components", "Components",
    + new String[]{"name", "title", "syntax", "description", "label", "deprecated", "secret", "status", "type", "groupId", "artifactId", "version"},
                      new String[]{"Name", "Title", "Syntax", "Description", "Label", "Deprecated", "Secret", "Status", "Type", "GroupId", "ArtifactId", "Version"},
                      new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING,
                                     SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING});
    @@ -145,7 +150,8 @@ public final class CamelOpenMBeanTypes {
          }

          public static CompositeType listAwaitThreadsCompositeType() throws OpenDataException {
    - return new CompositeType("threads", "Threads", new String[]{"id", "name", "exchangeId", "routeId", "nodeId", "duration"},
    + return new CompositeType("threads", "Threads",
    + new String[]{"id", "name", "exchangeId", "routeId", "nodeId", "duration"},
                      new String[]{"Thread Id", "Thread name", "ExchangeId", "RouteId", "NodeId", "Duration"},
                      new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING});
          }
    @@ -156,7 +162,8 @@ public final class CamelOpenMBeanTypes {
          }

          public static CompositeType listEipsCompositeType() throws OpenDataException {
    - return new CompositeType("eips", "EIPs", new String[]{"name", "title", "description", "label", "status", "type"},
    + return new CompositeType("eips", "EIPs",
    + new String[]{"name", "title", "description", "label", "status", "type"},
                      new String[]{"Name", "Title", "Description", "Label", "Status", "Type"},
                      new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING});
          }
    @@ -167,7 +174,8 @@ public final class CamelOpenMBeanTypes {
          }

          public static CompositeType listInflightExchangesCompositeType() throws OpenDataException {
    - return new CompositeType("exchanges", "Exchanges", new String[]{"exchangeId", "fromRouteId", "routeId", "nodeId", "elapsed", "duration"},
    + return new CompositeType("exchanges", "Exchanges",
    + new String[]{"exchangeId", "fromRouteId", "routeId", "nodeId", "elapsed", "duration"},
                      new String[]{"Exchange Id", "From RouteId", "RouteId", "NodeId", "Elapsed", "Duration"},
                      new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING});
          }
    @@ -178,7 +186,8 @@ public final class CamelOpenMBeanTypes {
          }

          public static CompositeType choiceCompositeType() throws OpenDataException {
    - return new CompositeType("predicates", "Predicates", new String[]{"predicate", "language", "matches"},
    + return new CompositeType("predicates", "Predicates",
    + new String[]{"predicate", "language", "matches"},
                      new String[]{"Predicate", "Language", "Matches"},
                      new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.LONG});
          }
    @@ -189,7 +198,8 @@ public final class CamelOpenMBeanTypes {
          }

          public static CompositeType loadbalancerExceptionsCompositeType() throws OpenDataException {
    - return new CompositeType("exceptions", "Exceptions", new String[]{"exception", "failures"},
    + return new CompositeType("exceptions", "Exceptions",
    + new String[]{"exception", "failures"},
                      new String[]{"Exception", "Failures"},
                      new OpenType[]{SimpleType.STRING, SimpleType.LONG});
          }
    @@ -200,7 +210,8 @@ public final class CamelOpenMBeanTypes {
          }

          public static CompositeType endpointsUtilizationCompositeType() throws OpenDataException {
    - return new CompositeType("endpoints", "Endpoints", new String[]{"url", "hits"},
    + return new CompositeType("endpoints", "Endpoints",
    + new String[]{"url", "hits"},
                      new String[]{"Url", "Hits"},
                      new OpenType[]{SimpleType.STRING, SimpleType.LONG});
          }

    http://git-wip-us.apache.org/repos/asf/camel/blob/40cda471/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    ----------------------------------------------------------------------
    diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    index f3fc577..c325e89 100644
    --- a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    +++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    @@ -1879,7 +1879,6 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
                  if (json == null) {
                      return null;
                  }
    -
                  List<Map<String, String>> rows = JsonSchemaHelper.parseJsonSchema("componentProperties", json, true);

                  // selected rows to use for answer
    @@ -1892,12 +1891,10 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon

                  for (Map.Entry<String, Object> entry : options.entrySet()) {
                      String name = entry.getKey();
    -
                      // skip unwanted options which is default inherited from DefaultComponent
                      if ("camelContext".equals(name) || "endpointClass".equals(name)) {
                          continue;
                      }
    -
                      String value = "";
                      if (entry.getValue() != null) {
                          value = entry.getValue().toString();
    @@ -1930,7 +1927,6 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
                              break;
                          }
                      }
    -
                      // add as selected row
                      selected.put(name, new String[]{name, kind, group, label, required, type, javaType, deprecated, secret, value, defaultValue, description});
                  }
    @@ -1950,7 +1946,6 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
                      String secret = row.get("secret");
                      value = URISupport.sanitizePath(value);
                      String description = row.get("description");
    -
                      // always include path options
                      if (includeAllOptions) {
                          // add as selected row
    @@ -1961,7 +1956,6 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
                  }

                  json = ObjectHelper.before(json, " \"componentProperties\": {");
    -
                  StringBuilder buffer = new StringBuilder(" \"componentProperties\": {");

                  boolean first = true;
    @@ -2027,28 +2021,24 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
                      }
                      buffer.append(" }");
                  }
    -
                  buffer.append("\n }\n}\n");
    -
                  // insert the original first part of the json into the start of the buffer
                  buffer.insert(0, json);
                  return buffer.toString();
    -
              } catch (Exception e) {
                  // ignore and return empty response
                  return null;
              }
          }

    + // CHECKSTYLE:OFF
          public String explainEndpointJson(String uri, boolean includeAllOptions) {
              try {
                  URI u = new URI(uri);
    -
                  String json = getComponentParameterJsonSchema(u.getScheme());
                  if (json == null) {
                      return null;
                  }
    -
                  List<Map<String, String>> rows = JsonSchemaHelper.parseJsonSchema("properties", json, true);

                  // selected rows to use for answer
    @@ -2070,7 +2060,6 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
                          value = entry.getValue().toString();
                      }
                      value = URISupport.sanitizePath(value);
    -
                      // find type and description from the json schema
                      String type = null;
                      String kind = null;
    @@ -2097,7 +2086,6 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
                              break;
                          }
                      }
    -
                      // remember this option from the uri
                      uriOptions.put(name, new String[]{name, kind, group, label, required, type, javaType, deprecated, secret, value, defaultValue, description});
                  }
    @@ -2117,9 +2105,7 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
                      String secret = row.get("secret");
                      value = URISupport.sanitizePath(value);
                      String description = row.get("description");
    -
                      boolean isUriOption = uriOptions.containsKey(name);
    -
                      // always include from uri or path options
                      if (includeAllOptions || isUriOption || "path".equals(kind)) {
                          if (!selected.containsKey(name)) {
    @@ -2135,7 +2121,6 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon

                  // skip component properties
                  json = ObjectHelper.before(json, " \"componentProperties\": {");
    -
                  // and rewrite properties
                  StringBuilder buffer = new StringBuilder(" \"properties\": {");

    @@ -2202,18 +2187,16 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
                      }
                      buffer.append(" }");
                  }
    -
                  buffer.append("\n }\n}\n");
    -
                  // insert the original first part of the json into the start of the buffer
                  buffer.insert(0, json);
                  return buffer.toString();
    -
              } catch (Exception e) {
                  // ignore and return empty response
                  return null;
              }
          }
    + // CHECKSTYLE:ON

          public String createRouteStaticEndpointJson(String routeId) {
              // lets include dynamic as well as we want as much data as possible

    http://git-wip-us.apache.org/repos/asf/camel/blob/40cda471/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
    ----------------------------------------------------------------------
    diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
    index f4ea29b..98be807 100644
    --- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
    +++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
    @@ -703,10 +703,9 @@ public class ManagedCamelContext extends ManagedPerformanceCounter implements Ti
                      }

                      CompositeType ct = CamelOpenMBeanTypes.listComponentsCompositeType();
    - CompositeData data = new CompositeDataSupport(ct, new String[]{"name", "title", "syntax", "description", "label", "deprecated", "secret",
    - "status", "type", "groupId", "artifactId", "version"},
    - new Object[]{name, title, syntax, description, label, deprecated, secret,
    - status, type, groupId, artifactId, version});
    + CompositeData data = new CompositeDataSupport(ct,
    + new String[]{"name", "title", "syntax", "description", "label", "deprecated", "secret", "status", "type", "groupId", "artifactId", "version"},
    + new Object[]{name, title, syntax, description, label, deprecated, secret, status, type, groupId, artifactId, version});
                      answer.put(data);
                  }
                  return answer;
  • Davsclaus at Jun 12, 2016 at 8:54 am
    CAMEL-10049: Context scoped processors should be shutdown when CamelContext is shutting down


    Project: http://git-wip-us.apache.org/repos/asf/camel/repo
    Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/63f851c2
    Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/63f851c2
    Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/63f851c2

    Branch: refs/heads/camel-2.16.x
    Commit: 63f851c2948e33ae67f517653ab16cd0e0bac265
    Parents: f44d865
    Author: Claus Ibsen <davsclaus@apache.org>
    Authored: Sun Jun 12 10:47:09 2016 +0200
    Committer: Claus Ibsen <davsclaus@apache.org>
    Committed: Sun Jun 12 10:54:17 2016 +0200

    ----------------------------------------------------------------------
      .../camel/processor/DelegateAsyncProcessor.java | 4 ++
      .../OnCompletionShutdownProcessorTest.java | 75 ++++++++++++++++++++
      2 files changed, 79 insertions(+)
    ----------------------------------------------------------------------


    http://git-wip-us.apache.org/repos/asf/camel/blob/63f851c2/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java
    ----------------------------------------------------------------------
    diff --git a/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java
    index 7411b8a..ddca1fe 100644
    --- a/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java
    +++ b/camel-core/src/main/java/org/apache/camel/processor/DelegateAsyncProcessor.java
    @@ -83,6 +83,10 @@ public class DelegateAsyncProcessor extends ServiceSupport implements DelegatePr
              ServiceHelper.stopServices(processor);
          }

    + protected void doShutdown() throws Exception {
    + ServiceHelper.stopAndShutdownServices(processor);
    + }
    +
          public void process(Exchange exchange) throws Exception {
              AsyncProcessorHelper.process(this, exchange);
          }

    http://git-wip-us.apache.org/repos/asf/camel/blob/63f851c2/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java
    ----------------------------------------------------------------------
    diff --git a/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java b/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java
    new file mode 100644
    index 0000000..d1846f2
    --- /dev/null
    +++ b/camel-core/src/test/java/org/apache/camel/processor/OnCompletionShutdownProcessorTest.java
    @@ -0,0 +1,75 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements. See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License. You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.camel.processor;
    +
    +import org.apache.camel.ContextTestSupport;
    +import org.apache.camel.Exchange;
    +import org.apache.camel.Processor;
    +import org.apache.camel.builder.RouteBuilder;
    +import org.apache.camel.component.mock.MockEndpoint;
    +import org.apache.camel.support.ServiceSupport;
    +
    +public class OnCompletionShutdownProcessorTest extends ContextTestSupport {
    +
    + private MyProcessor processor = new MyProcessor();
    +
    + public void testSynchronizeComplete() throws Exception {
    + assertEquals("Started", processor.getStatus().name());
    +
    + MockEndpoint mock = getMockEndpoint("mock:result");
    + mock.expectedBodiesReceived("Hello World");
    +
    + template.sendBody("direct:start", "Hello World");
    +
    + assertMockEndpointsSatisfied();
    +
    + context.stop();
    +
    + assertEquals("Stopped", processor.getStatus().name());
    + }
    +
    + @Override
    + protected RouteBuilder createRouteBuilder() throws Exception {
    + return new RouteBuilder() {
    + @Override
    + public void configure() throws Exception {
    + onCompletion().process(processor);
    +
    + from("direct:start")
    + .to("mock:result");
    + }
    + };
    + }
    +
    + public static class MyProcessor extends ServiceSupport implements Processor {
    +
    + public MyProcessor() {
    + }
    +
    + public void process(Exchange exchange) throws Exception {
    + exchange.getIn().setBody("Bye World");
    + }
    +
    + protected void doStart() throws Exception {
    + // noop
    + }
    +
    + protected void doStop() throws Exception {
    + // noop
    + }
    + }
    +}
    \ No newline at end of file

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categoriescamel
postedJun 8, '16 at 11:15a
activeJun 12, '16 at 8:54a
posts7
users2
websitecamel.apache.org

2 users in discussion

Davsclaus: 5 posts Acosentino: 2 posts

People

Translate

site design / logo © 2018 Grokbase