Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve XML support #298

Merged
merged 4 commits into from
Oct 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Number of Camel languages: 8 in 2 JAR artifacts (0 deprecated)
== Miscellaneous Extensions

// others: START
Number of miscellaneous extensions: 5 in 5 JAR artifacts (0 deprecated)
Number of miscellaneous extensions: 6 in 6 JAR artifacts (0 deprecated)

[width="100%",cols="4,1,5",options="header"]
|===
Expand All @@ -142,6 +142,8 @@ Number of miscellaneous extensions: 5 in 5 JAR artifacts (0 deprecated)

| (camel-quarkus-reactive-executor) | 0.2.1 | To use Quarkus reactive executor with Camel

| (camel-quarkus-core-xml) | 0.2 | Maven plugins configuration

| xref:extensions/microprofile-health.adoc[camel-quarkus-microprofile-health] | 0.2.1 | Integration with the Quarkus MicroProfile Health extension

| xref:extensions/opentracing.adoc[camel-quarkus-opentracing] | 0.2.1 | Distributed tracing using OpenTracing
Expand Down
2 changes: 1 addition & 1 deletion extensions/aws-eks/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xml-common-deployment</artifactId>
<artifactId>camel-quarkus-support-xml-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
Expand Down
2 changes: 1 addition & 1 deletion extensions/aws-eks/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xml-common</artifactId>
<artifactId>camel-quarkus-support-xml</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
Expand Down
2 changes: 1 addition & 1 deletion extensions/aws-s3/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xml-common-deployment</artifactId>
<artifactId>camel-quarkus-support-xml-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
Expand Down
2 changes: 1 addition & 1 deletion extensions/aws-s3/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xml-common</artifactId>
<artifactId>camel-quarkus-support-xml</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
Expand Down
2 changes: 1 addition & 1 deletion extensions/aws-sns/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xml-common-deployment</artifactId>
<artifactId>camel-quarkus-support-xml-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
Expand Down
2 changes: 1 addition & 1 deletion extensions/aws-sns/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xml-common</artifactId>
<artifactId>camel-quarkus-support-xml</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
Expand Down
2 changes: 1 addition & 1 deletion extensions/aws-sqs/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xml-common-deployment</artifactId>
<artifactId>camel-quarkus-support-xml-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
Expand Down
2 changes: 1 addition & 1 deletion extensions/aws-sqs/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xml-common</artifactId>
<artifactId>camel-quarkus-support-xml</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xml-common-parent</artifactId>
<artifactId>camel-quarkus-core-xml-parent</artifactId>
<version>0.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>camel-quarkus-xml-common-deployment</artifactId>
<name>Camel Quarkus :: XML :: Common :: Deployment</name>
<artifactId>camel-quarkus-core-xml-deployment</artifactId>
<name>Camel Quarkus :: Core :: XML :: Deployment</name>

<dependencyManagement>
<dependencies>
Expand All @@ -47,12 +47,16 @@
<artifactId>camel-quarkus-core-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jaxb-deployment</artifactId>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core-xml</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xml-common</artifactId>
<artifactId>camel-quarkus-support-xml-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jaxb-deployment</artifactId>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@
*/
package org.apache.camel.quarkus.component.xml.deployment;

import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.ExecutionTime;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem;
import io.quarkus.jaxb.deployment.JaxbFileRootBuildItem;
import org.apache.camel.converter.jaxp.XmlConverter;
import org.apache.camel.quarkus.component.xml.XmlRecorder;
import org.apache.camel.quarkus.core.deployment.CamelModelJAXBContextFactoryBuildItem;
import org.apache.camel.quarkus.core.deployment.CamelRoutesCollectorBuildItem;
Expand Down Expand Up @@ -67,23 +64,4 @@ public CamelRoutesCollectorBuildItem routesCollector(XmlRecorder recorder) {
void initXmlReifiers(XmlRecorder recorder) {
recorder.initXmlReifiers();
}

@BuildStep
void reflective(BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
reflectiveClass.produce(new ReflectiveClassBuildItem(false, false,
"com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl",
"com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl",
"com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl",
"com.sun.xml.internal.stream.XMLInputFactoryImpl",
"com.sun.org.apache.xerces.internal.parsers.SAXParser",
XmlConverter.class.getCanonicalName()));

// javax.xml.namespace.QName is needed as it is used as part of the processor
// definitions in the DSL and parsers like Jackson (used in camel-k YAML DSL)
// fails if this class is cannot be instantiated reflectively.
reflectiveClass.produce(
new ReflectiveClassBuildItem(true, false, "javax.xml.namespace.QName")
);
}

}
4 changes: 2 additions & 2 deletions extensions/xml-common/pom.xml → extensions/core-xml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<relativePath>../../poms/build-parent/pom.xml</relativePath>
</parent>

<artifactId>camel-quarkus-xml-common-parent</artifactId>
<name>Camel Quarkus :: XML :: Common</name>
<artifactId>camel-quarkus-core-xml-parent</artifactId>
<name>Camel Quarkus :: Core :: XML</name>
<packaging>pom</packaging>

<modules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-xml-common-parent</artifactId>
<artifactId>camel-quarkus-core-xml-parent</artifactId>
<version>0.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>camel-quarkus-xml-common</artifactId>
<name>Camel Quarkus :: XML :: Common :: Runtime</name>
<artifactId>camel-quarkus-core-xml</artifactId>
<name>Camel Quarkus :: Core :: XML :: Runtime</name>

<dependencyManagement>
<dependencies>
Expand All @@ -47,14 +47,12 @@
<artifactId>camel-quarkus-core</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jaxb</artifactId>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-support-xml</artifactId>
</dependency>

<!-- camel -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jaxp</artifactId>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jaxb</artifactId>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class DisabledModelJAXBContextFactory implements ModelJAXBContextFactory

@Override
public JAXBContext newJAXBContext() throws JAXBException {
throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-common");
throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-core-xml");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public DisabledPredicateValidatorReifier(ValidatorDefinition definition) {

@Override
protected Validator doCreateValidator(CamelContext context) throws Exception {
throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-common");
throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-core-xml");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ public DisabledValidateReifier(ProcessorDefinition<?> definition) {

@Override
public Processor createProcessor(RouteContext routeContext) throws Exception {
throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-common");
throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-core-xml");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ public class DisabledXmlLoader implements XmlLoader {

@Override
public RoutesDefinition loadRoutesDefinition(CamelContext context, InputStream inputStream) throws Exception {
throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-common");
throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-core-xml");
}

@Override
public RestsDefinition loadRestsDefinition(CamelContext context, InputStream is) throws Exception {
throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-common");
throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-core-xml");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public class DisabledXmlRoutesCollector extends DefaultRoutesCollector {

@Override
public List<RoutesDefinition> collectXmlRoutesFromDirectory(CamelContext camelContext, String directory) {
throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-common");
throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-core-xml");
}

@Override
public List<RestsDefinition> collectXmlRestsFromDirectory(CamelContext camelContext, String directory) {
throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-common");
throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-core-xml");
}
}
2 changes: 1 addition & 1 deletion extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
<module>support</module>

<!-- common/shared extensions -->
<module>xml-common</module>
<module>core</module>
<module>core-cloud</module>
<module>core-xml</module>
<module>http-common</module>
<module>reactive-executor</module>

Expand Down
4 changes: 3 additions & 1 deletion extensions/readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Number of Camel languages: 8 in 2 JAR artifacts (0 deprecated)
== Miscellaneous Extensions

// others: START
Number of miscellaneous extensions: 5 in 5 JAR artifacts (0 deprecated)
Number of miscellaneous extensions: 6 in 6 JAR artifacts (0 deprecated)

[width="100%",cols="4,1,5",options="header"]
|===
Expand All @@ -144,6 +144,8 @@ Number of miscellaneous extensions: 5 in 5 JAR artifacts (0 deprecated)

| (camel-quarkus-reactive-executor) | 0.2.1 | To use Quarkus reactive executor with Camel

| (camel-quarkus-core-xml) | 0.2 | Maven plugins configuration

| xref:extensions/microprofile-health.adoc[camel-quarkus-microprofile-health] | 0.2.1 | Integration with the Quarkus MicroProfile Health extension

| xref:extensions/opentracing.adoc[camel-quarkus-opentracing] | 0.2.1 | Distributed tracing using OpenTracing
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* 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.quarkus.support.common.deployment;

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.FeatureBuildItem;

public class CommonSupportFeature {
private static final String FEATURE = "camel-support-common";

@BuildStep
FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.quarkus.common.runtime.graal;
package org.apache.camel.quarkus.support.common.runtime.graal;

import java.lang.reflect.Method;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.quarkus.common.runtime.graal;
package org.apache.camel.quarkus.support.common.runtime.graal;

import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* 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.quarkus.support.jetty.deployment;

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.FeatureBuildItem;

public class JettySupportFeature {
private static final String FEATURE = "camel-support-jetty";

@BuildStep
FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.quarkus.jetty.common.deployment;
package org.apache.camel.quarkus.support.jetty.deployment;

import java.util.Arrays;
import java.util.List;
Expand All @@ -25,7 +25,7 @@
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.ProtocolHandlers;

class JettyProcessor {
class JettySupportProcessor {
private static final List<Class<?>> JETTY_REFLECTIVE_CLASSES = Arrays.asList(
HttpClient.class,
ProtocolHandlers.class
Expand Down
1 change: 1 addition & 0 deletions extensions/support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
<module>common</module>
<module>jetty</module>
<module>xstream</module>
<module>xml</module>
</modules>
</project>