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

Fix #518 Rely on configurers for Configuration classes instead of using #647

Merged
merged 1 commit into from
Jan 23, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.apache.camel.component.aws.ec2.EC2Configuration;

class AwsEc2Processor {
public static final String AWS_EC2_APPLICATION_ARCHIVE_MARKERS = "com/amazonaws";
Expand Down Expand Up @@ -58,8 +57,7 @@ void process(CombinedIndexBuildItem combinedIndexBuildItem,
Endpoint.class.getCanonicalName(),
Region.class.getCanonicalName(),
Service.class.getCanonicalName(),
CredentialScope.class.getCanonicalName(),
EC2Configuration.class.getCanonicalName()));
CredentialScope.class.getCanonicalName()));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.apache.camel.component.aws.ecs.ECSConfiguration;

class AwsEcsProcessor {

Expand Down Expand Up @@ -59,7 +58,6 @@ void process(CombinedIndexBuildItem combinedIndexBuildItem,
Endpoint.class.getCanonicalName(),
Region.class.getCanonicalName(),
Service.class.getCanonicalName(),
CredentialScope.class.getCanonicalName(),
ECSConfiguration.class.getCanonicalName()));
CredentialScope.class.getCanonicalName()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.apache.camel.component.aws.eks.EKSConfiguration;

class AwsEKSProcessor {

Expand Down Expand Up @@ -59,7 +58,6 @@ void process(CombinedIndexBuildItem combinedIndexBuildItem,
Endpoint.class.getCanonicalName(),
Region.class.getCanonicalName(),
Service.class.getCanonicalName(),
CredentialScope.class.getCanonicalName(),
EKSConfiguration.class.getCanonicalName()));
CredentialScope.class.getCanonicalName()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.apache.camel.component.aws.iam.IAMConfiguration;

class AwsIamProcessor {

Expand Down Expand Up @@ -59,7 +58,6 @@ void process(CombinedIndexBuildItem combinedIndexBuildItem,
Endpoint.class.getCanonicalName(),
Region.class.getCanonicalName(),
Service.class.getCanonicalName(),
CredentialScope.class.getCanonicalName(),
IAMConfiguration.class.getCanonicalName()));
CredentialScope.class.getCanonicalName()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.apache.camel.component.aws.firehose.KinesisFirehoseConfiguration;
import org.apache.camel.component.aws.kinesis.KinesisConfiguration;

class AwsKinesisProcessor {

Expand Down Expand Up @@ -60,8 +58,6 @@ void process(CombinedIndexBuildItem combinedIndexBuildItem,
Endpoint.class.getCanonicalName(),
Region.class.getCanonicalName(),
Service.class.getCanonicalName(),
CredentialScope.class.getCanonicalName(),
KinesisConfiguration.class.getCanonicalName(),
KinesisFirehoseConfiguration.class.getCanonicalName()));
CredentialScope.class.getCanonicalName()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.apache.camel.component.aws.kms.KMSConfiguration;

class AwsKmsProcessor {

Expand Down Expand Up @@ -59,7 +58,6 @@ void process(CombinedIndexBuildItem combinedIndexBuildItem,
Endpoint.class.getCanonicalName(),
Region.class.getCanonicalName(),
Service.class.getCanonicalName(),
CredentialScope.class.getCanonicalName(),
KMSConfiguration.class.getCanonicalName()));
CredentialScope.class.getCanonicalName()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.apache.camel.component.aws.lambda.LambdaConfiguration;

class AwsLambdaProcessor {

Expand Down Expand Up @@ -59,7 +58,6 @@ void process(CombinedIndexBuildItem combinedIndexBuildItem,
Endpoint.class.getCanonicalName(),
Region.class.getCanonicalName(),
Service.class.getCanonicalName(),
CredentialScope.class.getCanonicalName(),
LambdaConfiguration.class.getCanonicalName()));
CredentialScope.class.getCanonicalName()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
import org.apache.camel.component.aws.s3.S3Configuration;

class AwsS3Processor {

Expand Down Expand Up @@ -68,8 +67,7 @@ void process(CombinedIndexBuildItem combinedIndexBuildItem,
Region.class.getCanonicalName(),
Service.class.getCanonicalName(),
CredentialScope.class.getCanonicalName(),
AWSS3V4Signer.class.getCanonicalName(),
S3Configuration.class.getCanonicalName()));
AWSS3V4Signer.class.getCanonicalName()));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.apache.camel.component.aws.sns.SnsConfiguration;

class AwsSNSProcessor {

Expand Down Expand Up @@ -61,8 +60,7 @@ void process(CombinedIndexBuildItem combinedIndexBuildItem,
Region.class.getCanonicalName(),
Service.class.getCanonicalName(),
CredentialScope.class.getCanonicalName(),
AWS4Signer.class.getCanonicalName(),
SnsConfiguration.class.getCanonicalName()));
AWS4Signer.class.getCanonicalName()));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.apache.camel.component.aws.sqs.SqsConfiguration;

class AwsSQSProcessor {

Expand Down Expand Up @@ -61,7 +60,6 @@ void process(CombinedIndexBuildItem combinedIndexBuildItem,
Region.class.getCanonicalName(),
Service.class.getCanonicalName(),
CredentialScope.class.getCanonicalName(),
AWS4Signer.class.getCanonicalName(),
SqsConfiguration.class.getCanonicalName()));
AWS4Signer.class.getCanonicalName()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.apache.camel.component.aws.translate.TranslateConfiguration;

class AwsTranslateProcessor {

Expand Down Expand Up @@ -61,7 +60,6 @@ void process(CombinedIndexBuildItem combinedIndexBuildItem,
Region.class.getCanonicalName(),
Service.class.getCanonicalName(),
CredentialScope.class.getCanonicalName(),
AWS4Signer.class.getCanonicalName(),
TranslateConfiguration.class.getCanonicalName()));
AWS4Signer.class.getCanonicalName()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ void reflectiveItems(
.filter(ai -> {
AnnotationValue av = ai.value("loader");
boolean isLoader = av != null && av.asBoolean();
// filter out camel-base converters which are automatically inlined in the CoreStaticTypeConverterLoader
// filter out camel-base converters which are automatically inlined in the
// CoreStaticTypeConverterLoader
// need to revisit with Camel 3.0.0-M3 which should improve this area
if (ai.target().asClass().name().toString().startsWith("org.apache.camel.converter.")) {
log.debug("Ignoring core " + ai + " " + ai.target().asClass().name());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* 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.core.deployment;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;

import io.quarkus.builder.item.MultiBuildItem;

/**
* A {@link MultiBuildItem} holding a list of class names that would otherwise not be allowed to be registered for
* reflection due to a Camel Quarkus policy.
*/
public final class UnbannedReflectiveBuildItem extends MultiBuildItem {

final Set<String> classNames;

public UnbannedReflectiveBuildItem(Collection<String> classNames) {
this.classNames = new LinkedHashSet<>(classNames);
}

public UnbannedReflectiveBuildItem(String... classNames) {
this.classNames = new LinkedHashSet<>(Arrays.asList(classNames));
}

public Set<String> getClassNames() {
return Collections.unmodifiableSet(classNames);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.jaxb.deployment.JaxbFileRootBuildItem;
import org.apache.camel.component.dozer.DozerConfiguration;
import org.apache.camel.converter.dozer.DozerBeanMapperConfiguration;
import org.apache.camel.converter.dozer.DozerThreadContextClassLoader;
import org.apache.camel.quarkus.component.dozer.CamelDozerConfig;
Expand Down Expand Up @@ -121,7 +120,6 @@ void configureCamelDozer(BuildProducer<ReflectiveClassBuildItem> reflectiveClass
reflectiveClass.produce(new ReflectiveClassBuildItem(
true,
false,
DozerConfiguration.class,
DozerBeanMapperConfiguration.class));

if (camelDozerConfig.mappingFiles.isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.apache.camel.component.file.remote.FtpConfiguration;
import org.apache.camel.component.file.remote.FtpsConfiguration;
import org.apache.camel.component.file.remote.RemoteFileConfiguration;
import org.apache.camel.component.file.remote.SftpConfiguration;

class FtpProcessor {

Expand All @@ -37,11 +33,6 @@ FeatureBuildItem feature() {

@BuildStep
void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
reflectiveClass.produce(new ReflectiveClassBuildItem(true, false,
RemoteFileConfiguration.class,
FtpConfiguration.class,
FtpsConfiguration.class,
SftpConfiguration.class));

reflectiveClass.produce(new ReflectiveClassBuildItem(true, true,
"com.jcraft.jsch.CipherNone",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,11 @@

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.apache.camel.component.infinispan.InfinispanConfiguration;

class InfinispanProcessor {

private static final String FEATURE = "camel-infinispan";

@BuildStep
ReflectiveClassBuildItem reflection() {
return new ReflectiveClassBuildItem(true, true, InfinispanConfiguration.class);
}

@BuildStep
FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.apache.camel.component.paho.PahoConfiguration;
import org.eclipse.paho.client.mqttv3.internal.SSLNetworkModuleFactory;
import org.eclipse.paho.client.mqttv3.internal.TCPNetworkModuleFactory;
import org.eclipse.paho.client.mqttv3.logging.JSR47Logger;
Expand All @@ -40,8 +39,7 @@ class PahoProcessor {
private static final List<Class<?>> PAHO_REFLECTIVE_CLASSES = Arrays.asList(
JSR47Logger.class,
TCPNetworkModuleFactory.class,
SSLNetworkModuleFactory.class,
PahoConfiguration.class);
SSLNetworkModuleFactory.class);

@Inject
BuildProducer<NativeImageResourceBuildItem> resource;
Expand Down
Loading