You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by fm...@apache.org on 2026/09/09 15:10:43 UTC
(camel-spring-boot) branch camel-spring-boot-4.22.x updated: [backport camel-spring-boot-4.22.x] CAMEL-24501: Report starter configuration options that cannot be bound - #1960
This is an automated email from the ASF dual-hosted git repository.
Croway pushed a commit to branch camel-spring-boot-4.22.x
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
The following commit(s) were added to refs/heads/camel-spring-boot-4.22.x by this push:
new e661e134063 [backport camel-spring-boot-4.22.x] CAMEL-24501: Report starter configuration options that cannot be bound - #1960
e661e134063 is described below
commit e661e1340639aa62be4a4428e8b8c82ce64939ab
Author: Federico Mariani <34...@users.noreply.github.com>
AuthorDate: Wed Sep 9 17:10:36 2026 +0200
[backport camel-spring-boot-4.22.x] CAMEL-24501: Report starter configuration options that cannot be bound - #1960
---
.../ActiveMQComponentAutoConfiguration.java | 3 +-
.../springboot/ActiveMQComponentConverter.java | 26 +--
.../ActiveMQComponentAutoConfiguration.java | 3 +-
.../springboot/ActiveMQComponentConverter.java | 26 +--
.../AiToolComponentAutoConfiguration.java | 3 +-
.../tool/springboot/AiToolComponentConverter.java | 14 +-
.../springboot/AMQPComponentAutoConfiguration.java | 3 +-
.../amqp/springboot/AMQPComponentConverter.java | 26 +--
.../ArangoDbComponentAutoConfiguration.java | 3 +-
.../springboot/ArangoDbComponentConverter.java | 16 +-
.../springboot/AS2ComponentAutoConfiguration.java | 3 +-
.../as2/springboot/AS2ComponentConverter.java | 15 +-
.../ASN1DataFormatAutoConfiguration.java | 3 +-
.../AsteriskComponentAutoConfiguration.java | 3 +-
.../WebsocketComponentAutoConfiguration.java | 3 +-
.../springboot/WebsocketComponentConverter.java | 17 +-
.../springboot/AtomComponentAutoConfiguration.java | 3 +-
.../springboot/AvroComponentAutoConfiguration.java | 3 +-
.../avro/springboot/AvroComponentConverter.java | 15 +-
.../AvroDataFormatAutoConfiguration.java | 3 +-
.../BedrockAgentComponentAutoConfiguration.java | 3 +-
.../springboot/BedrockAgentComponentConverter.java | 15 +-
...rockAgentRuntimeComponentAutoConfiguration.java | 3 +-
.../BedrockAgentRuntimeComponentConverter.java | 16 +-
.../BedrockComponentAutoConfiguration.java | 3 +-
.../springboot/BedrockComponentConverter.java | 16 +-
.../CloudtrailComponentAutoConfiguration.java | 3 +-
.../springboot/CloudtrailComponentConverter.java | 15 +-
.../AWSConfigComponentAutoConfiguration.java | 3 +-
.../springboot/AWSConfigComponentConverter.java | 15 +-
.../ParameterStoreComponentAutoConfiguration.java | 3 +-
.../ParameterStoreComponentConverter.java | 15 +-
.../SecretsManagerComponentAutoConfiguration.java | 3 +-
.../SecretsManagerComponentConverter.java | 15 +-
.../SecurityHubComponentAutoConfiguration.java | 3 +-
.../springboot/SecurityHubComponentConverter.java | 15 +-
.../Athena2ComponentAutoConfiguration.java | 3 +-
.../springboot/Athena2ComponentConverter.java | 15 +-
.../Comprehend2ComponentAutoConfiguration.java | 3 +-
.../springboot/Comprehend2ComponentConverter.java | 15 +-
.../springboot/Cw2ComponentAutoConfiguration.java | 3 +-
.../aws2/cw/springboot/Cw2ComponentConverter.java | 15 +-
.../springboot/Ddb2ComponentAutoConfiguration.java | 3 +-
.../ddb/springboot/Ddb2ComponentConverter.java | 15 +-
.../Ddb2StreamComponentAutoConfiguration.java | 3 +-
.../springboot/Ddb2StreamComponentConverter.java | 15 +-
.../AWS2EC2ComponentAutoConfiguration.java | 3 +-
.../ec2/springboot/AWS2EC2ComponentConverter.java | 15 +-
.../springboot/ECS2ComponentAutoConfiguration.java | 3 +-
.../ecs/springboot/ECS2ComponentConverter.java | 15 +-
.../springboot/EKS2ComponentAutoConfiguration.java | 3 +-
.../eks/springboot/EKS2ComponentConverter.java | 15 +-
.../EventbridgeComponentAutoConfiguration.java | 3 +-
.../springboot/EventbridgeComponentConverter.java | 15 +-
.../springboot/IAM2ComponentAutoConfiguration.java | 3 +-
.../iam/springboot/IAM2ComponentConverter.java | 15 +-
...KinesisFirehose2ComponentAutoConfiguration.java | 3 +-
.../KinesisFirehose2ComponentConverter.java | 15 +-
.../Kinesis2ComponentAutoConfiguration.java | 3 +-
.../springboot/Kinesis2ComponentConverter.java | 18 +-
.../springboot/KMS2ComponentAutoConfiguration.java | 3 +-
.../kms/springboot/KMS2ComponentConverter.java | 15 +-
.../Lambda2ComponentAutoConfiguration.java | 3 +-
.../springboot/Lambda2ComponentConverter.java | 15 +-
.../springboot/MQ2ComponentAutoConfiguration.java | 3 +-
.../aws2/mq/springboot/MQ2ComponentConverter.java | 15 +-
.../springboot/MSK2ComponentAutoConfiguration.java | 3 +-
.../msk/springboot/MSK2ComponentConverter.java | 15 +-
.../Polly2ComponentAutoConfiguration.java | 3 +-
.../polly/springboot/Polly2ComponentConverter.java | 15 +-
.../RedshiftData2ComponentAutoConfiguration.java | 3 +-
.../RedshiftData2ComponentConverter.java | 15 +-
.../Rekognition2ComponentAutoConfiguration.java | 3 +-
.../springboot/Rekognition2ComponentConverter.java | 15 +-
.../AWS2S3ComponentAutoConfiguration.java | 3 +-
.../s3/springboot/AWS2S3ComponentConverter.java | 16 +-
.../AWS2S3VectorsComponentAutoConfiguration.java | 3 +-
.../AWS2S3VectorsComponentConverter.java | 15 +-
.../springboot/Ses2ComponentAutoConfiguration.java | 3 +-
.../ses/springboot/Ses2ComponentConverter.java | 15 +-
.../springboot/Sns2ComponentAutoConfiguration.java | 3 +-
.../sns/springboot/Sns2ComponentConverter.java | 15 +-
.../springboot/Sqs2ComponentAutoConfiguration.java | 3 +-
.../sqs/springboot/Sqs2ComponentConverter.java | 15 +-
.../StepFunctions2ComponentAutoConfiguration.java | 3 +-
.../StepFunctions2ComponentConverter.java | 15 +-
.../springboot/STS2ComponentAutoConfiguration.java | 3 +-
.../sts/springboot/STS2ComponentConverter.java | 15 +-
.../Textract2ComponentAutoConfiguration.java | 3 +-
.../springboot/Textract2ComponentConverter.java | 15 +-
.../Timestream2ComponentAutoConfiguration.java | 3 +-
.../springboot/Timestream2ComponentConverter.java | 16 +-
.../Transcribe2ComponentAutoConfiguration.java | 3 +-
.../springboot/Transcribe2ComponentConverter.java | 15 +-
.../Translate2ComponentAutoConfiguration.java | 3 +-
.../springboot/Translate2ComponentConverter.java | 15 +-
.../CosmosDbComponentAutoConfiguration.java | 3 +-
.../springboot/CosmosDbComponentConverter.java | 19 +-
.../EventGridComponentAutoConfiguration.java | 3 +-
.../springboot/EventGridComponentConverter.java | 17 +-
.../EventHubsComponentAutoConfiguration.java | 3 +-
.../springboot/EventHubsComponentConverter.java | 20 +-
.../FilesComponentAutoConfiguration.java | 3 +-
.../FunctionsComponentAutoConfiguration.java | 3 +-
.../springboot/FunctionsComponentConverter.java | 16 +-
.../KeyVaultComponentAutoConfiguration.java | 3 +-
.../ServiceBusComponentAutoConfiguration.java | 3 +-
.../springboot/ServiceBusComponentConverter.java | 22 +-
.../springboot/BlobComponentAutoConfiguration.java | 3 +-
.../blob/springboot/BlobComponentConverter.java | 17 +-
.../DataLakeComponentAutoConfiguration.java | 3 +-
.../springboot/DataLakeComponentConverter.java | 18 +-
.../QueueComponentAutoConfiguration.java | 3 +-
.../queue/springboot/QueueComponentConverter.java | 16 +-
.../BarcodeDataFormatAutoConfiguration.java | 3 +-
.../Base64DataFormatAutoConfiguration.java | 3 +-
.../springboot/BeanComponentAutoConfiguration.java | 3 +-
.../ClassComponentAutoConfiguration.java | 3 +-
.../springboot/BeanLanguageAutoConfiguration.java | 3 +-
.../BeanValidatorComponentAutoConfiguration.java | 3 +-
.../BeanValidatorComponentConverter.java | 18 +-
.../BeanIODataFormatAutoConfiguration.java | 3 +-
.../BindyCsvDataFormatAutoConfiguration.java | 3 +-
...indyFixedLengthDataFormatAutoConfiguration.java | 3 +-
...ndyKeyValuePairDataFormatAutoConfiguration.java | 3 +-
.../BonitaComponentAutoConfiguration.java | 3 +-
.../springboot/BoxComponentAutoConfiguration.java | 3 +-
.../box/springboot/BoxComponentConverter.java | 16 +-
.../BraintreeComponentAutoConfiguration.java | 3 +-
.../springboot/BraintreeComponentConverter.java | 14 +-
.../BrowseComponentAutoConfiguration.java | 3 +-
.../CaffeineCacheComponentAutoConfiguration.java | 3 +-
.../CaffeineCacheComponentConverter.java | 17 +-
...affeineLoadCacheComponentAutoConfiguration.java | 3 +-
.../CaffeineLoadCacheComponentConverter.java | 17 +-
.../CassandraComponentAutoConfiguration.java | 3 +-
.../CBORDataFormatAutoConfiguration.java | 3 +-
.../ChatScriptComponentAutoConfiguration.java | 3 +-
.../ChunkComponentAutoConfiguration.java | 3 +-
.../ClickHouseComponentAutoConfiguration.java | 3 +-
.../springboot/ClickHouseComponentConverter.java | 14 +-
.../ClickUpComponentAutoConfiguration.java | 3 +-
.../springboot/CMComponentAutoConfiguration.java | 3 +-
.../springboot/CoAPComponentAutoConfiguration.java | 3 +-
.../coap/springboot/CoAPComponentConverter.java | 15 +-
.../CometdComponentAutoConfiguration.java | 3 +-
.../springboot/CometdComponentConverter.java | 15 +-
.../ConsulComponentAutoConfiguration.java | 3 +-
.../springboot/ConsulComponentConverter.java | 17 +-
.../ControlBusComponentAutoConfiguration.java | 3 +-
.../ConstantLanguageAutoConfiguration.java | 3 +-
.../HeaderLanguageAutoConfiguration.java | 3 +-
.../ExchangePropertyLanguageAutoConfiguration.java | 3 +-
.../springboot/RefLanguageAutoConfiguration.java | 3 +-
.../springboot/FileLanguageAutoConfiguration.java | 3 +-
.../SimpleLanguageAutoConfiguration.java | 3 +-
.../TokenizeLanguageAutoConfiguration.java | 3 +-
.../VariableLanguageAutoConfiguration.java | 3 +-
.../CouchbaseComponentAutoConfiguration.java | 3 +-
.../CouchDbComponentAutoConfiguration.java | 3 +-
.../springboot/CronComponentAutoConfiguration.java | 3 +-
.../springboot/PGPDataFormatAutoConfiguration.java | 3 +-
...DigitalSignatureComponentAutoConfiguration.java | 3 +-
.../DigitalSignatureComponentConverter.java | 20 +-
.../CryptoDataFormatAutoConfiguration.java | 3 +-
.../springboot/CryptoDataFormatConverter.java | 16 +-
.../springboot/CsvDataFormatAutoConfiguration.java | 3 +-
.../CxfRsComponentAutoConfiguration.java | 3 +-
.../jaxrs/springboot/CxfRsComponentConverter.java | 14 +-
.../springboot/CxfComponentAutoConfiguration.java | 3 +-
.../jaxws/springboot/CxfComponentConverter.java | 14 +-
.../CyberArkVaultComponentAutoConfiguration.java | 3 +-
.../CyberArkVaultComponentConverter.java | 15 +-
.../springboot/DaprComponentAutoConfiguration.java | 3 +-
.../dapr/springboot/DaprComponentConverter.java | 19 +-
.../DataFormatComponentAutoConfiguration.java | 3 +-
.../DataSetComponentAutoConfiguration.java | 3 +-
.../springboot/DataSetComponentConverter.java | 14 +-
.../DataSetTestComponentAutoConfiguration.java | 3 +-
.../springboot/DataSetTestComponentConverter.java | 14 +-
.../DatasonnetLanguageAutoConfiguration.java | 3 +-
.../DebeziumDb2ComponentAutoConfiguration.java | 3 +-
.../springboot/DebeziumDb2ComponentConverter.java | 14 +-
.../DebeziumMongodbComponentAutoConfiguration.java | 3 +-
.../DebeziumMongodbComponentConverter.java | 14 +-
.../DebeziumMySqlComponentAutoConfiguration.java | 3 +-
.../DebeziumMySqlComponentConverter.java | 14 +-
.../DebeziumOracleComponentAutoConfiguration.java | 3 +-
.../DebeziumOracleComponentConverter.java | 14 +-
...DebeziumPostgresComponentAutoConfiguration.java | 3 +-
.../DebeziumPostgresComponentConverter.java | 14 +-
...ebeziumSqlserverComponentAutoConfiguration.java | 3 +-
.../DebeziumSqlserverComponentConverter.java | 14 +-
.../springboot/DfdlComponentAutoConfiguration.java | 3 +-
.../DfdlDataFormatAutoConfiguration.java | 3 +-
.../Dhis2ComponentAutoConfiguration.java | 3 +-
.../dhis2/springboot/Dhis2ComponentConverter.java | 15 +-
.../DirectComponentAutoConfiguration.java | 3 +-
.../DisruptorComponentAutoConfiguration.java | 3 +-
.../DisruptorVmComponentAutoConfiguration.java | 3 +-
.../springboot/DJLComponentAutoConfiguration.java | 3 +-
.../springboot/DnsComponentAutoConfiguration.java | 3 +-
.../DockerComponentAutoConfiguration.java | 3 +-
.../springboot/DockerComponentConverter.java | 14 +-
.../DoclingComponentAutoConfiguration.java | 3 +-
.../springboot/DoclingComponentConverter.java | 14 +-
.../DrillComponentAutoConfiguration.java | 3 +-
.../DropboxComponentAutoConfiguration.java | 3 +-
.../DuckDbComponentAutoConfiguration.java | 3 +-
.../springboot/DuckDbComponentConverter.java | 14 +-
...micRouterControlComponentAutoConfiguration.java | 3 +-
.../DynamicRouterComponentAutoConfiguration.java | 3 +-
.../EhcacheComponentAutoConfiguration.java | 3 +-
.../springboot/EhcacheComponentConverter.java | 16 +-
...searchRestClientComponentAutoConfiguration.java | 3 +-
.../ElasticsearchRestClientComponentConverter.java | 15 +-
.../ElasticsearchComponentAutoConfiguration.java | 3 +-
.../ElasticsearchComponentConverter.java | 15 +-
.../springboot/ExecComponentAutoConfiguration.java | 3 +-
.../exec/springboot/ExecComponentConverter.java | 15 +-
.../FastjsonDataFormatAutoConfiguration.java | 3 +-
.../springboot/FhirComponentAutoConfiguration.java | 3 +-
.../fhir/springboot/FhirComponentConverter.java | 17 +-
.../FhirJsonDataFormatAutoConfiguration.java | 3 +-
.../FhirXmlDataFormatAutoConfiguration.java | 3 +-
.../springboot/FileComponentAutoConfiguration.java | 3 +-
.../FileWatchComponentAutoConfiguration.java | 3 +-
.../springboot/FileWatchComponentConverter.java | 14 +-
.../FlatpackComponentAutoConfiguration.java | 3 +-
.../FlatpackDataFormatAutoConfiguration.java | 3 +-
.../springboot/FlatpackDataFormatConverter.java | 15 +-
.../FlinkComponentAutoConfiguration.java | 3 +-
.../flink/springboot/FlinkComponentConverter.java | 16 +-
.../FlowableComponentAutoConfiguration.java | 3 +-
.../springboot/FopComponentAutoConfiguration.java | 3 +-
.../ForyDataFormatAutoConfiguration.java | 3 +-
.../FreemarkerComponentAutoConfiguration.java | 3 +-
.../springboot/FreemarkerComponentConverter.java | 14 +-
.../springboot/FtpComponentAutoConfiguration.java | 3 +-
.../springboot/FtpsComponentAutoConfiguration.java | 3 +-
.../springboot/SftpComponentAutoConfiguration.java | 3 +-
.../GeoCoderComponentAutoConfiguration.java | 3 +-
.../springboot/GeoCoderComponentConverter.java | 14 +-
.../springboot/GitComponentAutoConfiguration.java | 3 +-
.../GitHub2ComponentAutoConfiguration.java | 3 +-
.../GoogleBigQueryComponentAutoConfiguration.java | 3 +-
.../GoogleBigQueryComponentConverter.java | 14 +-
...oogleBigQuerySQLComponentAutoConfiguration.java | 3 +-
.../GoogleBigQuerySQLComponentConverter.java | 14 +-
.../GoogleCalendarComponentAutoConfiguration.java | 3 +-
.../GoogleCalendarComponentConverter.java | 15 +-
...leCalendarStreamComponentAutoConfiguration.java | 3 +-
.../GoogleCalendarStreamComponentConverter.java | 15 +-
.../GoogleDriveComponentAutoConfiguration.java | 3 +-
.../springboot/GoogleDriveComponentConverter.java | 15 +-
.../GoogleFirestoreComponentAutoConfiguration.java | 3 +-
.../GoogleFirestoreComponentConverter.java | 15 +-
...leCloudFunctionsComponentAutoConfiguration.java | 3 +-
.../GoogleMailComponentAutoConfiguration.java | 3 +-
.../springboot/GoogleMailComponentConverter.java | 15 +-
...GoogleMailStreamComponentAutoConfiguration.java | 3 +-
.../GoogleMailStreamComponentConverter.java | 15 +-
.../GooglePubsubComponentAutoConfiguration.java | 3 +-
.../springboot/GooglePubsubComponentConverter.java | 14 +-
...gleSecretManagerComponentAutoConfiguration.java | 3 +-
.../GoogleSheetsComponentAutoConfiguration.java | 3 +-
.../springboot/GoogleSheetsComponentConverter.java | 15 +-
...ogleSheetsStreamComponentAutoConfiguration.java | 3 +-
.../GoogleSheetsStreamComponentConverter.java | 15 +-
...loudSpeechToTextComponentAutoConfiguration.java | 3 +-
...ogleCloudStorageComponentAutoConfiguration.java | 3 +-
.../GoogleCloudStorageComponentConverter.java | 16 +-
...loudTextToSpeechComponentAutoConfiguration.java | 3 +-
.../GoogleVertexAIComponentAutoConfiguration.java | 3 +-
.../GoogleVertexAIComponentConverter.java | 16 +-
...oogleCloudVisionComponentAutoConfiguration.java | 3 +-
.../GraphqlComponentAutoConfiguration.java | 3 +-
.../springboot/GraphqlComponentConverter.java | 15 +-
.../GrokDataFormatAutoConfiguration.java | 3 +-
.../GroovyJSonlDataFormatAutoConfiguration.java | 3 +-
.../GroovyXmlDataFormatAutoConfiguration.java | 3 +-
.../GroovyLanguageAutoConfiguration.java | 3 +-
.../springboot/GrpcComponentAutoConfiguration.java | 3 +-
.../GsonDataFormatAutoConfiguration.java | 3 +-
.../HashicorpVaultComponentAutoConfiguration.java | 3 +-
...castAtomicnumberComponentAutoConfiguration.java | 3 +-
.../HazelcastAtomicnumberComponentConverter.java | 14 +-
...azelcastInstanceComponentAutoConfiguration.java | 3 +-
.../HazelcastInstanceComponentConverter.java | 14 +-
.../HazelcastListComponentAutoConfiguration.java | 3 +-
.../HazelcastListComponentConverter.java | 14 +-
.../HazelcastMapComponentAutoConfiguration.java | 3 +-
.../springboot/HazelcastMapComponentConverter.java | 14 +-
...azelcastMultimapComponentAutoConfiguration.java | 3 +-
.../HazelcastMultimapComponentConverter.java | 14 +-
...zelcastPNCounterComponentAutoConfiguration.java | 3 +-
.../HazelcastPNCounterComponentConverter.java | 14 +-
.../HazelcastQueueComponentAutoConfiguration.java | 3 +-
.../HazelcastQueueComponentConverter.java | 14 +-
...astReplicatedmapComponentAutoConfiguration.java | 3 +-
.../HazelcastReplicatedmapComponentConverter.java | 14 +-
...elcastRingbufferComponentAutoConfiguration.java | 3 +-
.../HazelcastRingbufferComponentConverter.java | 14 +-
.../HazelcastSedaComponentAutoConfiguration.java | 3 +-
.../HazelcastSedaComponentConverter.java | 14 +-
.../HazelcastSetComponentAutoConfiguration.java | 3 +-
.../springboot/HazelcastSetComponentConverter.java | 14 +-
.../HazelcastTopicComponentAutoConfiguration.java | 3 +-
.../HazelcastTopicComponentConverter.java | 14 +-
.../springboot/HL7DataFormatAutoConfiguration.java | 3 +-
.../hl7/springboot/HL7DataFormatConverter.java | 15 +-
.../Hl7TerserLanguageAutoConfiguration.java | 3 +-
.../springboot/HttpComponentAutoConfiguration.java | 3 +-
.../http/springboot/HttpComponentConverter.java | 23 +-
.../httpstarter/ThirdPartyHttpProperties.java | 39 ++++
.../HttpComponentBeanReferenceBindingTest.java | 126 ++++++++++
.../springboot/DMSComponentAutoConfiguration.java | 3 +-
.../FaceRecognitionComponentAutoConfiguration.java | 3 +-
.../FunctionGraphComponentAutoConfiguration.java | 3 +-
.../springboot/IAMComponentAutoConfiguration.java | 3 +-
...ImageRecognitionComponentAutoConfiguration.java | 3 +-
.../springboot/OBSComponentAutoConfiguration.java | 3 +-
...mpleNotificationComponentAutoConfiguration.java | 3 +-
.../HuggingFaceComponentAutoConfiguration.java | 3 +-
.../springboot/HuggingFaceComponentConverter.java | 14 +-
.../IBMCOSComponentAutoConfiguration.java | 3 +-
.../cos/springboot/IBMCOSComponentConverter.java | 15 +-
...BMSecretsManagerComponentAutoConfiguration.java | 3 +-
.../WatsonDiscoveryComponentAutoConfiguration.java | 3 +-
.../WatsonDiscoveryComponentConverter.java | 14 +-
.../WatsonLanguageComponentAutoConfiguration.java | 3 +-
.../WatsonLanguageComponentConverter.java | 14 +-
...tsonSpeechToTextComponentAutoConfiguration.java | 3 +-
.../WatsonSpeechToTextComponentConverter.java | 14 +-
...tsonTextToSpeechComponentAutoConfiguration.java | 3 +-
.../WatsonTextToSpeechComponentConverter.java | 14 +-
.../WatsonxAiComponentAutoConfiguration.java | 3 +-
.../ai/springboot/WatsonxAiComponentConverter.java | 14 +-
.../ICalDataFormatAutoConfiguration.java | 3 +-
.../springboot/IggyComponentAutoConfiguration.java | 3 +-
.../iggy/springboot/IggyComponentConverter.java | 16 +-
.../IgniteCacheComponentAutoConfiguration.java | 3 +-
.../springboot/IgniteCacheComponentConverter.java | 15 +-
.../IgniteComputeComponentAutoConfiguration.java | 3 +-
.../IgniteComputeComponentConverter.java | 15 +-
.../IgniteEventsComponentAutoConfiguration.java | 3 +-
.../springboot/IgniteEventsComponentConverter.java | 15 +-
.../IgniteIdGenComponentAutoConfiguration.java | 3 +-
.../springboot/IgniteIdGenComponentConverter.java | 15 +-
.../IgniteMessagingComponentAutoConfiguration.java | 3 +-
.../IgniteMessagingComponentConverter.java | 15 +-
.../IgniteQueueComponentAutoConfiguration.java | 3 +-
.../springboot/IgniteQueueComponentConverter.java | 15 +-
.../IgniteSetComponentAutoConfiguration.java | 3 +-
.../springboot/IgniteSetComponentConverter.java | 15 +-
...finispanEmbeddedComponentAutoConfiguration.java | 3 +-
.../InfinispanEmbeddedComponentConverter.java | 19 +-
...InfinispanRemoteComponentAutoConfiguration.java | 3 +-
.../InfinispanRemoteComponentConverter.java | 19 +-
.../InfluxDbComponentAutoConfiguration.java | 3 +-
.../springboot/InfluxDbComponentConverter.java | 14 +-
.../InfluxDb2ComponentAutoConfiguration.java | 3 +-
.../springboot/InfluxDb2ComponentConverter.java | 14 +-
.../Iso8583DataFormatAutoConfiguration.java | 3 +-
.../JacksonAvroDataFormatAutoConfiguration.java | 3 +-
...JacksonProtobufDataFormatAutoConfiguration.java | 3 +-
.../JacksonDataFormatAutoConfiguration.java | 3 +-
.../springboot/JacksonDataFormatConverter.java | 15 +-
.../JacksonAvroDataFormatAutoConfiguration.java | 3 +-
...JacksonProtobufDataFormatAutoConfiguration.java | 3 +-
.../JacksonDataFormatAutoConfiguration.java | 3 +-
.../springboot/JacksonDataFormatConverter.java | 15 +-
.../JacksonXMLDataFormatAutoConfiguration.java | 3 +-
.../JacksonXMLDataFormatAutoConfiguration.java | 3 +-
.../springboot/JactlLanguageAutoConfiguration.java | 3 +-
.../JavaScriptLanguageAutoConfiguration.java | 3 +-
.../JaxbDataFormatAutoConfiguration.java | 3 +-
.../JCacheComponentAutoConfiguration.java | 3 +-
.../springboot/JCacheComponentConverter.java | 14 +-
.../springboot/JcrComponentAutoConfiguration.java | 3 +-
.../springboot/JdbcComponentAutoConfiguration.java | 3 +-
.../jdbc/springboot/JdbcComponentConverter.java | 15 +-
.../JettyHttpComponentAutoConfiguration12.java | 3 +-
.../springboot/JettyHttpComponentConverter12.java | 22 +-
.../JGroupsRaftComponentAutoConfiguration.java | 3 +-
.../springboot/JGroupsRaftComponentConverter.java | 15 +-
.../JGroupsComponentAutoConfiguration.java | 3 +-
.../springboot/JGroupsComponentConverter.java | 14 +-
.../springboot/JiraComponentAutoConfiguration.java | 3 +-
.../jira/springboot/JiraComponentConverter.java | 14 +-
.../springboot/JmsComponentAutoConfiguration.java | 3 +-
.../jms/springboot/JmsComponentConverter.java | 26 +--
.../springboot/JMXComponentAutoConfiguration.java | 3 +-
.../springboot/JoltComponentAutoConfiguration.java | 3 +-
.../jolt/springboot/JoltComponentConverter.java | 14 +-
.../springboot/JooqComponentAutoConfiguration.java | 3 +-
.../jooq/springboot/JooqComponentConverter.java | 15 +-
.../springboot/JavaLanguageAutoConfiguration.java | 3 +-
.../springboot/JoorLanguageAutoConfiguration.java | 3 +-
.../springboot/JpaComponentAutoConfiguration.java | 3 +-
.../jpa/springboot/JpaComponentConverter.java | 15 +-
.../jq/springboot/JqLanguageAutoConfiguration.java | 3 +-
.../springboot/ScpComponentAutoConfiguration.java | 3 +-
.../springboot/JsltComponentAutoConfiguration.java | 3 +-
.../jslt/springboot/JsltComponentConverter.java | 14 +-
.../JsonValidatorComponentAutoConfiguration.java | 3 +-
.../JsonApiDataFormatAutoConfiguration.java | 3 +-
.../JsonataComponentAutoConfiguration.java | 3 +-
.../springboot/JsonataComponentConverter.java | 14 +-
.../JsonbDataFormatAutoConfiguration.java | 3 +-
.../JsonPathLanguageAutoConfiguration.java | 3 +-
.../Jt400ComponentAutoConfiguration.java | 3 +-
.../jt400/springboot/Jt400ComponentConverter.java | 14 +-
.../springboot/JteComponentAutoConfiguration.java | 3 +-
.../KafkaComponentAutoConfiguration.java | 3 +-
.../kafka/springboot/KafkaComponentConverter.java | 23 +-
.../KameletComponentAutoConfiguration.java | 3 +-
.../springboot/KameletComponentConverter.java | 14 +-
.../KeycloakComponentAutoConfiguration.java | 3 +-
.../springboot/KeycloakComponentConverter.java | 15 +-
.../KnativeComponentAutoConfiguration.java | 3 +-
.../springboot/KnativeComponentConverter.java | 18 +-
.../KServeComponentAutoConfiguration.java | 3 +-
.../springboot/KServeComponentConverter.java | 15 +-
...rnetesConfigMapsComponentAutoConfiguration.java | 3 +-
.../KubernetesConfigMapsComponentConverter.java | 14 +-
...ubernetesCronJobComponentAutoConfiguration.java | 3 +-
.../KubernetesCronJobComponentConverter.java | 14 +-
...sCustomResourcesComponentAutoConfiguration.java | 3 +-
...ubernetesCustomResourcesComponentConverter.java | 14 +-
...netesDeploymentsComponentAutoConfiguration.java | 3 +-
.../KubernetesDeploymentsComponentConverter.java | 14 +-
...KubernetesEventsComponentAutoConfiguration.java | 3 +-
.../KubernetesEventsComponentConverter.java | 14 +-
.../KubernetesHPAComponentAutoConfiguration.java | 3 +-
.../KubernetesHPAComponentConverter.java | 14 +-
.../KubernetesJobComponentAutoConfiguration.java | 3 +-
.../KubernetesJobComponentConverter.java | 14 +-
...rnetesNamespacesComponentAutoConfiguration.java | 3 +-
.../KubernetesNamespacesComponentConverter.java | 14 +-
.../KubernetesNodesComponentAutoConfiguration.java | 3 +-
.../KubernetesNodesComponentConverter.java | 14 +-
...ersistentVolumesComponentAutoConfiguration.java | 3 +-
...ernetesPersistentVolumesComponentConverter.java | 14 +-
...entVolumesClaimsComponentAutoConfiguration.java | 3 +-
...sPersistentVolumesClaimsComponentConverter.java | 14 +-
.../KubernetesPodsComponentAutoConfiguration.java | 3 +-
.../KubernetesPodsComponentConverter.java | 14 +-
...ationControllersComponentAutoConfiguration.java | 3 +-
...esReplicationControllersComponentConverter.java | 14 +-
...esResourcesQuotaComponentAutoConfiguration.java | 3 +-
...KubernetesResourcesQuotaComponentConverter.java | 14 +-
...ubernetesSecretsComponentAutoConfiguration.java | 3 +-
.../KubernetesSecretsComponentConverter.java | 14 +-
...sServiceAccountsComponentAutoConfiguration.java | 3 +-
...ubernetesServiceAccountsComponentConverter.java | 14 +-
...bernetesServicesComponentAutoConfiguration.java | 3 +-
.../KubernetesServicesComponentConverter.java | 14 +-
...hiftBuildConfigsComponentAutoConfiguration.java | 3 +-
.../OpenshiftBuildConfigsComponentConverter.java | 14 +-
.../OpenshiftBuildsComponentAutoConfiguration.java | 3 +-
.../OpenshiftBuildsComponentConverter.java | 14 +-
...eploymentConfigsComponentAutoConfiguration.java | 3 +-
...enshiftDeploymentConfigsComponentConverter.java | 14 +-
.../springboot/KuduComponentAutoConfiguration.java | 3 +-
.../kudu/springboot/KuduComponentConverter.java | 14 +-
...LangChain4jAgentComponentAutoConfiguration.java | 3 +-
.../LangChain4jAgentComponentConverter.java | 17 +-
.../LangChain4jChatComponentAutoConfiguration.java | 3 +-
.../LangChain4jChatComponentConverter.java | 15 +-
...hain4jEmbeddingsComponentAutoConfiguration.java | 3 +-
.../LangChain4jEmbeddingsComponentConverter.java | 15 +-
...4jEmbeddingStoreComponentAutoConfiguration.java | 3 +-
...angChain4jEmbeddingStoreComponentConverter.java | 17 +-
...Chain4jWebSearchComponentAutoConfiguration.java | 3 +-
.../LanguageComponentAutoConfiguration.java | 3 +-
.../springboot/LdapComponentAutoConfiguration.java | 3 +-
.../springboot/LdifComponentAutoConfiguration.java | 3 +-
.../springboot/LogComponentAutoConfiguration.java | 3 +-
.../log/springboot/LogComponentConverter.java | 14 +-
.../LuceneComponentAutoConfiguration.java | 3 +-
.../springboot/LuceneComponentConverter.java | 15 +-
.../LumberjackComponentAutoConfiguration.java | 3 +-
.../springboot/LumberjackComponentConverter.java | 14 +-
.../springboot/LZFDataFormatAutoConfiguration.java | 3 +-
.../springboot/MailComponentAutoConfiguration.java | 3 +-
.../mail/springboot/MailComponentConverter.java | 22 +-
.../MimeMultipartDataFormatAutoConfiguration.java | 3 +-
.../MapstructComponentAutoConfiguration.java | 3 +-
.../springboot/MapstructComponentConverter.java | 14 +-
.../MasterComponentAutoConfiguration.java | 3 +-
.../springboot/MasterComponentConverter.java | 15 +-
.../MetricsComponentAutoConfiguration.java | 3 +-
.../springboot/MetricsComponentConverter.java | 14 +-
.../MicrometerComponentAutoConfiguration.java | 3 +-
.../springboot/MicrometerComponentConverter.java | 14 +-
.../MiloBrowseComponentAutoConfiguration.java | 3 +-
.../springboot/MiloBrowseComponentConverter.java | 15 +-
.../MiloClientComponentAutoConfiguration.java | 3 +-
.../springboot/MiloClientComponentConverter.java | 15 +-
.../MiloServerComponentAutoConfiguration.java | 3 +-
.../springboot/MiloServerComponentConverter.java | 17 +-
.../MilvusComponentAutoConfiguration.java | 3 +-
.../springboot/MilvusComponentConverter.java | 14 +-
.../MinaSftpComponentAutoConfiguration.java | 3 +-
.../springboot/MinaComponentAutoConfiguration.java | 3 +-
.../mina/springboot/MinaComponentConverter.java | 16 +-
.../MinioComponentAutoConfiguration.java | 3 +-
.../minio/springboot/MinioComponentConverter.java | 18 +-
.../springboot/MllpComponentAutoConfiguration.java | 3 +-
.../mllp/springboot/MllpComponentConverter.java | 15 +-
.../springboot/MockComponentAutoConfiguration.java | 3 +-
.../mock/springboot/MockComponentConverter.java | 14 +-
.../GridFsComponentAutoConfiguration.java | 3 +-
.../MongoDbComponentAutoConfiguration.java | 3 +-
.../springboot/MongoDbComponentConverter.java | 14 +-
.../MustacheComponentAutoConfiguration.java | 3 +-
.../springboot/MustacheComponentConverter.java | 14 +-
.../springboot/MvelComponentAutoConfiguration.java | 3 +-
.../springboot/MvelLanguageAutoConfiguration.java | 3 +-
.../MyBatisBeanComponentAutoConfiguration.java | 3 +-
.../springboot/MyBatisBeanComponentConverter.java | 14 +-
.../MyBatisComponentAutoConfiguration.java | 3 +-
.../springboot/MyBatisComponentConverter.java | 14 +-
.../springboot/NatsComponentAutoConfiguration.java | 3 +-
.../nats/springboot/NatsComponentConverter.java | 18 +-
.../Neo4jComponentAutoConfiguration.java | 3 +-
.../neo4j/springboot/Neo4jComponentConverter.java | 15 +-
.../NettyHttpComponentAutoConfiguration.java | 3 +-
.../springboot/NettyHttpComponentConverter.java | 26 +--
.../NettyComponentAutoConfiguration.java | 3 +-
.../netty/springboot/NettyComponentConverter.java | 23 +-
.../OAIPMHComponentAutoConfiguration.java | 3 +-
.../OcsfDataFormatAutoConfiguration.java | 3 +-
.../springboot/OgnlLanguageAutoConfiguration.java | 3 +-
.../Olingo2ComponentAutoConfiguration.java | 3 +-
.../springboot/Olingo2ComponentConverter.java | 20 +-
.../Olingo4ComponentAutoConfiguration.java | 3 +-
.../springboot/Olingo4ComponentConverter.java | 18 +-
.../springboot/OnceComponentAutoConfiguration.java | 3 +-
.../OpenAIComponentAutoConfiguration.java | 3 +-
.../OpensearchComponentAutoConfiguration.java | 3 +-
.../springboot/OpensearchComponentConverter.java | 16 +-
.../CinderComponentAutoConfiguration.java | 3 +-
.../GlanceComponentAutoConfiguration.java | 3 +-
.../KeystoneComponentAutoConfiguration.java | 3 +-
.../NeutronComponentAutoConfiguration.java | 3 +-
.../springboot/NovaComponentAutoConfiguration.java | 3 +-
.../SwiftComponentAutoConfiguration.java | 3 +-
.../OpenTelemetryComponentAutoConfiguration.java | 3 +-
.../OpenTelemetryComponentConverter.java | 14 +-
.../OptaPlannerComponentAutoConfiguration.java | 3 +-
.../PahoMqtt5ComponentAutoConfiguration.java | 3 +-
.../springboot/PahoMqtt5ComponentConverter.java | 19 +-
.../springboot/PahoComponentAutoConfiguration.java | 3 +-
.../paho/springboot/PahoComponentConverter.java | 18 +-
.../ParquetAvroDataFormatAutoConfiguration.java | 3 +-
.../springboot/PdfComponentAutoConfiguration.java | 3 +-
...gReplicationSlotComponentAutoConfiguration.java | 3 +-
.../PgEventComponentAutoConfiguration.java | 3 +-
...PineconeVectorDbComponentAutoConfiguration.java | 3 +-
.../PineconeVectorDbComponentConverter.java | 14 +-
.../PlatformHttpComponentAutoConfiguration.java | 3 +-
.../springboot/PlatformHttpComponentConverter.java | 15 +-
.../Plc4XComponentAutoConfiguration.java | 3 +-
.../springboot/PQCDataFormatAutoConfiguration.java | 3 +-
.../springboot/PQCDataFormatConverter.java | 16 +-
.../springboot/PQCComponentAutoConfiguration.java | 3 +-
.../pqc/springboot/PQCComponentConverter.java | 20 +-
.../PrinterComponentAutoConfiguration.java | 3 +-
.../ProtobufDataFormatAutoConfiguration.java | 3 +-
.../PubNubComponentAutoConfiguration.java | 3 +-
.../springboot/PubNubComponentConverter.java | 14 +-
.../PulsarComponentAutoConfiguration.java | 3 +-
.../springboot/PulsarComponentConverter.java | 19 +-
.../PythonLanguageAutoConfiguration.java | 3 +-
.../QdrantComponentAutoConfiguration.java | 3 +-
.../springboot/QdrantComponentConverter.java | 15 +-
.../QuartzComponentAutoConfiguration.java | 3 +-
.../springboot/QuartzComponentConverter.java | 15 +-
.../QuickfixjComponentAutoConfiguration.java | 3 +-
.../springboot/QuickfixjComponentConverter.java | 16 +-
.../ReactiveStreamsComponentAutoConfiguration.java | 3 +-
.../ReactiveStreamsComponentConverter.java | 14 +-
.../springboot/RefComponentAutoConfiguration.java | 3 +-
.../RestOpenApiComponentAutoConfiguration.java | 3 +-
.../springboot/RestOpenApiComponentConverter.java | 15 +-
.../RestApiComponentAutoConfiguration.java | 3 +-
.../springboot/RestComponentAutoConfiguration.java | 3 +-
.../rest/springboot/RestComponentConverter.java | 14 +-
.../RobotFrameworkComponentAutoConfiguration.java | 3 +-
.../RobotFrameworkComponentConverter.java | 14 +-
.../RocketMQComponentAutoConfiguration.java | 3 +-
.../springboot/RssComponentAutoConfiguration.java | 3 +-
.../springboot/RssDataFormatAutoConfiguration.java | 3 +-
.../springboot/SagaComponentAutoConfiguration.java | 3 +-
.../SalesforceComponentAutoConfiguration.java | 3 +-
.../springboot/SalesforceComponentConverter.java | 21 +-
.../NetWeaverComponentAutoConfiguration.java | 3 +-
.../XQueryComponentAutoConfiguration.java | 3 +-
.../springboot/XQueryComponentConverter.java | 15 +-
.../XQueryLanguageAutoConfiguration.java | 3 +-
.../SchedulerComponentAutoConfiguration.java | 3 +-
.../SchematronComponentAutoConfiguration.java | 3 +-
.../springboot/SedaComponentAutoConfiguration.java | 3 +-
.../seda/springboot/SedaComponentConverter.java | 14 +-
.../ServiceNowComponentAutoConfiguration.java | 3 +-
.../springboot/ServiceNowComponentConverter.java | 18 +-
.../ServletComponentAutoConfiguration.java | 3 +-
.../springboot/ServletComponentConverter.java | 17 +-
.../springboot/SjmsComponentAutoConfiguration.java | 3 +-
.../sjms/springboot/SjmsComponentConverter.java | 19 +-
.../Sjms2ComponentAutoConfiguration.java | 3 +-
.../sjms2/springboot/Sjms2ComponentConverter.java | 19 +-
.../SlackComponentAutoConfiguration.java | 3 +-
.../springboot/SmbComponentAutoConfiguration.java | 3 +-
.../SmooksComponentAutoConfiguration.java | 3 +-
.../springboot/SmooksComponentConverter.java | 14 +-
.../SmooksDataFormatAutoConfiguration.java | 3 +-
.../springboot/SmppComponentAutoConfiguration.java | 3 +-
.../smpp/springboot/SmppComponentConverter.java | 15 +-
.../SnakeYAMLDataFormatAutoConfiguration.java | 3 +-
.../springboot/SnmpComponentAutoConfiguration.java | 3 +-
.../SoapDataFormatAutoConfiguration.java | 3 +-
.../soap/springboot/SoapDataFormatConverter.java | 15 +-
.../springboot/SolrComponentAutoConfiguration.java | 3 +-
.../solr/springboot/SolrComponentConverter.java | 15 +-
.../SplunkHECComponentAutoConfiguration.java | 3 +-
.../springboot/SplunkHECComponentConverter.java | 14 +-
.../SpringAiChatComponentAutoConfiguration.java | 3 +-
.../springboot/SpringAiChatComponentConverter.java | 14 +-
...ringAiEmbeddingsComponentAutoConfiguration.java | 3 +-
.../SpringAiEmbeddingsComponentConverter.java | 15 +-
.../SpringAiImageComponentAutoConfiguration.java | 3 +-
.../SpringAiImageComponentConverter.java | 15 +-
...ingAiVectorStoreComponentAutoConfiguration.java | 3 +-
.../SpringAiVectorStoreComponentConverter.java | 15 +-
.../SpringBatchComponentAutoConfiguration.java | 3 +-
.../springboot/SpringBatchComponentConverter.java | 15 +-
.../SpringJdbcComponentAutoConfiguration.java | 3 +-
.../springboot/SpringJdbcComponentConverter.java | 15 +-
.../SpringLdapComponentAutoConfiguration.java | 3 +-
.../SpringRabbitMQComponentAutoConfiguration.java | 3 +-
.../SpringRabbitMQComponentConverter.java | 21 +-
.../RedisComponentAutoConfiguration.java | 3 +-
.../redis/springboot/RedisComponentConverter.java | 14 +-
.../EventComponentAutoConfiguration.java | 3 +-
.../springboot/SpelLanguageAutoConfiguration.java | 3 +-
...SpringWebserviceComponentAutoConfiguration.java | 3 +-
.../springboot/SqlComponentAutoConfiguration.java | 3 +-
.../sql/springboot/SqlComponentConverter.java | 15 +-
.../SqlStoredComponentAutoConfiguration.java | 3 +-
.../springboot/SqlStoredComponentConverter.java | 14 +-
.../springboot/SshComponentAutoConfiguration.java | 3 +-
.../ssh/springboot/SshComponentConverter.java | 16 +-
.../springboot/StAXComponentAutoConfiguration.java | 3 +-
.../XMLTokenizeLanguageAutoConfiguration.java | 3 +-
.../StitchComponentAutoConfiguration.java | 3 +-
.../springboot/StitchComponentConverter.java | 18 +-
.../StreamComponentAutoConfiguration.java | 3 +-
.../StringTemplateComponentAutoConfiguration.java | 3 +-
.../StripeComponentAutoConfiguration.java | 3 +-
.../springboot/StubComponentAutoConfiguration.java | 3 +-
.../stub/springboot/StubComponentConverter.java | 14 +-
.../SwiftMtDataFormatAutoConfiguration.java | 3 +-
.../SwiftMxDataFormatAutoConfiguration.java | 3 +-
.../mx/springboot/SwiftMxDataFormatConverter.java | 17 +-
.../SyslogDataFormatAutoConfiguration.java | 3 +-
.../TahuEdgeComponentAutoConfiguration.java | 3 +-
.../springboot/TahuEdgeComponentConverter.java | 15 +-
.../TahuHostComponentAutoConfiguration.java | 3 +-
.../springboot/TahuHostComponentConverter.java | 15 +-
.../TarFileDataFormatAutoConfiguration.java | 3 +-
.../TelegramComponentAutoConfiguration.java | 3 +-
.../springboot/TelegramComponentConverter.java | 14 +-
...ensorFlowServingComponentAutoConfiguration.java | 3 +-
.../TensorFlowServingComponentConverter.java | 15 +-
.../ThriftComponentAutoConfiguration.java | 3 +-
.../ThriftDataFormatAutoConfiguration.java | 3 +-
.../ThymeleafComponentAutoConfiguration.java | 3 +-
.../springboot/TikaComponentAutoConfiguration.java | 3 +-
.../TimerComponentAutoConfiguration.java | 3 +-
.../TwilioComponentAutoConfiguration.java | 3 +-
.../springboot/TwilioComponentConverter.java | 15 +-
...terDirectMessageComponentAutoConfiguration.java | 3 +-
.../TwitterSearchComponentAutoConfiguration.java | 3 +-
.../TwitterTimelineComponentAutoConfiguration.java | 3 +-
.../UndertowComponentAutoConfiguration.java | 3 +-
.../springboot/UndertowComponentConverter.java | 17 +-
.../UniVocityCsvDataFormatAutoConfiguration.java | 3 +-
.../UniVocityFixedDataFormatAutoConfiguration.java | 3 +-
.../UniVocityTsvDataFormatAutoConfiguration.java | 3 +-
.../ValidatorComponentAutoConfiguration.java | 3 +-
.../springboot/ValidatorComponentConverter.java | 14 +-
.../VelocityComponentAutoConfiguration.java | 3 +-
.../springboot/VelocityComponentConverter.java | 14 +-
.../VertxHttpComponentAutoConfiguration.java | 3 +-
.../springboot/VertxHttpComponentConverter.java | 19 +-
.../VertxComponentAutoConfiguration.java | 3 +-
.../vertx/springboot/VertxComponentConverter.java | 16 +-
.../VertxWebsocketComponentAutoConfiguration.java | 3 +-
.../VertxWebsocketComponentConverter.java | 16 +-
.../springboot/WasmComponentAutoConfiguration.java | 3 +-
.../springboot/WasmLanguageAutoConfiguration.java | 3 +-
.../WeatherComponentAutoConfiguration.java | 3 +-
...WeaviateVectorDbComponentAutoConfiguration.java | 3 +-
.../WeaviateVectorDbComponentConverter.java | 14 +-
.../Web3jComponentAutoConfiguration.java | 3 +-
.../web3j/springboot/Web3jComponentConverter.java | 16 +-
.../WebhookComponentAutoConfiguration.java | 3 +-
.../springboot/WebhookComponentConverter.java | 14 +-
.../WhatsAppComponentAutoConfiguration.java | 3 +-
.../springboot/WhatsAppComponentConverter.java | 14 +-
.../WordpressComponentAutoConfiguration.java | 3 +-
.../springboot/WordpressComponentConverter.java | 15 +-
.../WorkdayComponentAutoConfiguration.java | 3 +-
.../XChangeComponentAutoConfiguration.java | 3 +-
.../springboot/XJComponentAutoConfiguration.java | 3 +-
.../xj/springboot/XJComponentConverter.java | 17 +-
.../XmlSignerComponentAutoConfiguration.java | 3 +-
.../springboot/XmlSignerComponentConverter.java | 19 +-
.../XmlVerifierComponentAutoConfiguration.java | 3 +-
.../springboot/XmlVerifierComponentConverter.java | 19 +-
.../XMLSecurityDataFormatAutoConfiguration.java | 3 +-
.../springboot/XMLSecurityDataFormatConverter.java | 15 +-
.../springboot/XmppComponentAutoConfiguration.java | 3 +-
.../springboot/XPathLanguageAutoConfiguration.java | 3 +-
.../XsltSaxonComponentAutoConfiguration.java | 3 +-
.../springboot/XsltSaxonComponentConverter.java | 17 +-
.../springboot/XsltComponentAutoConfiguration.java | 3 +-
.../xslt/springboot/XsltComponentConverter.java | 16 +-
.../ZendeskComponentAutoConfiguration.java | 3 +-
.../springboot/ZendeskComponentConverter.java | 15 +-
.../GzipDeflaterDataFormatAutoConfiguration.java | 3 +-
.../ZipDeflaterDataFormatAutoConfiguration.java | 3 +-
.../ZipFileDataFormatAutoConfiguration.java | 3 +-
.../MasterComponentAutoConfiguration.java | 3 +-
.../springboot/MasterComponentConverter.java | 15 +-
.../ZooKeeperComponentAutoConfiguration.java | 3 +-
.../springboot/ZooKeeperComponentConverter.java | 14 +-
.../src/main/docs/spring-boot.json | 6 +
.../spring/boot/util/BeanReferenceHelper.java | 195 ++++++++++++++++
.../spring/boot/util/CamelPropertiesHelper.java | 157 +++++++++++++
.../additional-spring-configuration-metadata.json | 6 +
.../springboot/CamelPrefixedProperties.java | 38 +++
.../example/springboot/ThirdPartyProperties.java | 38 +++
.../spring/boot/util/BeanReferenceHelperTest.java | 257 +++++++++++++++++++++
.../CamelPropertiesHelperLenientBindingTest.java | 63 +++++
.../boot/util/CamelPropertiesHelperTest.java | 110 ++++++++-
.../maven/SpringBootAutoConfigurationMojo.java | 187 +++++++--------
.../maven/SpringBootAutoConfigurationMojoTest.java | 93 ++++++++
751 files changed, 2688 insertions(+), 4322 deletions(-)
diff --git a/components-starter/camel-activemq-starter/src/main/java/org/apache/camel/component/activemq/springboot/ActiveMQComponentAutoConfiguration.java b/components-starter/camel-activemq-starter/src/main/java/org/apache/camel/component/activemq/springboot/ActiveMQComponentAutoConfiguration.java
index 7a7eb5c52da..a2d48671726 100644
--- a/components-starter/camel-activemq-starter/src/main/java/org/apache/camel/component/activemq/springboot/ActiveMQComponentAutoConfiguration.java
+++ b/components-starter/camel-activemq-starter/src/main/java/org/apache/camel/component/activemq/springboot/ActiveMQComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ActiveMQComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.activemq", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-activemq-starter/src/main/java/org/apache/camel/component/activemq/springboot/ActiveMQComponentConverter.java b/components-starter/camel-activemq-starter/src/main/java/org/apache/camel/component/activemq/springboot/ActiveMQComponentConverter.java
index a57c7f2e12b..3ea7d6d875e 100644
--- a/components-starter/camel-activemq-starter/src/main/java/org/apache/camel/component/activemq/springboot/ActiveMQComponentConverter.java
+++ b/components-starter/camel-activemq-starter/src/main/java/org/apache/camel/component/activemq/springboot/ActiveMQComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.activemq.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -59,29 +60,6 @@ public class ActiveMQComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "jakarta.jms.ConnectionFactory": return applicationContext.getBean(ref, jakarta.jms.ConnectionFactory.class);
- case "org.springframework.core.task.TaskExecutor": return applicationContext.getBean(ref, org.springframework.core.task.TaskExecutor.class);
- case "org.apache.camel.component.jms.JmsConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.jms.JmsConfiguration.class);
- case "org.springframework.jms.support.destination.DestinationResolver": return applicationContext.getBean(ref, org.springframework.jms.support.destination.DestinationResolver.class);
- case "org.springframework.util.ErrorHandler": return applicationContext.getBean(ref, org.springframework.util.ErrorHandler.class);
- case "jakarta.jms.ExceptionListener": return applicationContext.getBean(ref, jakarta.jms.ExceptionListener.class);
- case "org.springframework.jms.support.converter.MessageConverter": return applicationContext.getBean(ref, org.springframework.jms.support.converter.MessageConverter.class);
- case "org.apache.camel.component.jms.MessageCreatedStrategy": return applicationContext.getBean(ref, org.apache.camel.component.jms.MessageCreatedStrategy.class);
- case "org.apache.camel.component.jms.MessageListenerContainerFactory": return applicationContext.getBean(ref, org.apache.camel.component.jms.MessageListenerContainerFactory.class);
- case "org.apache.camel.component.jms.QueueBrowseStrategy": return applicationContext.getBean(ref, org.apache.camel.component.jms.QueueBrowseStrategy.class);
- case "org.apache.camel.component.jms.TemporaryQueueResolver": return applicationContext.getBean(ref, org.apache.camel.component.jms.TemporaryQueueResolver.class);
- case "org.apache.camel.spi.HeaderFilterStrategy": return applicationContext.getBean(ref, org.apache.camel.spi.HeaderFilterStrategy.class);
- case "org.springframework.transaction.PlatformTransactionManager": return applicationContext.getBean(ref, org.springframework.transaction.PlatformTransactionManager.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.activemq");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-activemq6-starter/src/main/java/org/apache/camel/component/activemq6/springboot/ActiveMQComponentAutoConfiguration.java b/components-starter/camel-activemq6-starter/src/main/java/org/apache/camel/component/activemq6/springboot/ActiveMQComponentAutoConfiguration.java
index 8f57a5d88d3..e46331a3e8f 100644
--- a/components-starter/camel-activemq6-starter/src/main/java/org/apache/camel/component/activemq6/springboot/ActiveMQComponentAutoConfiguration.java
+++ b/components-starter/camel-activemq6-starter/src/main/java/org/apache/camel/component/activemq6/springboot/ActiveMQComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ActiveMQComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.activemq6", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-activemq6-starter/src/main/java/org/apache/camel/component/activemq6/springboot/ActiveMQComponentConverter.java b/components-starter/camel-activemq6-starter/src/main/java/org/apache/camel/component/activemq6/springboot/ActiveMQComponentConverter.java
index e3ded26f77d..e616c3f0960 100644
--- a/components-starter/camel-activemq6-starter/src/main/java/org/apache/camel/component/activemq6/springboot/ActiveMQComponentConverter.java
+++ b/components-starter/camel-activemq6-starter/src/main/java/org/apache/camel/component/activemq6/springboot/ActiveMQComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.activemq6.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -59,29 +60,6 @@ public class ActiveMQComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "jakarta.jms.ConnectionFactory": return applicationContext.getBean(ref, jakarta.jms.ConnectionFactory.class);
- case "org.springframework.core.task.TaskExecutor": return applicationContext.getBean(ref, org.springframework.core.task.TaskExecutor.class);
- case "org.apache.camel.component.jms.JmsConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.jms.JmsConfiguration.class);
- case "org.springframework.jms.support.destination.DestinationResolver": return applicationContext.getBean(ref, org.springframework.jms.support.destination.DestinationResolver.class);
- case "org.springframework.util.ErrorHandler": return applicationContext.getBean(ref, org.springframework.util.ErrorHandler.class);
- case "jakarta.jms.ExceptionListener": return applicationContext.getBean(ref, jakarta.jms.ExceptionListener.class);
- case "org.springframework.jms.support.converter.MessageConverter": return applicationContext.getBean(ref, org.springframework.jms.support.converter.MessageConverter.class);
- case "org.apache.camel.component.jms.MessageCreatedStrategy": return applicationContext.getBean(ref, org.apache.camel.component.jms.MessageCreatedStrategy.class);
- case "org.apache.camel.component.jms.MessageListenerContainerFactory": return applicationContext.getBean(ref, org.apache.camel.component.jms.MessageListenerContainerFactory.class);
- case "org.apache.camel.component.jms.QueueBrowseStrategy": return applicationContext.getBean(ref, org.apache.camel.component.jms.QueueBrowseStrategy.class);
- case "org.apache.camel.component.jms.TemporaryQueueResolver": return applicationContext.getBean(ref, org.apache.camel.component.jms.TemporaryQueueResolver.class);
- case "org.apache.camel.spi.HeaderFilterStrategy": return applicationContext.getBean(ref, org.apache.camel.spi.HeaderFilterStrategy.class);
- case "org.springframework.transaction.PlatformTransactionManager": return applicationContext.getBean(ref, org.springframework.transaction.PlatformTransactionManager.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.activemq6");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-ai-tool-starter/src/main/java/org/apache/camel/component/ai/tool/springboot/AiToolComponentAutoConfiguration.java b/components-starter/camel-ai-tool-starter/src/main/java/org/apache/camel/component/ai/tool/springboot/AiToolComponentAutoConfiguration.java
index 6e91e4a85cc..2f33b1205be 100644
--- a/components-starter/camel-ai-tool-starter/src/main/java/org/apache/camel/component/ai/tool/springboot/AiToolComponentAutoConfiguration.java
+++ b/components-starter/camel-ai-tool-starter/src/main/java/org/apache/camel/component/ai/tool/springboot/AiToolComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class AiToolComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ai-tool", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ai-tool-starter/src/main/java/org/apache/camel/component/ai/tool/springboot/AiToolComponentConverter.java b/components-starter/camel-ai-tool-starter/src/main/java/org/apache/camel/component/ai/tool/springboot/AiToolComponentConverter.java
index 3d2bbb0832e..0ee40aad4e0 100644
--- a/components-starter/camel-ai-tool-starter/src/main/java/org/apache/camel/component/ai/tool/springboot/AiToolComponentConverter.java
+++ b/components-starter/camel-ai-tool-starter/src/main/java/org/apache/camel/component/ai/tool/springboot/AiToolComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.ai.tool.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class AiToolComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.ai.tool.AiToolConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.ai.tool.AiToolConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.ai-tool");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-amqp-starter/src/main/java/org/apache/camel/component/amqp/springboot/AMQPComponentAutoConfiguration.java b/components-starter/camel-amqp-starter/src/main/java/org/apache/camel/component/amqp/springboot/AMQPComponentAutoConfiguration.java
index 4c086f522ab..6b6e62c0d89 100644
--- a/components-starter/camel-amqp-starter/src/main/java/org/apache/camel/component/amqp/springboot/AMQPComponentAutoConfiguration.java
+++ b/components-starter/camel-amqp-starter/src/main/java/org/apache/camel/component/amqp/springboot/AMQPComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class AMQPComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.amqp", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-amqp-starter/src/main/java/org/apache/camel/component/amqp/springboot/AMQPComponentConverter.java b/components-starter/camel-amqp-starter/src/main/java/org/apache/camel/component/amqp/springboot/AMQPComponentConverter.java
index 3da2d100a37..fcc6f312bee 100644
--- a/components-starter/camel-amqp-starter/src/main/java/org/apache/camel/component/amqp/springboot/AMQPComponentConverter.java
+++ b/components-starter/camel-amqp-starter/src/main/java/org/apache/camel/component/amqp/springboot/AMQPComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.amqp.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -59,29 +60,6 @@ public class AMQPComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "jakarta.jms.ConnectionFactory": return applicationContext.getBean(ref, jakarta.jms.ConnectionFactory.class);
- case "org.springframework.core.task.TaskExecutor": return applicationContext.getBean(ref, org.springframework.core.task.TaskExecutor.class);
- case "org.apache.camel.component.jms.JmsConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.jms.JmsConfiguration.class);
- case "org.springframework.jms.support.destination.DestinationResolver": return applicationContext.getBean(ref, org.springframework.jms.support.destination.DestinationResolver.class);
- case "org.springframework.util.ErrorHandler": return applicationContext.getBean(ref, org.springframework.util.ErrorHandler.class);
- case "jakarta.jms.ExceptionListener": return applicationContext.getBean(ref, jakarta.jms.ExceptionListener.class);
- case "org.springframework.jms.support.converter.MessageConverter": return applicationContext.getBean(ref, org.springframework.jms.support.converter.MessageConverter.class);
- case "org.apache.camel.component.jms.MessageCreatedStrategy": return applicationContext.getBean(ref, org.apache.camel.component.jms.MessageCreatedStrategy.class);
- case "org.apache.camel.component.jms.MessageListenerContainerFactory": return applicationContext.getBean(ref, org.apache.camel.component.jms.MessageListenerContainerFactory.class);
- case "org.apache.camel.component.jms.QueueBrowseStrategy": return applicationContext.getBean(ref, org.apache.camel.component.jms.QueueBrowseStrategy.class);
- case "org.apache.camel.component.jms.TemporaryQueueResolver": return applicationContext.getBean(ref, org.apache.camel.component.jms.TemporaryQueueResolver.class);
- case "org.apache.camel.spi.HeaderFilterStrategy": return applicationContext.getBean(ref, org.apache.camel.spi.HeaderFilterStrategy.class);
- case "org.springframework.transaction.PlatformTransactionManager": return applicationContext.getBean(ref, org.springframework.transaction.PlatformTransactionManager.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.amqp");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-arangodb-starter/src/main/java/org/apache/camel/component/arangodb/springboot/ArangoDbComponentAutoConfiguration.java b/components-starter/camel-arangodb-starter/src/main/java/org/apache/camel/component/arangodb/springboot/ArangoDbComponentAutoConfiguration.java
index d1da768efe0..74077592fb5 100644
--- a/components-starter/camel-arangodb-starter/src/main/java/org/apache/camel/component/arangodb/springboot/ArangoDbComponentAutoConfiguration.java
+++ b/components-starter/camel-arangodb-starter/src/main/java/org/apache/camel/component/arangodb/springboot/ArangoDbComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ArangoDbComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.arangodb", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-arangodb-starter/src/main/java/org/apache/camel/component/arangodb/springboot/ArangoDbComponentConverter.java b/components-starter/camel-arangodb-starter/src/main/java/org/apache/camel/component/arangodb/springboot/ArangoDbComponentConverter.java
index c46860d4380..24055aa31ab 100644
--- a/components-starter/camel-arangodb-starter/src/main/java/org/apache/camel/component/arangodb/springboot/ArangoDbComponentConverter.java
+++ b/components-starter/camel-arangodb-starter/src/main/java/org/apache/camel/component/arangodb/springboot/ArangoDbComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.arangodb.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -49,19 +50,6 @@ public class ArangoDbComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.arangodb.ArangoDbConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.arangodb.ArangoDbConfiguration.class);
- case "com.arangodb.ArangoDB": return applicationContext.getBean(ref, com.arangodb.ArangoDB.class);
- case "io.vertx.core.Vertx": return applicationContext.getBean(ref, io.vertx.core.Vertx.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.arangodb");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-as2-starter/src/main/java/org/apache/camel/component/as2/springboot/AS2ComponentAutoConfiguration.java b/components-starter/camel-as2-starter/src/main/java/org/apache/camel/component/as2/springboot/AS2ComponentAutoConfiguration.java
index 5d40ee12803..71f9470dc0e 100644
--- a/components-starter/camel-as2-starter/src/main/java/org/apache/camel/component/as2/springboot/AS2ComponentAutoConfiguration.java
+++ b/components-starter/camel-as2-starter/src/main/java/org/apache/camel/component/as2/springboot/AS2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class AS2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.as2", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-as2-starter/src/main/java/org/apache/camel/component/as2/springboot/AS2ComponentConverter.java b/components-starter/camel-as2-starter/src/main/java/org/apache/camel/component/as2/springboot/AS2ComponentConverter.java
index d41a19f828e..019e41f12ab 100644
--- a/components-starter/camel-as2-starter/src/main/java/org/apache/camel/component/as2/springboot/AS2ComponentConverter.java
+++ b/components-starter/camel-as2-starter/src/main/java/org/apache/camel/component/as2/springboot/AS2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.as2.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class AS2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.as2.AS2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.as2.AS2Configuration.class);
- case "org.apache.camel.support.jsse.SSLContextParameters": return applicationContext.getBean(ref, org.apache.camel.support.jsse.SSLContextParameters.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.as2");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-asn1-starter/src/main/java/org/apache/camel/dataformat/asn1/springboot/ASN1DataFormatAutoConfiguration.java b/components-starter/camel-asn1-starter/src/main/java/org/apache/camel/dataformat/asn1/springboot/ASN1DataFormatAutoConfiguration.java
index 5dfc79c13ec..96394e02f60 100644
--- a/components-starter/camel-asn1-starter/src/main/java/org/apache/camel/dataformat/asn1/springboot/ASN1DataFormatAutoConfiguration.java
+++ b/components-starter/camel-asn1-starter/src/main/java/org/apache/camel/dataformat/asn1/springboot/ASN1DataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class ASN1DataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.asn1", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-asterisk-starter/src/main/java/org/apache/camel/component/asterisk/springboot/AsteriskComponentAutoConfiguration.java b/components-starter/camel-asterisk-starter/src/main/java/org/apache/camel/component/asterisk/springboot/AsteriskComponentAutoConfiguration.java
index bfe033d814d..b88c766b3a7 100644
--- a/components-starter/camel-asterisk-starter/src/main/java/org/apache/camel/component/asterisk/springboot/AsteriskComponentAutoConfiguration.java
+++ b/components-starter/camel-asterisk-starter/src/main/java/org/apache/camel/component/asterisk/springboot/AsteriskComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class AsteriskComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.asterisk", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-atmosphere-websocket-starter/src/main/java/org/apache/camel/component/atmosphere/websocket/springboot/WebsocketComponentAutoConfiguration.java b/components-starter/camel-atmosphere-websocket-starter/src/main/java/org/apache/camel/component/atmosphere/websocket/springboot/WebsocketComponentAutoConfiguration.java
index fcc7ba5c527..18445759878 100644
--- a/components-starter/camel-atmosphere-websocket-starter/src/main/java/org/apache/camel/component/atmosphere/websocket/springboot/WebsocketComponentAutoConfiguration.java
+++ b/components-starter/camel-atmosphere-websocket-starter/src/main/java/org/apache/camel/component/atmosphere/websocket/springboot/WebsocketComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class WebsocketComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.atmosphere-websocket", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-atmosphere-websocket-starter/src/main/java/org/apache/camel/component/atmosphere/websocket/springboot/WebsocketComponentConverter.java b/components-starter/camel-atmosphere-websocket-starter/src/main/java/org/apache/camel/component/atmosphere/websocket/springboot/WebsocketComponentConverter.java
index fe48f10477b..48b3f7d6be0 100644
--- a/components-starter/camel-atmosphere-websocket-starter/src/main/java/org/apache/camel/component/atmosphere/websocket/springboot/WebsocketComponentConverter.java
+++ b/components-starter/camel-atmosphere-websocket-starter/src/main/java/org/apache/camel/component/atmosphere/websocket/springboot/WebsocketComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.atmosphere.websocket.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -50,20 +51,6 @@ public class WebsocketComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.http.common.HttpRegistry": return applicationContext.getBean(ref, org.apache.camel.http.common.HttpRegistry.class);
- case "org.apache.camel.http.common.HttpBinding": return applicationContext.getBean(ref, org.apache.camel.http.common.HttpBinding.class);
- case "org.apache.camel.http.common.HttpConfiguration": return applicationContext.getBean(ref, org.apache.camel.http.common.HttpConfiguration.class);
- case "org.apache.camel.spi.HeaderFilterStrategy": return applicationContext.getBean(ref, org.apache.camel.spi.HeaderFilterStrategy.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.atmosphere-websocket");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-atom-starter/src/main/java/org/apache/camel/component/atom/springboot/AtomComponentAutoConfiguration.java b/components-starter/camel-atom-starter/src/main/java/org/apache/camel/component/atom/springboot/AtomComponentAutoConfiguration.java
index be813ae7297..40f2d997331 100644
--- a/components-starter/camel-atom-starter/src/main/java/org/apache/camel/component/atom/springboot/AtomComponentAutoConfiguration.java
+++ b/components-starter/camel-atom-starter/src/main/java/org/apache/camel/component/atom/springboot/AtomComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class AtomComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.atom", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-avro-rpc-starter/src/main/java/org/apache/camel/component/avro/springboot/AvroComponentAutoConfiguration.java b/components-starter/camel-avro-rpc-starter/src/main/java/org/apache/camel/component/avro/springboot/AvroComponentAutoConfiguration.java
index fc590555ae0..913d66322ad 100644
--- a/components-starter/camel-avro-rpc-starter/src/main/java/org/apache/camel/component/avro/springboot/AvroComponentAutoConfiguration.java
+++ b/components-starter/camel-avro-rpc-starter/src/main/java/org/apache/camel/component/avro/springboot/AvroComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class AvroComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.avro", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-avro-rpc-starter/src/main/java/org/apache/camel/component/avro/springboot/AvroComponentConverter.java b/components-starter/camel-avro-rpc-starter/src/main/java/org/apache/camel/component/avro/springboot/AvroComponentConverter.java
index 24dd33ff477..c0b346f306f 100644
--- a/components-starter/camel-avro-rpc-starter/src/main/java/org/apache/camel/component/avro/springboot/AvroComponentConverter.java
+++ b/components-starter/camel-avro-rpc-starter/src/main/java/org/apache/camel/component/avro/springboot/AvroComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.avro.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class AvroComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.avro.Protocol": return applicationContext.getBean(ref, org.apache.avro.Protocol.class);
- case "org.apache.camel.component.avro.AvroConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.avro.AvroConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.avro");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-avro-starter/src/main/java/org/apache/camel/dataformat/avro/springboot/AvroDataFormatAutoConfiguration.java b/components-starter/camel-avro-starter/src/main/java/org/apache/camel/dataformat/avro/springboot/AvroDataFormatAutoConfiguration.java
index cb0be5ed812..b30a5b4bf0b 100644
--- a/components-starter/camel-avro-starter/src/main/java/org/apache/camel/dataformat/avro/springboot/AvroDataFormatAutoConfiguration.java
+++ b/components-starter/camel-avro-starter/src/main/java/org/apache/camel/dataformat/avro/springboot/AvroDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class AvroDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.avro", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agent/springboot/BedrockAgentComponentAutoConfiguration.java b/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agent/springboot/BedrockAgentComponentAutoConfiguration.java
index bb0ee8b52ff..45f2deb0fa9 100644
--- a/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agent/springboot/BedrockAgentComponentAutoConfiguration.java
+++ b/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agent/springboot/BedrockAgentComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class BedrockAgentComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws-bedrock-agent", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agent/springboot/BedrockAgentComponentConverter.java b/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agent/springboot/BedrockAgentComponentConverter.java
index 808488d5dbf..d31af0bb8e4 100644
--- a/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agent/springboot/BedrockAgentComponentConverter.java
+++ b/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agent/springboot/BedrockAgentComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.bedrock.agent.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class BedrockAgentComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.bedrock.agent.BedrockAgentConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.bedrock.agent.BedrockAgentConfiguration.class);
- case "software.amazon.awssdk.services.bedrockagent.BedrockAgentClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.bedrockagent.BedrockAgentClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws-bedrock-agent");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agentruntime/springboot/BedrockAgentRuntimeComponentAutoConfiguration.java b/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agentruntime/springboot/BedrockAgentRuntimeComponentAutoConfiguration.java
index ef9ee51cac3..511b5331143 100644
--- a/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agentruntime/springboot/BedrockAgentRuntimeComponentAutoConfiguration.java
+++ b/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agentruntime/springboot/BedrockAgentRuntimeComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class BedrockAgentRuntimeComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws-bedrock-agent-runtime", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agentruntime/springboot/BedrockAgentRuntimeComponentConverter.java b/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agentruntime/springboot/BedrockAgentRuntimeComponentConverter.java
index 10e2d7c5fd8..63bb1e355d1 100644
--- a/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agentruntime/springboot/BedrockAgentRuntimeComponentConverter.java
+++ b/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/agentruntime/springboot/BedrockAgentRuntimeComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.bedrock.agentruntime.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -51,19 +52,6 @@ public class BedrockAgentRuntimeComponentConverter
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.bedrock.agentruntime.BedrockAgentRuntimeConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.bedrock.agentruntime.BedrockAgentRuntimeConfiguration.class);
- case "software.amazon.awssdk.services.bedrockagentruntime.BedrockAgentRuntimeAsyncClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.bedrockagentruntime.BedrockAgentRuntimeAsyncClient.class);
- case "software.amazon.awssdk.services.bedrockagentruntime.BedrockAgentRuntimeClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.bedrockagentruntime.BedrockAgentRuntimeClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws-bedrock-agent-runtime");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/runtime/springboot/BedrockComponentAutoConfiguration.java b/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/runtime/springboot/BedrockComponentAutoConfiguration.java
index ce8a0a42793..d03b0b51e73 100644
--- a/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/runtime/springboot/BedrockComponentAutoConfiguration.java
+++ b/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/runtime/springboot/BedrockComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class BedrockComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws-bedrock", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/runtime/springboot/BedrockComponentConverter.java b/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/runtime/springboot/BedrockComponentConverter.java
index faba33dea30..b84348a63dc 100644
--- a/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/runtime/springboot/BedrockComponentConverter.java
+++ b/components-starter/camel-aws-bedrock-starter/src/main/java/org/apache/camel/component/aws2/bedrock/runtime/springboot/BedrockComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.bedrock.runtime.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -49,19 +50,6 @@ public class BedrockComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.bedrock.runtime.BedrockConfiguration.class);
- case "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeAsyncClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeAsyncClient.class);
- case "software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws-bedrock");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws-cloudtrail-starter/src/main/java/org/apache/camel/component/aws/cloudtrail/springboot/CloudtrailComponentAutoConfiguration.java b/components-starter/camel-aws-cloudtrail-starter/src/main/java/org/apache/camel/component/aws/cloudtrail/springboot/CloudtrailComponentAutoConfiguration.java
index 8998ea06e02..d68d2111c98 100644
--- a/components-starter/camel-aws-cloudtrail-starter/src/main/java/org/apache/camel/component/aws/cloudtrail/springboot/CloudtrailComponentAutoConfiguration.java
+++ b/components-starter/camel-aws-cloudtrail-starter/src/main/java/org/apache/camel/component/aws/cloudtrail/springboot/CloudtrailComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class CloudtrailComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws-cloudtrail", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws-cloudtrail-starter/src/main/java/org/apache/camel/component/aws/cloudtrail/springboot/CloudtrailComponentConverter.java b/components-starter/camel-aws-cloudtrail-starter/src/main/java/org/apache/camel/component/aws/cloudtrail/springboot/CloudtrailComponentConverter.java
index 086cae77f1c..ef7bbbf85eb 100644
--- a/components-starter/camel-aws-cloudtrail-starter/src/main/java/org/apache/camel/component/aws/cloudtrail/springboot/CloudtrailComponentConverter.java
+++ b/components-starter/camel-aws-cloudtrail-starter/src/main/java/org/apache/camel/component/aws/cloudtrail/springboot/CloudtrailComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws.cloudtrail.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class CloudtrailComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws.cloudtrail.CloudtrailConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.aws.cloudtrail.CloudtrailConfiguration.class);
- case "software.amazon.awssdk.services.cloudtrail.CloudTrailClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.cloudtrail.CloudTrailClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws-cloudtrail");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws-config-starter/src/main/java/org/apache/camel/component/aws/config/springboot/AWSConfigComponentAutoConfiguration.java b/components-starter/camel-aws-config-starter/src/main/java/org/apache/camel/component/aws/config/springboot/AWSConfigComponentAutoConfiguration.java
index dd605543b1c..260b78cf16a 100644
--- a/components-starter/camel-aws-config-starter/src/main/java/org/apache/camel/component/aws/config/springboot/AWSConfigComponentAutoConfiguration.java
+++ b/components-starter/camel-aws-config-starter/src/main/java/org/apache/camel/component/aws/config/springboot/AWSConfigComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class AWSConfigComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws-config", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws-config-starter/src/main/java/org/apache/camel/component/aws/config/springboot/AWSConfigComponentConverter.java b/components-starter/camel-aws-config-starter/src/main/java/org/apache/camel/component/aws/config/springboot/AWSConfigComponentConverter.java
index 136eb508625..a125067a15b 100644
--- a/components-starter/camel-aws-config-starter/src/main/java/org/apache/camel/component/aws/config/springboot/AWSConfigComponentConverter.java
+++ b/components-starter/camel-aws-config-starter/src/main/java/org/apache/camel/component/aws/config/springboot/AWSConfigComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws.config.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class AWSConfigComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws.config.AWSConfigConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.aws.config.AWSConfigConfiguration.class);
- case "software.amazon.awssdk.services.config.ConfigClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.config.ConfigClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws-config");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws-parameter-store-starter/src/main/java/org/apache/camel/component/aws/parameterstore/springboot/ParameterStoreComponentAutoConfiguration.java b/components-starter/camel-aws-parameter-store-starter/src/main/java/org/apache/camel/component/aws/parameterstore/springboot/ParameterStoreComponentAutoConfiguration.java
index 8e1e9bc9e03..a15a81c5d4e 100644
--- a/components-starter/camel-aws-parameter-store-starter/src/main/java/org/apache/camel/component/aws/parameterstore/springboot/ParameterStoreComponentAutoConfiguration.java
+++ b/components-starter/camel-aws-parameter-store-starter/src/main/java/org/apache/camel/component/aws/parameterstore/springboot/ParameterStoreComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ParameterStoreComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws-parameter-store", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws-parameter-store-starter/src/main/java/org/apache/camel/component/aws/parameterstore/springboot/ParameterStoreComponentConverter.java b/components-starter/camel-aws-parameter-store-starter/src/main/java/org/apache/camel/component/aws/parameterstore/springboot/ParameterStoreComponentConverter.java
index e02038a45c0..ea326cce7ee 100644
--- a/components-starter/camel-aws-parameter-store-starter/src/main/java/org/apache/camel/component/aws/parameterstore/springboot/ParameterStoreComponentConverter.java
+++ b/components-starter/camel-aws-parameter-store-starter/src/main/java/org/apache/camel/component/aws/parameterstore/springboot/ParameterStoreComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws.parameterstore.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class ParameterStoreComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws.parameterstore.ParameterStoreConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.aws.parameterstore.ParameterStoreConfiguration.class);
- case "software.amazon.awssdk.services.ssm.SsmClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.ssm.SsmClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws-parameter-store");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws-secrets-manager-starter/src/main/java/org/apache/camel/component/aws/secretsmanager/springboot/SecretsManagerComponentAutoConfiguration.java b/components-starter/camel-aws-secrets-manager-starter/src/main/java/org/apache/camel/component/aws/secretsmanager/springboot/SecretsManagerComponentAutoConfiguration.java
index 8a441178501..0a789bca4b2 100644
--- a/components-starter/camel-aws-secrets-manager-starter/src/main/java/org/apache/camel/component/aws/secretsmanager/springboot/SecretsManagerComponentAutoConfiguration.java
+++ b/components-starter/camel-aws-secrets-manager-starter/src/main/java/org/apache/camel/component/aws/secretsmanager/springboot/SecretsManagerComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class SecretsManagerComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws-secrets-manager", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws-secrets-manager-starter/src/main/java/org/apache/camel/component/aws/secretsmanager/springboot/SecretsManagerComponentConverter.java b/components-starter/camel-aws-secrets-manager-starter/src/main/java/org/apache/camel/component/aws/secretsmanager/springboot/SecretsManagerComponentConverter.java
index d70d77cd0bd..149f715c83a 100644
--- a/components-starter/camel-aws-secrets-manager-starter/src/main/java/org/apache/camel/component/aws/secretsmanager/springboot/SecretsManagerComponentConverter.java
+++ b/components-starter/camel-aws-secrets-manager-starter/src/main/java/org/apache/camel/component/aws/secretsmanager/springboot/SecretsManagerComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws.secretsmanager.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class SecretsManagerComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration.class);
- case "software.amazon.awssdk.services.secretsmanager.SecretsManagerClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.secretsmanager.SecretsManagerClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws-secrets-manager");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws-security-hub-starter/src/main/java/org/apache/camel/component/aws/securityhub/springboot/SecurityHubComponentAutoConfiguration.java b/components-starter/camel-aws-security-hub-starter/src/main/java/org/apache/camel/component/aws/securityhub/springboot/SecurityHubComponentAutoConfiguration.java
index a51a260f527..d6125c5b928 100644
--- a/components-starter/camel-aws-security-hub-starter/src/main/java/org/apache/camel/component/aws/securityhub/springboot/SecurityHubComponentAutoConfiguration.java
+++ b/components-starter/camel-aws-security-hub-starter/src/main/java/org/apache/camel/component/aws/securityhub/springboot/SecurityHubComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class SecurityHubComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws-security-hub", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws-security-hub-starter/src/main/java/org/apache/camel/component/aws/securityhub/springboot/SecurityHubComponentConverter.java b/components-starter/camel-aws-security-hub-starter/src/main/java/org/apache/camel/component/aws/securityhub/springboot/SecurityHubComponentConverter.java
index 81450a4fce9..70a30fe1c58 100644
--- a/components-starter/camel-aws-security-hub-starter/src/main/java/org/apache/camel/component/aws/securityhub/springboot/SecurityHubComponentConverter.java
+++ b/components-starter/camel-aws-security-hub-starter/src/main/java/org/apache/camel/component/aws/securityhub/springboot/SecurityHubComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws.securityhub.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class SecurityHubComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws.securityhub.SecurityHubConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.aws.securityhub.SecurityHubConfiguration.class);
- case "software.amazon.awssdk.services.securityhub.SecurityHubClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.securityhub.SecurityHubClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws-security-hub");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-athena-starter/src/main/java/org/apache/camel/component/aws2/athena/springboot/Athena2ComponentAutoConfiguration.java b/components-starter/camel-aws2-athena-starter/src/main/java/org/apache/camel/component/aws2/athena/springboot/Athena2ComponentAutoConfiguration.java
index 084f1b59b97..f35b962f224 100644
--- a/components-starter/camel-aws2-athena-starter/src/main/java/org/apache/camel/component/aws2/athena/springboot/Athena2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-athena-starter/src/main/java/org/apache/camel/component/aws2/athena/springboot/Athena2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Athena2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-athena", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-athena-starter/src/main/java/org/apache/camel/component/aws2/athena/springboot/Athena2ComponentConverter.java b/components-starter/camel-aws2-athena-starter/src/main/java/org/apache/camel/component/aws2/athena/springboot/Athena2ComponentConverter.java
index 4368a347ee7..ccdfa3c08f2 100644
--- a/components-starter/camel-aws2-athena-starter/src/main/java/org/apache/camel/component/aws2/athena/springboot/Athena2ComponentConverter.java
+++ b/components-starter/camel-aws2-athena-starter/src/main/java/org/apache/camel/component/aws2/athena/springboot/Athena2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.athena.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class Athena2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.athena.Athena2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.athena.Athena2Configuration.class);
- case "software.amazon.awssdk.services.athena.AthenaClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.athena.AthenaClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-athena");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-comprehend-starter/src/main/java/org/apache/camel/component/aws2/comprehend/springboot/Comprehend2ComponentAutoConfiguration.java b/components-starter/camel-aws2-comprehend-starter/src/main/java/org/apache/camel/component/aws2/comprehend/springboot/Comprehend2ComponentAutoConfiguration.java
index 6970a06e0ec..d7873996cc4 100644
--- a/components-starter/camel-aws2-comprehend-starter/src/main/java/org/apache/camel/component/aws2/comprehend/springboot/Comprehend2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-comprehend-starter/src/main/java/org/apache/camel/component/aws2/comprehend/springboot/Comprehend2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Comprehend2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-comprehend", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-comprehend-starter/src/main/java/org/apache/camel/component/aws2/comprehend/springboot/Comprehend2ComponentConverter.java b/components-starter/camel-aws2-comprehend-starter/src/main/java/org/apache/camel/component/aws2/comprehend/springboot/Comprehend2ComponentConverter.java
index f6c2296a8eb..a2c0104fefd 100644
--- a/components-starter/camel-aws2-comprehend-starter/src/main/java/org/apache/camel/component/aws2/comprehend/springboot/Comprehend2ComponentConverter.java
+++ b/components-starter/camel-aws2-comprehend-starter/src/main/java/org/apache/camel/component/aws2/comprehend/springboot/Comprehend2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.comprehend.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class Comprehend2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.comprehend.Comprehend2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.comprehend.Comprehend2Configuration.class);
- case "software.amazon.awssdk.services.comprehend.ComprehendClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.comprehend.ComprehendClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-comprehend");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-cw-starter/src/main/java/org/apache/camel/component/aws2/cw/springboot/Cw2ComponentAutoConfiguration.java b/components-starter/camel-aws2-cw-starter/src/main/java/org/apache/camel/component/aws2/cw/springboot/Cw2ComponentAutoConfiguration.java
index 3e45cef6101..7ac53ad1371 100644
--- a/components-starter/camel-aws2-cw-starter/src/main/java/org/apache/camel/component/aws2/cw/springboot/Cw2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-cw-starter/src/main/java/org/apache/camel/component/aws2/cw/springboot/Cw2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Cw2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-cw", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-cw-starter/src/main/java/org/apache/camel/component/aws2/cw/springboot/Cw2ComponentConverter.java b/components-starter/camel-aws2-cw-starter/src/main/java/org/apache/camel/component/aws2/cw/springboot/Cw2ComponentConverter.java
index b0b6bf26555..8d3956416b5 100644
--- a/components-starter/camel-aws2-cw-starter/src/main/java/org/apache/camel/component/aws2/cw/springboot/Cw2ComponentConverter.java
+++ b/components-starter/camel-aws2-cw-starter/src/main/java/org/apache/camel/component/aws2/cw/springboot/Cw2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.cw.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class Cw2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.cw.Cw2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.cw.Cw2Configuration.class);
- case "software.amazon.awssdk.services.cloudwatch.CloudWatchClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.cloudwatch.CloudWatchClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-cw");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-ddb-starter/src/main/java/org/apache/camel/component/aws2/ddb/springboot/Ddb2ComponentAutoConfiguration.java b/components-starter/camel-aws2-ddb-starter/src/main/java/org/apache/camel/component/aws2/ddb/springboot/Ddb2ComponentAutoConfiguration.java
index 1a7d6e8578b..03d13ad0615 100644
--- a/components-starter/camel-aws2-ddb-starter/src/main/java/org/apache/camel/component/aws2/ddb/springboot/Ddb2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-ddb-starter/src/main/java/org/apache/camel/component/aws2/ddb/springboot/Ddb2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Ddb2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-ddb", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-ddb-starter/src/main/java/org/apache/camel/component/aws2/ddb/springboot/Ddb2ComponentConverter.java b/components-starter/camel-aws2-ddb-starter/src/main/java/org/apache/camel/component/aws2/ddb/springboot/Ddb2ComponentConverter.java
index 75ae0b8b59a..25207ba70ac 100644
--- a/components-starter/camel-aws2-ddb-starter/src/main/java/org/apache/camel/component/aws2/ddb/springboot/Ddb2ComponentConverter.java
+++ b/components-starter/camel-aws2-ddb-starter/src/main/java/org/apache/camel/component/aws2/ddb/springboot/Ddb2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.ddb.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class Ddb2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.ddb.Ddb2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.ddb.Ddb2Configuration.class);
- case "software.amazon.awssdk.services.dynamodb.DynamoDbClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.dynamodb.DynamoDbClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-ddb");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-ddb-starter/src/main/java/org/apache/camel/component/aws2/ddbstream/springboot/Ddb2StreamComponentAutoConfiguration.java b/components-starter/camel-aws2-ddb-starter/src/main/java/org/apache/camel/component/aws2/ddbstream/springboot/Ddb2StreamComponentAutoConfiguration.java
index feb679de157..6b419f80ca0 100644
--- a/components-starter/camel-aws2-ddb-starter/src/main/java/org/apache/camel/component/aws2/ddbstream/springboot/Ddb2StreamComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-ddb-starter/src/main/java/org/apache/camel/component/aws2/ddbstream/springboot/Ddb2StreamComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Ddb2StreamComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-ddbstream", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-ddb-starter/src/main/java/org/apache/camel/component/aws2/ddbstream/springboot/Ddb2StreamComponentConverter.java b/components-starter/camel-aws2-ddb-starter/src/main/java/org/apache/camel/component/aws2/ddbstream/springboot/Ddb2StreamComponentConverter.java
index a4654163e4a..659d1bfeacf 100644
--- a/components-starter/camel-aws2-ddb-starter/src/main/java/org/apache/camel/component/aws2/ddbstream/springboot/Ddb2StreamComponentConverter.java
+++ b/components-starter/camel-aws2-ddb-starter/src/main/java/org/apache/camel/component/aws2/ddbstream/springboot/Ddb2StreamComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.ddbstream.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class Ddb2StreamComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.ddbstream.Ddb2StreamConfiguration.class);
- case "software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-ddbstream");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-ec2-starter/src/main/java/org/apache/camel/component/aws2/ec2/springboot/AWS2EC2ComponentAutoConfiguration.java b/components-starter/camel-aws2-ec2-starter/src/main/java/org/apache/camel/component/aws2/ec2/springboot/AWS2EC2ComponentAutoConfiguration.java
index 5ed9a912049..40636e2ab82 100644
--- a/components-starter/camel-aws2-ec2-starter/src/main/java/org/apache/camel/component/aws2/ec2/springboot/AWS2EC2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-ec2-starter/src/main/java/org/apache/camel/component/aws2/ec2/springboot/AWS2EC2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class AWS2EC2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-ec2", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-ec2-starter/src/main/java/org/apache/camel/component/aws2/ec2/springboot/AWS2EC2ComponentConverter.java b/components-starter/camel-aws2-ec2-starter/src/main/java/org/apache/camel/component/aws2/ec2/springboot/AWS2EC2ComponentConverter.java
index 120ee4580d5..8f1dc52ec6f 100644
--- a/components-starter/camel-aws2-ec2-starter/src/main/java/org/apache/camel/component/aws2/ec2/springboot/AWS2EC2ComponentConverter.java
+++ b/components-starter/camel-aws2-ec2-starter/src/main/java/org/apache/camel/component/aws2/ec2/springboot/AWS2EC2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.ec2.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class AWS2EC2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "software.amazon.awssdk.services.ec2.Ec2Client": return applicationContext.getBean(ref, software.amazon.awssdk.services.ec2.Ec2Client.class);
- case "org.apache.camel.component.aws2.ec2.AWS2EC2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.ec2.AWS2EC2Configuration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-ec2");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-ecs-starter/src/main/java/org/apache/camel/component/aws2/ecs/springboot/ECS2ComponentAutoConfiguration.java b/components-starter/camel-aws2-ecs-starter/src/main/java/org/apache/camel/component/aws2/ecs/springboot/ECS2ComponentAutoConfiguration.java
index 958dbd9e19c..263f2fab0ed 100644
--- a/components-starter/camel-aws2-ecs-starter/src/main/java/org/apache/camel/component/aws2/ecs/springboot/ECS2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-ecs-starter/src/main/java/org/apache/camel/component/aws2/ecs/springboot/ECS2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ECS2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-ecs", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-ecs-starter/src/main/java/org/apache/camel/component/aws2/ecs/springboot/ECS2ComponentConverter.java b/components-starter/camel-aws2-ecs-starter/src/main/java/org/apache/camel/component/aws2/ecs/springboot/ECS2ComponentConverter.java
index 16979edbb96..c3f83bf5bdb 100644
--- a/components-starter/camel-aws2-ecs-starter/src/main/java/org/apache/camel/component/aws2/ecs/springboot/ECS2ComponentConverter.java
+++ b/components-starter/camel-aws2-ecs-starter/src/main/java/org/apache/camel/component/aws2/ecs/springboot/ECS2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.ecs.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class ECS2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.ecs.ECS2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.ecs.ECS2Configuration.class);
- case "software.amazon.awssdk.services.ecs.EcsClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.ecs.EcsClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-ecs");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-eks-starter/src/main/java/org/apache/camel/component/aws2/eks/springboot/EKS2ComponentAutoConfiguration.java b/components-starter/camel-aws2-eks-starter/src/main/java/org/apache/camel/component/aws2/eks/springboot/EKS2ComponentAutoConfiguration.java
index 42eb4498216..b3609a276d7 100644
--- a/components-starter/camel-aws2-eks-starter/src/main/java/org/apache/camel/component/aws2/eks/springboot/EKS2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-eks-starter/src/main/java/org/apache/camel/component/aws2/eks/springboot/EKS2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class EKS2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-eks", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-eks-starter/src/main/java/org/apache/camel/component/aws2/eks/springboot/EKS2ComponentConverter.java b/components-starter/camel-aws2-eks-starter/src/main/java/org/apache/camel/component/aws2/eks/springboot/EKS2ComponentConverter.java
index 879f932bae8..4558ef4fd31 100644
--- a/components-starter/camel-aws2-eks-starter/src/main/java/org/apache/camel/component/aws2/eks/springboot/EKS2ComponentConverter.java
+++ b/components-starter/camel-aws2-eks-starter/src/main/java/org/apache/camel/component/aws2/eks/springboot/EKS2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.eks.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class EKS2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.eks.EKS2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.eks.EKS2Configuration.class);
- case "software.amazon.awssdk.services.eks.EksClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.eks.EksClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-eks");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-eventbridge-starter/src/main/java/org/apache/camel/component/aws2/eventbridge/springboot/EventbridgeComponentAutoConfiguration.java b/components-starter/camel-aws2-eventbridge-starter/src/main/java/org/apache/camel/component/aws2/eventbridge/springboot/EventbridgeComponentAutoConfiguration.java
index 29071cde83f..c5342d1ec24 100644
--- a/components-starter/camel-aws2-eventbridge-starter/src/main/java/org/apache/camel/component/aws2/eventbridge/springboot/EventbridgeComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-eventbridge-starter/src/main/java/org/apache/camel/component/aws2/eventbridge/springboot/EventbridgeComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class EventbridgeComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-eventbridge", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-eventbridge-starter/src/main/java/org/apache/camel/component/aws2/eventbridge/springboot/EventbridgeComponentConverter.java b/components-starter/camel-aws2-eventbridge-starter/src/main/java/org/apache/camel/component/aws2/eventbridge/springboot/EventbridgeComponentConverter.java
index 4b3cf6cfc64..71676fe022f 100644
--- a/components-starter/camel-aws2-eventbridge-starter/src/main/java/org/apache/camel/component/aws2/eventbridge/springboot/EventbridgeComponentConverter.java
+++ b/components-starter/camel-aws2-eventbridge-starter/src/main/java/org/apache/camel/component/aws2/eventbridge/springboot/EventbridgeComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.eventbridge.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class EventbridgeComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.eventbridge.EventbridgeConfiguration.class);
- case "software.amazon.awssdk.services.eventbridge.EventBridgeClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.eventbridge.EventBridgeClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-eventbridge");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-iam-starter/src/main/java/org/apache/camel/component/aws2/iam/springboot/IAM2ComponentAutoConfiguration.java b/components-starter/camel-aws2-iam-starter/src/main/java/org/apache/camel/component/aws2/iam/springboot/IAM2ComponentAutoConfiguration.java
index e2c43c08e7a..da76505f340 100644
--- a/components-starter/camel-aws2-iam-starter/src/main/java/org/apache/camel/component/aws2/iam/springboot/IAM2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-iam-starter/src/main/java/org/apache/camel/component/aws2/iam/springboot/IAM2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class IAM2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-iam", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-iam-starter/src/main/java/org/apache/camel/component/aws2/iam/springboot/IAM2ComponentConverter.java b/components-starter/camel-aws2-iam-starter/src/main/java/org/apache/camel/component/aws2/iam/springboot/IAM2ComponentConverter.java
index 8539cf47474..03bc419b890 100644
--- a/components-starter/camel-aws2-iam-starter/src/main/java/org/apache/camel/component/aws2/iam/springboot/IAM2ComponentConverter.java
+++ b/components-starter/camel-aws2-iam-starter/src/main/java/org/apache/camel/component/aws2/iam/springboot/IAM2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.iam.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class IAM2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.iam.IAM2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.iam.IAM2Configuration.class);
- case "software.amazon.awssdk.services.iam.IamClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.iam.IamClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-iam");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-kinesis-starter/src/main/java/org/apache/camel/component/aws2/firehose/springboot/KinesisFirehose2ComponentAutoConfiguration.java b/components-starter/camel-aws2-kinesis-starter/src/main/java/org/apache/camel/component/aws2/firehose/springboot/KinesisFirehose2ComponentAutoConfiguration.java
index 33a9b19e65c..ae6babcc403 100644
--- a/components-starter/camel-aws2-kinesis-starter/src/main/java/org/apache/camel/component/aws2/firehose/springboot/KinesisFirehose2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-kinesis-starter/src/main/java/org/apache/camel/component/aws2/firehose/springboot/KinesisFirehose2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class KinesisFirehose2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-kinesis-firehose", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-kinesis-starter/src/main/java/org/apache/camel/component/aws2/firehose/springboot/KinesisFirehose2ComponentConverter.java b/components-starter/camel-aws2-kinesis-starter/src/main/java/org/apache/camel/component/aws2/firehose/springboot/KinesisFirehose2ComponentConverter.java
index 19c79e3ae69..6bed1a9e151 100644
--- a/components-starter/camel-aws2-kinesis-starter/src/main/java/org/apache/camel/component/aws2/firehose/springboot/KinesisFirehose2ComponentConverter.java
+++ b/components-starter/camel-aws2-kinesis-starter/src/main/java/org/apache/camel/component/aws2/firehose/springboot/KinesisFirehose2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.firehose.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class KinesisFirehose2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.firehose.KinesisFirehose2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.firehose.KinesisFirehose2Configuration.class);
- case "software.amazon.awssdk.services.firehose.FirehoseClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.firehose.FirehoseClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-kinesis-firehose");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-kinesis-starter/src/main/java/org/apache/camel/component/aws2/kinesis/springboot/Kinesis2ComponentAutoConfiguration.java b/components-starter/camel-aws2-kinesis-starter/src/main/java/org/apache/camel/component/aws2/kinesis/springboot/Kinesis2ComponentAutoConfiguration.java
index 0ce2455cdfd..8ad2949e1f4 100644
--- a/components-starter/camel-aws2-kinesis-starter/src/main/java/org/apache/camel/component/aws2/kinesis/springboot/Kinesis2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-kinesis-starter/src/main/java/org/apache/camel/component/aws2/kinesis/springboot/Kinesis2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Kinesis2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-kinesis", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-kinesis-starter/src/main/java/org/apache/camel/component/aws2/kinesis/springboot/Kinesis2ComponentConverter.java b/components-starter/camel-aws2-kinesis-starter/src/main/java/org/apache/camel/component/aws2/kinesis/springboot/Kinesis2ComponentConverter.java
index 13beb96561e..9eac1250e80 100644
--- a/components-starter/camel-aws2-kinesis-starter/src/main/java/org/apache/camel/component/aws2/kinesis/springboot/Kinesis2ComponentConverter.java
+++ b/components-starter/camel-aws2-kinesis-starter/src/main/java/org/apache/camel/component/aws2/kinesis/springboot/Kinesis2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.kinesis.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -51,21 +52,6 @@ public class Kinesis2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.kinesis.Kinesis2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.kinesis.Kinesis2Configuration.class);
- case "software.amazon.awssdk.services.kinesis.KinesisAsyncClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.kinesis.KinesisAsyncClient.class);
- case "software.amazon.awssdk.services.kinesis.KinesisClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.kinesis.KinesisClient.class);
- case "software.amazon.awssdk.services.cloudwatch.CloudWatchAsyncClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.cloudwatch.CloudWatchAsyncClient.class);
- case "software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-kinesis");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-kms-starter/src/main/java/org/apache/camel/component/aws2/kms/springboot/KMS2ComponentAutoConfiguration.java b/components-starter/camel-aws2-kms-starter/src/main/java/org/apache/camel/component/aws2/kms/springboot/KMS2ComponentAutoConfiguration.java
index 02a4b066373..f7a358f4230 100644
--- a/components-starter/camel-aws2-kms-starter/src/main/java/org/apache/camel/component/aws2/kms/springboot/KMS2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-kms-starter/src/main/java/org/apache/camel/component/aws2/kms/springboot/KMS2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class KMS2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-kms", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-kms-starter/src/main/java/org/apache/camel/component/aws2/kms/springboot/KMS2ComponentConverter.java b/components-starter/camel-aws2-kms-starter/src/main/java/org/apache/camel/component/aws2/kms/springboot/KMS2ComponentConverter.java
index 9861f0e13ea..27deb832086 100644
--- a/components-starter/camel-aws2-kms-starter/src/main/java/org/apache/camel/component/aws2/kms/springboot/KMS2ComponentConverter.java
+++ b/components-starter/camel-aws2-kms-starter/src/main/java/org/apache/camel/component/aws2/kms/springboot/KMS2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.kms.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class KMS2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.kms.KMS2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.kms.KMS2Configuration.class);
- case "software.amazon.awssdk.services.kms.KmsClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.kms.KmsClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-kms");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-lambda-starter/src/main/java/org/apache/camel/component/aws2/lambda/springboot/Lambda2ComponentAutoConfiguration.java b/components-starter/camel-aws2-lambda-starter/src/main/java/org/apache/camel/component/aws2/lambda/springboot/Lambda2ComponentAutoConfiguration.java
index 425efc25b9a..a231b30e0c6 100644
--- a/components-starter/camel-aws2-lambda-starter/src/main/java/org/apache/camel/component/aws2/lambda/springboot/Lambda2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-lambda-starter/src/main/java/org/apache/camel/component/aws2/lambda/springboot/Lambda2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Lambda2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-lambda", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-lambda-starter/src/main/java/org/apache/camel/component/aws2/lambda/springboot/Lambda2ComponentConverter.java b/components-starter/camel-aws2-lambda-starter/src/main/java/org/apache/camel/component/aws2/lambda/springboot/Lambda2ComponentConverter.java
index dae797f04d4..1c7ee6e008f 100644
--- a/components-starter/camel-aws2-lambda-starter/src/main/java/org/apache/camel/component/aws2/lambda/springboot/Lambda2ComponentConverter.java
+++ b/components-starter/camel-aws2-lambda-starter/src/main/java/org/apache/camel/component/aws2/lambda/springboot/Lambda2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.lambda.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class Lambda2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.lambda.Lambda2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.lambda.Lambda2Configuration.class);
- case "software.amazon.awssdk.services.lambda.LambdaClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.lambda.LambdaClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-lambda");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-mq-starter/src/main/java/org/apache/camel/component/aws2/mq/springboot/MQ2ComponentAutoConfiguration.java b/components-starter/camel-aws2-mq-starter/src/main/java/org/apache/camel/component/aws2/mq/springboot/MQ2ComponentAutoConfiguration.java
index eb048df8704..f852cf72a8a 100644
--- a/components-starter/camel-aws2-mq-starter/src/main/java/org/apache/camel/component/aws2/mq/springboot/MQ2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-mq-starter/src/main/java/org/apache/camel/component/aws2/mq/springboot/MQ2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class MQ2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-mq", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-mq-starter/src/main/java/org/apache/camel/component/aws2/mq/springboot/MQ2ComponentConverter.java b/components-starter/camel-aws2-mq-starter/src/main/java/org/apache/camel/component/aws2/mq/springboot/MQ2ComponentConverter.java
index 3432605f5d4..4676ffd6647 100644
--- a/components-starter/camel-aws2-mq-starter/src/main/java/org/apache/camel/component/aws2/mq/springboot/MQ2ComponentConverter.java
+++ b/components-starter/camel-aws2-mq-starter/src/main/java/org/apache/camel/component/aws2/mq/springboot/MQ2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.mq.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class MQ2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.mq.MQ2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.mq.MQ2Configuration.class);
- case "software.amazon.awssdk.services.mq.MqClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.mq.MqClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-mq");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-msk-starter/src/main/java/org/apache/camel/component/aws2/msk/springboot/MSK2ComponentAutoConfiguration.java b/components-starter/camel-aws2-msk-starter/src/main/java/org/apache/camel/component/aws2/msk/springboot/MSK2ComponentAutoConfiguration.java
index bef1d688284..8b1130efb5e 100644
--- a/components-starter/camel-aws2-msk-starter/src/main/java/org/apache/camel/component/aws2/msk/springboot/MSK2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-msk-starter/src/main/java/org/apache/camel/component/aws2/msk/springboot/MSK2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class MSK2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-msk", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-msk-starter/src/main/java/org/apache/camel/component/aws2/msk/springboot/MSK2ComponentConverter.java b/components-starter/camel-aws2-msk-starter/src/main/java/org/apache/camel/component/aws2/msk/springboot/MSK2ComponentConverter.java
index a1424aa55fd..78a31f0a882 100644
--- a/components-starter/camel-aws2-msk-starter/src/main/java/org/apache/camel/component/aws2/msk/springboot/MSK2ComponentConverter.java
+++ b/components-starter/camel-aws2-msk-starter/src/main/java/org/apache/camel/component/aws2/msk/springboot/MSK2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.msk.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class MSK2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.msk.MSK2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.msk.MSK2Configuration.class);
- case "software.amazon.awssdk.services.kafka.KafkaClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.kafka.KafkaClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-msk");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-polly-starter/src/main/java/org/apache/camel/component/aws2/polly/springboot/Polly2ComponentAutoConfiguration.java b/components-starter/camel-aws2-polly-starter/src/main/java/org/apache/camel/component/aws2/polly/springboot/Polly2ComponentAutoConfiguration.java
index 968c8c7c85c..2cd2f11a262 100644
--- a/components-starter/camel-aws2-polly-starter/src/main/java/org/apache/camel/component/aws2/polly/springboot/Polly2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-polly-starter/src/main/java/org/apache/camel/component/aws2/polly/springboot/Polly2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Polly2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-polly", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-polly-starter/src/main/java/org/apache/camel/component/aws2/polly/springboot/Polly2ComponentConverter.java b/components-starter/camel-aws2-polly-starter/src/main/java/org/apache/camel/component/aws2/polly/springboot/Polly2ComponentConverter.java
index 7f1a1934dd0..12d4346633b 100644
--- a/components-starter/camel-aws2-polly-starter/src/main/java/org/apache/camel/component/aws2/polly/springboot/Polly2ComponentConverter.java
+++ b/components-starter/camel-aws2-polly-starter/src/main/java/org/apache/camel/component/aws2/polly/springboot/Polly2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.polly.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class Polly2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.polly.Polly2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.polly.Polly2Configuration.class);
- case "software.amazon.awssdk.services.polly.PollyClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.polly.PollyClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-polly");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-redshift-starter/src/main/java/org/apache/camel/component/aws2/redshift/data/springboot/RedshiftData2ComponentAutoConfiguration.java b/components-starter/camel-aws2-redshift-starter/src/main/java/org/apache/camel/component/aws2/redshift/data/springboot/RedshiftData2ComponentAutoConfiguration.java
index 1c685ca48b5..549b3324706 100644
--- a/components-starter/camel-aws2-redshift-starter/src/main/java/org/apache/camel/component/aws2/redshift/data/springboot/RedshiftData2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-redshift-starter/src/main/java/org/apache/camel/component/aws2/redshift/data/springboot/RedshiftData2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class RedshiftData2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-redshift-data", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-redshift-starter/src/main/java/org/apache/camel/component/aws2/redshift/data/springboot/RedshiftData2ComponentConverter.java b/components-starter/camel-aws2-redshift-starter/src/main/java/org/apache/camel/component/aws2/redshift/data/springboot/RedshiftData2ComponentConverter.java
index 76d6c7f6613..3ef9c9e9e27 100644
--- a/components-starter/camel-aws2-redshift-starter/src/main/java/org/apache/camel/component/aws2/redshift/data/springboot/RedshiftData2ComponentConverter.java
+++ b/components-starter/camel-aws2-redshift-starter/src/main/java/org/apache/camel/component/aws2/redshift/data/springboot/RedshiftData2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.redshift.data.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class RedshiftData2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.redshift.data.RedshiftData2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.redshift.data.RedshiftData2Configuration.class);
- case "software.amazon.awssdk.services.redshiftdata.RedshiftDataClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.redshiftdata.RedshiftDataClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-redshift-data");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-rekognition-starter/src/main/java/org/apache/camel/component/aws2/rekognition/springboot/Rekognition2ComponentAutoConfiguration.java b/components-starter/camel-aws2-rekognition-starter/src/main/java/org/apache/camel/component/aws2/rekognition/springboot/Rekognition2ComponentAutoConfiguration.java
index e11872edc4a..c698321f34c 100644
--- a/components-starter/camel-aws2-rekognition-starter/src/main/java/org/apache/camel/component/aws2/rekognition/springboot/Rekognition2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-rekognition-starter/src/main/java/org/apache/camel/component/aws2/rekognition/springboot/Rekognition2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Rekognition2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-rekognition", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-rekognition-starter/src/main/java/org/apache/camel/component/aws2/rekognition/springboot/Rekognition2ComponentConverter.java b/components-starter/camel-aws2-rekognition-starter/src/main/java/org/apache/camel/component/aws2/rekognition/springboot/Rekognition2ComponentConverter.java
index a25f116edf7..cf76e83d0ff 100644
--- a/components-starter/camel-aws2-rekognition-starter/src/main/java/org/apache/camel/component/aws2/rekognition/springboot/Rekognition2ComponentConverter.java
+++ b/components-starter/camel-aws2-rekognition-starter/src/main/java/org/apache/camel/component/aws2/rekognition/springboot/Rekognition2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.rekognition.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class Rekognition2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.rekognition.Rekognition2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.rekognition.Rekognition2Configuration.class);
- case "software.amazon.awssdk.services.rekognition.RekognitionClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.rekognition.RekognitionClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-rekognition");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-s3-starter/src/main/java/org/apache/camel/component/aws2/s3/springboot/AWS2S3ComponentAutoConfiguration.java b/components-starter/camel-aws2-s3-starter/src/main/java/org/apache/camel/component/aws2/s3/springboot/AWS2S3ComponentAutoConfiguration.java
index efdc353e4f3..d630ffbcfba 100644
--- a/components-starter/camel-aws2-s3-starter/src/main/java/org/apache/camel/component/aws2/s3/springboot/AWS2S3ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-s3-starter/src/main/java/org/apache/camel/component/aws2/s3/springboot/AWS2S3ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class AWS2S3ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-s3", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-s3-starter/src/main/java/org/apache/camel/component/aws2/s3/springboot/AWS2S3ComponentConverter.java b/components-starter/camel-aws2-s3-starter/src/main/java/org/apache/camel/component/aws2/s3/springboot/AWS2S3ComponentConverter.java
index f02a51fc1aa..5a6b7ef80c0 100644
--- a/components-starter/camel-aws2-s3-starter/src/main/java/org/apache/camel/component/aws2/s3/springboot/AWS2S3ComponentConverter.java
+++ b/components-starter/camel-aws2-s3-starter/src/main/java/org/apache/camel/component/aws2/s3/springboot/AWS2S3ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.s3.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -49,19 +50,6 @@ public class AWS2S3ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.s3.AWS2S3Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.s3.AWS2S3Configuration.class);
- case "software.amazon.awssdk.services.s3.S3Client": return applicationContext.getBean(ref, software.amazon.awssdk.services.s3.S3Client.class);
- case "software.amazon.awssdk.services.s3.presigner.S3Presigner": return applicationContext.getBean(ref, software.amazon.awssdk.services.s3.presigner.S3Presigner.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-s3");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-s3-vectors-starter/src/main/java/org/apache/camel/component/aws2/s3vectors/springboot/AWS2S3VectorsComponentAutoConfiguration.java b/components-starter/camel-aws2-s3-vectors-starter/src/main/java/org/apache/camel/component/aws2/s3vectors/springboot/AWS2S3VectorsComponentAutoConfiguration.java
index c5b4c053544..74848c73475 100644
--- a/components-starter/camel-aws2-s3-vectors-starter/src/main/java/org/apache/camel/component/aws2/s3vectors/springboot/AWS2S3VectorsComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-s3-vectors-starter/src/main/java/org/apache/camel/component/aws2/s3vectors/springboot/AWS2S3VectorsComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class AWS2S3VectorsComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-s3-vectors", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-s3-vectors-starter/src/main/java/org/apache/camel/component/aws2/s3vectors/springboot/AWS2S3VectorsComponentConverter.java b/components-starter/camel-aws2-s3-vectors-starter/src/main/java/org/apache/camel/component/aws2/s3vectors/springboot/AWS2S3VectorsComponentConverter.java
index 3032fb1004e..ebbfc9399fc 100644
--- a/components-starter/camel-aws2-s3-vectors-starter/src/main/java/org/apache/camel/component/aws2/s3vectors/springboot/AWS2S3VectorsComponentConverter.java
+++ b/components-starter/camel-aws2-s3-vectors-starter/src/main/java/org/apache/camel/component/aws2/s3vectors/springboot/AWS2S3VectorsComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.s3vectors.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class AWS2S3VectorsComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.s3vectors.AWS2S3VectorsConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.s3vectors.AWS2S3VectorsConfiguration.class);
- case "software.amazon.awssdk.services.s3vectors.S3VectorsClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.s3vectors.S3VectorsClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-s3-vectors");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-ses-starter/src/main/java/org/apache/camel/component/aws2/ses/springboot/Ses2ComponentAutoConfiguration.java b/components-starter/camel-aws2-ses-starter/src/main/java/org/apache/camel/component/aws2/ses/springboot/Ses2ComponentAutoConfiguration.java
index e6dce5f342b..7fa0e413625 100644
--- a/components-starter/camel-aws2-ses-starter/src/main/java/org/apache/camel/component/aws2/ses/springboot/Ses2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-ses-starter/src/main/java/org/apache/camel/component/aws2/ses/springboot/Ses2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Ses2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-ses", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-ses-starter/src/main/java/org/apache/camel/component/aws2/ses/springboot/Ses2ComponentConverter.java b/components-starter/camel-aws2-ses-starter/src/main/java/org/apache/camel/component/aws2/ses/springboot/Ses2ComponentConverter.java
index 61425d36339..e9c4b136570 100644
--- a/components-starter/camel-aws2-ses-starter/src/main/java/org/apache/camel/component/aws2/ses/springboot/Ses2ComponentConverter.java
+++ b/components-starter/camel-aws2-ses-starter/src/main/java/org/apache/camel/component/aws2/ses/springboot/Ses2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.ses.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class Ses2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.ses.Ses2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.ses.Ses2Configuration.class);
- case "software.amazon.awssdk.services.ses.SesClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.ses.SesClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-ses");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-sns-starter/src/main/java/org/apache/camel/component/aws2/sns/springboot/Sns2ComponentAutoConfiguration.java b/components-starter/camel-aws2-sns-starter/src/main/java/org/apache/camel/component/aws2/sns/springboot/Sns2ComponentAutoConfiguration.java
index 9c79881f120..04cad57db61 100644
--- a/components-starter/camel-aws2-sns-starter/src/main/java/org/apache/camel/component/aws2/sns/springboot/Sns2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-sns-starter/src/main/java/org/apache/camel/component/aws2/sns/springboot/Sns2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Sns2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-sns", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-sns-starter/src/main/java/org/apache/camel/component/aws2/sns/springboot/Sns2ComponentConverter.java b/components-starter/camel-aws2-sns-starter/src/main/java/org/apache/camel/component/aws2/sns/springboot/Sns2ComponentConverter.java
index 524c6687202..eb3588af6bf 100644
--- a/components-starter/camel-aws2-sns-starter/src/main/java/org/apache/camel/component/aws2/sns/springboot/Sns2ComponentConverter.java
+++ b/components-starter/camel-aws2-sns-starter/src/main/java/org/apache/camel/component/aws2/sns/springboot/Sns2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.sns.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class Sns2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.sns.Sns2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.sns.Sns2Configuration.class);
- case "software.amazon.awssdk.services.sns.SnsClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.sns.SnsClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-sns");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-sqs-starter/src/main/java/org/apache/camel/component/aws2/sqs/springboot/Sqs2ComponentAutoConfiguration.java b/components-starter/camel-aws2-sqs-starter/src/main/java/org/apache/camel/component/aws2/sqs/springboot/Sqs2ComponentAutoConfiguration.java
index 609b4dd19d8..fe786cea14d 100644
--- a/components-starter/camel-aws2-sqs-starter/src/main/java/org/apache/camel/component/aws2/sqs/springboot/Sqs2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-sqs-starter/src/main/java/org/apache/camel/component/aws2/sqs/springboot/Sqs2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Sqs2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-sqs", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-sqs-starter/src/main/java/org/apache/camel/component/aws2/sqs/springboot/Sqs2ComponentConverter.java b/components-starter/camel-aws2-sqs-starter/src/main/java/org/apache/camel/component/aws2/sqs/springboot/Sqs2ComponentConverter.java
index 7def5603db0..7a6e5f92506 100644
--- a/components-starter/camel-aws2-sqs-starter/src/main/java/org/apache/camel/component/aws2/sqs/springboot/Sqs2ComponentConverter.java
+++ b/components-starter/camel-aws2-sqs-starter/src/main/java/org/apache/camel/component/aws2/sqs/springboot/Sqs2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.sqs.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class Sqs2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.sqs.Sqs2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.sqs.Sqs2Configuration.class);
- case "software.amazon.awssdk.services.sqs.SqsClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.sqs.SqsClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-sqs");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-step-functions-starter/src/main/java/org/apache/camel/component/aws2/stepfunctions/springboot/StepFunctions2ComponentAutoConfiguration.java b/components-starter/camel-aws2-step-functions-starter/src/main/java/org/apache/camel/component/aws2/stepfunctions/springboot/StepFunctions2ComponentAutoConfiguration.java
index 922645b158a..7199858d12a 100644
--- a/components-starter/camel-aws2-step-functions-starter/src/main/java/org/apache/camel/component/aws2/stepfunctions/springboot/StepFunctions2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-step-functions-starter/src/main/java/org/apache/camel/component/aws2/stepfunctions/springboot/StepFunctions2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class StepFunctions2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-step-functions", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-step-functions-starter/src/main/java/org/apache/camel/component/aws2/stepfunctions/springboot/StepFunctions2ComponentConverter.java b/components-starter/camel-aws2-step-functions-starter/src/main/java/org/apache/camel/component/aws2/stepfunctions/springboot/StepFunctions2ComponentConverter.java
index 6379dab3fb0..079f9bc9d30 100644
--- a/components-starter/camel-aws2-step-functions-starter/src/main/java/org/apache/camel/component/aws2/stepfunctions/springboot/StepFunctions2ComponentConverter.java
+++ b/components-starter/camel-aws2-step-functions-starter/src/main/java/org/apache/camel/component/aws2/stepfunctions/springboot/StepFunctions2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.stepfunctions.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class StepFunctions2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.stepfunctions.StepFunctions2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.stepfunctions.StepFunctions2Configuration.class);
- case "software.amazon.awssdk.services.sfn.SfnClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.sfn.SfnClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-step-functions");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-sts-starter/src/main/java/org/apache/camel/component/aws2/sts/springboot/STS2ComponentAutoConfiguration.java b/components-starter/camel-aws2-sts-starter/src/main/java/org/apache/camel/component/aws2/sts/springboot/STS2ComponentAutoConfiguration.java
index 1e2776d7bc2..a596a311c9d 100644
--- a/components-starter/camel-aws2-sts-starter/src/main/java/org/apache/camel/component/aws2/sts/springboot/STS2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-sts-starter/src/main/java/org/apache/camel/component/aws2/sts/springboot/STS2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class STS2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-sts", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-sts-starter/src/main/java/org/apache/camel/component/aws2/sts/springboot/STS2ComponentConverter.java b/components-starter/camel-aws2-sts-starter/src/main/java/org/apache/camel/component/aws2/sts/springboot/STS2ComponentConverter.java
index 330696d2e0e..a960382dad3 100644
--- a/components-starter/camel-aws2-sts-starter/src/main/java/org/apache/camel/component/aws2/sts/springboot/STS2ComponentConverter.java
+++ b/components-starter/camel-aws2-sts-starter/src/main/java/org/apache/camel/component/aws2/sts/springboot/STS2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.sts.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class STS2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.sts.STS2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.sts.STS2Configuration.class);
- case "software.amazon.awssdk.services.sts.StsClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.sts.StsClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-sts");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-textract-starter/src/main/java/org/apache/camel/component/aws2/textract/springboot/Textract2ComponentAutoConfiguration.java b/components-starter/camel-aws2-textract-starter/src/main/java/org/apache/camel/component/aws2/textract/springboot/Textract2ComponentAutoConfiguration.java
index 94a3839bf58..2c186ecde77 100644
--- a/components-starter/camel-aws2-textract-starter/src/main/java/org/apache/camel/component/aws2/textract/springboot/Textract2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-textract-starter/src/main/java/org/apache/camel/component/aws2/textract/springboot/Textract2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Textract2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-textract", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-textract-starter/src/main/java/org/apache/camel/component/aws2/textract/springboot/Textract2ComponentConverter.java b/components-starter/camel-aws2-textract-starter/src/main/java/org/apache/camel/component/aws2/textract/springboot/Textract2ComponentConverter.java
index ff0242a4963..4413a26a6da 100644
--- a/components-starter/camel-aws2-textract-starter/src/main/java/org/apache/camel/component/aws2/textract/springboot/Textract2ComponentConverter.java
+++ b/components-starter/camel-aws2-textract-starter/src/main/java/org/apache/camel/component/aws2/textract/springboot/Textract2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.textract.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class Textract2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.textract.Textract2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.textract.Textract2Configuration.class);
- case "software.amazon.awssdk.services.textract.TextractClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.textract.TextractClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-textract");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-timestream-starter/src/main/java/org/apache/camel/component/aws2/timestream/springboot/Timestream2ComponentAutoConfiguration.java b/components-starter/camel-aws2-timestream-starter/src/main/java/org/apache/camel/component/aws2/timestream/springboot/Timestream2ComponentAutoConfiguration.java
index 6b6a05d63a2..a2637571a33 100644
--- a/components-starter/camel-aws2-timestream-starter/src/main/java/org/apache/camel/component/aws2/timestream/springboot/Timestream2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-timestream-starter/src/main/java/org/apache/camel/component/aws2/timestream/springboot/Timestream2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Timestream2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-timestream", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-timestream-starter/src/main/java/org/apache/camel/component/aws2/timestream/springboot/Timestream2ComponentConverter.java b/components-starter/camel-aws2-timestream-starter/src/main/java/org/apache/camel/component/aws2/timestream/springboot/Timestream2ComponentConverter.java
index 31b7998d93c..87f8847291d 100644
--- a/components-starter/camel-aws2-timestream-starter/src/main/java/org/apache/camel/component/aws2/timestream/springboot/Timestream2ComponentConverter.java
+++ b/components-starter/camel-aws2-timestream-starter/src/main/java/org/apache/camel/component/aws2/timestream/springboot/Timestream2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.timestream.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -49,19 +50,6 @@ public class Timestream2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.timestream.Timestream2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.timestream.Timestream2Configuration.class);
- case "software.amazon.awssdk.services.timestreamquery.TimestreamQueryClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.timestreamquery.TimestreamQueryClient.class);
- case "software.amazon.awssdk.services.timestreamwrite.TimestreamWriteClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.timestreamwrite.TimestreamWriteClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-timestream");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-transcribe-starter/src/main/java/org/apache/camel/component/aws2/transcribe/springboot/Transcribe2ComponentAutoConfiguration.java b/components-starter/camel-aws2-transcribe-starter/src/main/java/org/apache/camel/component/aws2/transcribe/springboot/Transcribe2ComponentAutoConfiguration.java
index 8e3424df4ee..799dd156f7b 100644
--- a/components-starter/camel-aws2-transcribe-starter/src/main/java/org/apache/camel/component/aws2/transcribe/springboot/Transcribe2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-transcribe-starter/src/main/java/org/apache/camel/component/aws2/transcribe/springboot/Transcribe2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Transcribe2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-transcribe", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-transcribe-starter/src/main/java/org/apache/camel/component/aws2/transcribe/springboot/Transcribe2ComponentConverter.java b/components-starter/camel-aws2-transcribe-starter/src/main/java/org/apache/camel/component/aws2/transcribe/springboot/Transcribe2ComponentConverter.java
index 80912c00543..fc50c0abc75 100644
--- a/components-starter/camel-aws2-transcribe-starter/src/main/java/org/apache/camel/component/aws2/transcribe/springboot/Transcribe2ComponentConverter.java
+++ b/components-starter/camel-aws2-transcribe-starter/src/main/java/org/apache/camel/component/aws2/transcribe/springboot/Transcribe2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.transcribe.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class Transcribe2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.transcribe.Transcribe2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.transcribe.Transcribe2Configuration.class);
- case "software.amazon.awssdk.services.transcribe.TranscribeClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.transcribe.TranscribeClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-transcribe");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-aws2-translate-starter/src/main/java/org/apache/camel/component/aws2/translate/springboot/Translate2ComponentAutoConfiguration.java b/components-starter/camel-aws2-translate-starter/src/main/java/org/apache/camel/component/aws2/translate/springboot/Translate2ComponentAutoConfiguration.java
index 8338d66e107..f7cb0ac83bc 100644
--- a/components-starter/camel-aws2-translate-starter/src/main/java/org/apache/camel/component/aws2/translate/springboot/Translate2ComponentAutoConfiguration.java
+++ b/components-starter/camel-aws2-translate-starter/src/main/java/org/apache/camel/component/aws2/translate/springboot/Translate2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Translate2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.aws2-translate", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-aws2-translate-starter/src/main/java/org/apache/camel/component/aws2/translate/springboot/Translate2ComponentConverter.java b/components-starter/camel-aws2-translate-starter/src/main/java/org/apache/camel/component/aws2/translate/springboot/Translate2ComponentConverter.java
index 6837094db65..751a125f95e 100644
--- a/components-starter/camel-aws2-translate-starter/src/main/java/org/apache/camel/component/aws2/translate/springboot/Translate2ComponentConverter.java
+++ b/components-starter/camel-aws2-translate-starter/src/main/java/org/apache/camel/component/aws2/translate/springboot/Translate2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.translate.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class Translate2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.aws2.translate.Translate2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.aws2.translate.Translate2Configuration.class);
- case "software.amazon.awssdk.services.translate.TranslateClient": return applicationContext.getBean(ref, software.amazon.awssdk.services.translate.TranslateClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.aws2-translate");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-azure-cosmosdb-starter/src/main/java/org/apache/camel/component/azure/cosmosdb/springboot/CosmosDbComponentAutoConfiguration.java b/components-starter/camel-azure-cosmosdb-starter/src/main/java/org/apache/camel/component/azure/cosmosdb/springboot/CosmosDbComponentAutoConfiguration.java
index 9ffc5965e7f..0fb97badfdf 100644
--- a/components-starter/camel-azure-cosmosdb-starter/src/main/java/org/apache/camel/component/azure/cosmosdb/springboot/CosmosDbComponentAutoConfiguration.java
+++ b/components-starter/camel-azure-cosmosdb-starter/src/main/java/org/apache/camel/component/azure/cosmosdb/springboot/CosmosDbComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class CosmosDbComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.azure-cosmosdb", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-azure-cosmosdb-starter/src/main/java/org/apache/camel/component/azure/cosmosdb/springboot/CosmosDbComponentConverter.java b/components-starter/camel-azure-cosmosdb-starter/src/main/java/org/apache/camel/component/azure/cosmosdb/springboot/CosmosDbComponentConverter.java
index d76a643ef64..1c1e9f99665 100644
--- a/components-starter/camel-azure-cosmosdb-starter/src/main/java/org/apache/camel/component/azure/cosmosdb/springboot/CosmosDbComponentConverter.java
+++ b/components-starter/camel-azure-cosmosdb-starter/src/main/java/org/apache/camel/component/azure/cosmosdb/springboot/CosmosDbComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.azure.cosmosdb.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -52,22 +53,6 @@ public class CosmosDbComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.azure.cosmosdb.CosmosDbConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.azure.cosmosdb.CosmosDbConfiguration.class);
- case "com.azure.cosmos.CosmosAsyncClient": return applicationContext.getBean(ref, com.azure.cosmos.CosmosAsyncClient.class);
- case "com.azure.cosmos.models.ThroughputProperties": return applicationContext.getBean(ref, com.azure.cosmos.models.ThroughputProperties.class);
- case "com.azure.cosmos.models.ChangeFeedProcessorOptions": return applicationContext.getBean(ref, com.azure.cosmos.models.ChangeFeedProcessorOptions.class);
- case "com.azure.cosmos.models.CosmosQueryRequestOptions": return applicationContext.getBean(ref, com.azure.cosmos.models.CosmosQueryRequestOptions.class);
- case "com.azure.cosmos.models.IndexingPolicy": return applicationContext.getBean(ref, com.azure.cosmos.models.IndexingPolicy.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.azure-cosmosdb");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-azure-eventgrid-starter/src/main/java/org/apache/camel/component/azure/eventgrid/springboot/EventGridComponentAutoConfiguration.java b/components-starter/camel-azure-eventgrid-starter/src/main/java/org/apache/camel/component/azure/eventgrid/springboot/EventGridComponentAutoConfiguration.java
index 814a984342a..83718542103 100644
--- a/components-starter/camel-azure-eventgrid-starter/src/main/java/org/apache/camel/component/azure/eventgrid/springboot/EventGridComponentAutoConfiguration.java
+++ b/components-starter/camel-azure-eventgrid-starter/src/main/java/org/apache/camel/component/azure/eventgrid/springboot/EventGridComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class EventGridComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.azure-eventgrid", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-azure-eventgrid-starter/src/main/java/org/apache/camel/component/azure/eventgrid/springboot/EventGridComponentConverter.java b/components-starter/camel-azure-eventgrid-starter/src/main/java/org/apache/camel/component/azure/eventgrid/springboot/EventGridComponentConverter.java
index 62829063465..9500d192440 100644
--- a/components-starter/camel-azure-eventgrid-starter/src/main/java/org/apache/camel/component/azure/eventgrid/springboot/EventGridComponentConverter.java
+++ b/components-starter/camel-azure-eventgrid-starter/src/main/java/org/apache/camel/component/azure/eventgrid/springboot/EventGridComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.azure.eventgrid.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -50,20 +51,6 @@ public class EventGridComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.azure.eventgrid.EventGridConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.azure.eventgrid.EventGridConfiguration.class);
- case "com.azure.messaging.eventgrid.EventGridPublisherClient": return applicationContext.getBean(ref, com.azure.messaging.eventgrid.EventGridPublisherClient.class);
- case "com.azure.core.credential.AzureKeyCredential": return applicationContext.getBean(ref, com.azure.core.credential.AzureKeyCredential.class);
- case "com.azure.core.credential.TokenCredential": return applicationContext.getBean(ref, com.azure.core.credential.TokenCredential.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.azure-eventgrid");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-azure-eventhubs-starter/src/main/java/org/apache/camel/component/azure/eventhubs/springboot/EventHubsComponentAutoConfiguration.java b/components-starter/camel-azure-eventhubs-starter/src/main/java/org/apache/camel/component/azure/eventhubs/springboot/EventHubsComponentAutoConfiguration.java
index b04549016ae..ecaefd7da4c 100644
--- a/components-starter/camel-azure-eventhubs-starter/src/main/java/org/apache/camel/component/azure/eventhubs/springboot/EventHubsComponentAutoConfiguration.java
+++ b/components-starter/camel-azure-eventhubs-starter/src/main/java/org/apache/camel/component/azure/eventhubs/springboot/EventHubsComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class EventHubsComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.azure-eventhubs", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-azure-eventhubs-starter/src/main/java/org/apache/camel/component/azure/eventhubs/springboot/EventHubsComponentConverter.java b/components-starter/camel-azure-eventhubs-starter/src/main/java/org/apache/camel/component/azure/eventhubs/springboot/EventHubsComponentConverter.java
index 1f2e0921425..6912c7142a1 100644
--- a/components-starter/camel-azure-eventhubs-starter/src/main/java/org/apache/camel/component/azure/eventhubs/springboot/EventHubsComponentConverter.java
+++ b/components-starter/camel-azure-eventhubs-starter/src/main/java/org/apache/camel/component/azure/eventhubs/springboot/EventHubsComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.azure.eventhubs.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -53,23 +54,6 @@ public class EventHubsComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.azure.core.amqp.AmqpRetryOptions": return applicationContext.getBean(ref, com.azure.core.amqp.AmqpRetryOptions.class);
- case "org.apache.camel.component.azure.eventhubs.EventHubsConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.azure.eventhubs.EventHubsConfiguration.class);
- case "com.azure.storage.common.StorageSharedKeyCredential": return applicationContext.getBean(ref, com.azure.storage.common.StorageSharedKeyCredential.class);
- case "com.azure.messaging.eventhubs.CheckpointStore": return applicationContext.getBean(ref, com.azure.messaging.eventhubs.CheckpointStore.class);
- case "com.azure.messaging.eventhubs.EventHubProducerAsyncClient": return applicationContext.getBean(ref, com.azure.messaging.eventhubs.EventHubProducerAsyncClient.class);
- case "org.apache.camel.spi.HeaderFilterStrategy": return applicationContext.getBean(ref, org.apache.camel.spi.HeaderFilterStrategy.class);
- case "com.azure.core.credential.TokenCredential": return applicationContext.getBean(ref, com.azure.core.credential.TokenCredential.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.azure-eventhubs");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-azure-files-starter/src/main/java/org/apache/camel/component/file/azure/springboot/FilesComponentAutoConfiguration.java b/components-starter/camel-azure-files-starter/src/main/java/org/apache/camel/component/file/azure/springboot/FilesComponentAutoConfiguration.java
index 29894820a70..045aec2d988 100644
--- a/components-starter/camel-azure-files-starter/src/main/java/org/apache/camel/component/file/azure/springboot/FilesComponentAutoConfiguration.java
+++ b/components-starter/camel-azure-files-starter/src/main/java/org/apache/camel/component/file/azure/springboot/FilesComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class FilesComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.azure-files", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-azure-functions-starter/src/main/java/org/apache/camel/component/azure/functions/springboot/FunctionsComponentAutoConfiguration.java b/components-starter/camel-azure-functions-starter/src/main/java/org/apache/camel/component/azure/functions/springboot/FunctionsComponentAutoConfiguration.java
index 35478233348..5a63c0b77de 100644
--- a/components-starter/camel-azure-functions-starter/src/main/java/org/apache/camel/component/azure/functions/springboot/FunctionsComponentAutoConfiguration.java
+++ b/components-starter/camel-azure-functions-starter/src/main/java/org/apache/camel/component/azure/functions/springboot/FunctionsComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class FunctionsComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.azure-functions", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-azure-functions-starter/src/main/java/org/apache/camel/component/azure/functions/springboot/FunctionsComponentConverter.java b/components-starter/camel-azure-functions-starter/src/main/java/org/apache/camel/component/azure/functions/springboot/FunctionsComponentConverter.java
index d7f9c2de201..d6e5575a29e 100644
--- a/components-starter/camel-azure-functions-starter/src/main/java/org/apache/camel/component/azure/functions/springboot/FunctionsComponentConverter.java
+++ b/components-starter/camel-azure-functions-starter/src/main/java/org/apache/camel/component/azure/functions/springboot/FunctionsComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.azure.functions.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -49,19 +50,6 @@ public class FunctionsComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.azure.functions.FunctionsConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.azure.functions.FunctionsConfiguration.class);
- case "com.azure.resourcemanager.appservice.AppServiceManager": return applicationContext.getBean(ref, com.azure.resourcemanager.appservice.AppServiceManager.class);
- case "com.azure.core.credential.TokenCredential": return applicationContext.getBean(ref, com.azure.core.credential.TokenCredential.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.azure-functions");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-azure-key-vault-starter/src/main/java/org/apache/camel/component/azure/key/vault/springboot/KeyVaultComponentAutoConfiguration.java b/components-starter/camel-azure-key-vault-starter/src/main/java/org/apache/camel/component/azure/key/vault/springboot/KeyVaultComponentAutoConfiguration.java
index 4d5195ef276..b15312210fa 100644
--- a/components-starter/camel-azure-key-vault-starter/src/main/java/org/apache/camel/component/azure/key/vault/springboot/KeyVaultComponentAutoConfiguration.java
+++ b/components-starter/camel-azure-key-vault-starter/src/main/java/org/apache/camel/component/azure/key/vault/springboot/KeyVaultComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class KeyVaultComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.azure-key-vault", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-azure-servicebus-starter/src/main/java/org/apache/camel/component/azure/servicebus/springboot/ServiceBusComponentAutoConfiguration.java b/components-starter/camel-azure-servicebus-starter/src/main/java/org/apache/camel/component/azure/servicebus/springboot/ServiceBusComponentAutoConfiguration.java
index 1bdc69904ea..aaf4b2492b7 100644
--- a/components-starter/camel-azure-servicebus-starter/src/main/java/org/apache/camel/component/azure/servicebus/springboot/ServiceBusComponentAutoConfiguration.java
+++ b/components-starter/camel-azure-servicebus-starter/src/main/java/org/apache/camel/component/azure/servicebus/springboot/ServiceBusComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ServiceBusComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.azure-servicebus", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-azure-servicebus-starter/src/main/java/org/apache/camel/component/azure/servicebus/springboot/ServiceBusComponentConverter.java b/components-starter/camel-azure-servicebus-starter/src/main/java/org/apache/camel/component/azure/servicebus/springboot/ServiceBusComponentConverter.java
index 3c62222ded4..5219a0274dc 100644
--- a/components-starter/camel-azure-servicebus-starter/src/main/java/org/apache/camel/component/azure/servicebus/springboot/ServiceBusComponentConverter.java
+++ b/components-starter/camel-azure-servicebus-starter/src/main/java/org/apache/camel/component/azure/servicebus/springboot/ServiceBusComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.azure.servicebus.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -55,25 +56,6 @@ public class ServiceBusComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.azure.core.amqp.AmqpRetryOptions": return applicationContext.getBean(ref, com.azure.core.amqp.AmqpRetryOptions.class);
- case "com.azure.core.util.ClientOptions": return applicationContext.getBean(ref, com.azure.core.util.ClientOptions.class);
- case "org.apache.camel.component.azure.servicebus.ServiceBusConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.azure.servicebus.ServiceBusConfiguration.class);
- case "org.apache.camel.spi.HeaderFilterStrategy": return applicationContext.getBean(ref, org.apache.camel.spi.HeaderFilterStrategy.class);
- case "com.azure.core.amqp.ProxyOptions": return applicationContext.getBean(ref, com.azure.core.amqp.ProxyOptions.class);
- case "com.azure.messaging.servicebus.ServiceBusProcessorClient": return applicationContext.getBean(ref, com.azure.messaging.servicebus.ServiceBusProcessorClient.class);
- case "com.azure.messaging.servicebus.ServiceBusSenderClient": return applicationContext.getBean(ref, com.azure.messaging.servicebus.ServiceBusSenderClient.class);
- case "com.azure.messaging.servicebus.ServiceBusTransactionContext": return applicationContext.getBean(ref, com.azure.messaging.servicebus.ServiceBusTransactionContext.class);
- case "com.azure.core.credential.TokenCredential": return applicationContext.getBean(ref, com.azure.core.credential.TokenCredential.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.azure-servicebus");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-azure-storage-blob-starter/src/main/java/org/apache/camel/component/azure/storage/blob/springboot/BlobComponentAutoConfiguration.java b/components-starter/camel-azure-storage-blob-starter/src/main/java/org/apache/camel/component/azure/storage/blob/springboot/BlobComponentAutoConfiguration.java
index bb44dd83400..05034b27a8b 100644
--- a/components-starter/camel-azure-storage-blob-starter/src/main/java/org/apache/camel/component/azure/storage/blob/springboot/BlobComponentAutoConfiguration.java
+++ b/components-starter/camel-azure-storage-blob-starter/src/main/java/org/apache/camel/component/azure/storage/blob/springboot/BlobComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class BlobComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.azure-storage-blob", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-azure-storage-blob-starter/src/main/java/org/apache/camel/component/azure/storage/blob/springboot/BlobComponentConverter.java b/components-starter/camel-azure-storage-blob-starter/src/main/java/org/apache/camel/component/azure/storage/blob/springboot/BlobComponentConverter.java
index d6588f26c16..4229097e252 100644
--- a/components-starter/camel-azure-storage-blob-starter/src/main/java/org/apache/camel/component/azure/storage/blob/springboot/BlobComponentConverter.java
+++ b/components-starter/camel-azure-storage-blob-starter/src/main/java/org/apache/camel/component/azure/storage/blob/springboot/BlobComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.azure.storage.blob.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -50,20 +51,6 @@ public class BlobComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.azure.storage.blob.BlobConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.azure.storage.blob.BlobConfiguration.class);
- case "com.azure.storage.common.StorageSharedKeyCredential": return applicationContext.getBean(ref, com.azure.storage.common.StorageSharedKeyCredential.class);
- case "com.azure.storage.blob.BlobServiceClient": return applicationContext.getBean(ref, com.azure.storage.blob.BlobServiceClient.class);
- case "com.azure.core.util.Context": return applicationContext.getBean(ref, com.azure.core.util.Context.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.azure-storage-blob");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-azure-storage-datalake-starter/src/main/java/org/apache/camel/component/azure/storage/datalake/springboot/DataLakeComponentAutoConfiguration.java b/components-starter/camel-azure-storage-datalake-starter/src/main/java/org/apache/camel/component/azure/storage/datalake/springboot/DataLakeComponentAutoConfiguration.java
index 1ac9c0ad950..6fd8524ec0d 100644
--- a/components-starter/camel-azure-storage-datalake-starter/src/main/java/org/apache/camel/component/azure/storage/datalake/springboot/DataLakeComponentAutoConfiguration.java
+++ b/components-starter/camel-azure-storage-datalake-starter/src/main/java/org/apache/camel/component/azure/storage/datalake/springboot/DataLakeComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DataLakeComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.azure-storage-datalake", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-azure-storage-datalake-starter/src/main/java/org/apache/camel/component/azure/storage/datalake/springboot/DataLakeComponentConverter.java b/components-starter/camel-azure-storage-datalake-starter/src/main/java/org/apache/camel/component/azure/storage/datalake/springboot/DataLakeComponentConverter.java
index 97887396ae5..c5fb15dc8cf 100644
--- a/components-starter/camel-azure-storage-datalake-starter/src/main/java/org/apache/camel/component/azure/storage/datalake/springboot/DataLakeComponentConverter.java
+++ b/components-starter/camel-azure-storage-datalake-starter/src/main/java/org/apache/camel/component/azure/storage/datalake/springboot/DataLakeComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.azure.storage.datalake.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -51,21 +52,6 @@ public class DataLakeComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.azure.storage.datalake.DataLakeConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.azure.storage.datalake.DataLakeConfiguration.class);
- case "com.azure.storage.file.datalake.DataLakeServiceClient": return applicationContext.getBean(ref, com.azure.storage.file.datalake.DataLakeServiceClient.class);
- case "com.azure.storage.common.StorageSharedKeyCredential": return applicationContext.getBean(ref, com.azure.storage.common.StorageSharedKeyCredential.class);
- case "com.azure.identity.ClientSecretCredential": return applicationContext.getBean(ref, com.azure.identity.ClientSecretCredential.class);
- case "com.azure.core.credential.AzureSasCredential": return applicationContext.getBean(ref, com.azure.core.credential.AzureSasCredential.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.azure-storage-datalake");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-azure-storage-queue-starter/src/main/java/org/apache/camel/component/azure/storage/queue/springboot/QueueComponentAutoConfiguration.java b/components-starter/camel-azure-storage-queue-starter/src/main/java/org/apache/camel/component/azure/storage/queue/springboot/QueueComponentAutoConfiguration.java
index c934f3e3997..9e68c24e516 100644
--- a/components-starter/camel-azure-storage-queue-starter/src/main/java/org/apache/camel/component/azure/storage/queue/springboot/QueueComponentAutoConfiguration.java
+++ b/components-starter/camel-azure-storage-queue-starter/src/main/java/org/apache/camel/component/azure/storage/queue/springboot/QueueComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class QueueComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.azure-storage-queue", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-azure-storage-queue-starter/src/main/java/org/apache/camel/component/azure/storage/queue/springboot/QueueComponentConverter.java b/components-starter/camel-azure-storage-queue-starter/src/main/java/org/apache/camel/component/azure/storage/queue/springboot/QueueComponentConverter.java
index 2c02863babc..9a3b9a4cdb5 100644
--- a/components-starter/camel-azure-storage-queue-starter/src/main/java/org/apache/camel/component/azure/storage/queue/springboot/QueueComponentConverter.java
+++ b/components-starter/camel-azure-storage-queue-starter/src/main/java/org/apache/camel/component/azure/storage/queue/springboot/QueueComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.azure.storage.queue.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -49,19 +50,6 @@ public class QueueComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.azure.storage.queue.QueueConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.azure.storage.queue.QueueConfiguration.class);
- case "com.azure.storage.queue.QueueServiceClient": return applicationContext.getBean(ref, com.azure.storage.queue.QueueServiceClient.class);
- case "com.azure.storage.common.StorageSharedKeyCredential": return applicationContext.getBean(ref, com.azure.storage.common.StorageSharedKeyCredential.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.azure-storage-queue");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-barcode-starter/src/main/java/org/apache/camel/dataformat/barcode/springboot/BarcodeDataFormatAutoConfiguration.java b/components-starter/camel-barcode-starter/src/main/java/org/apache/camel/dataformat/barcode/springboot/BarcodeDataFormatAutoConfiguration.java
index 666335386fb..e4aa65d6fbc 100644
--- a/components-starter/camel-barcode-starter/src/main/java/org/apache/camel/dataformat/barcode/springboot/BarcodeDataFormatAutoConfiguration.java
+++ b/components-starter/camel-barcode-starter/src/main/java/org/apache/camel/dataformat/barcode/springboot/BarcodeDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class BarcodeDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.barcode", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatAutoConfiguration.java b/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatAutoConfiguration.java
index c1c110da454..dbca175fa4d 100644
--- a/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatAutoConfiguration.java
+++ b/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class Base64DataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.base64", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-bean-starter/src/main/java/org/apache/camel/component/bean/springboot/BeanComponentAutoConfiguration.java b/components-starter/camel-bean-starter/src/main/java/org/apache/camel/component/bean/springboot/BeanComponentAutoConfiguration.java
index 63e23013f60..f0be9cffaee 100644
--- a/components-starter/camel-bean-starter/src/main/java/org/apache/camel/component/bean/springboot/BeanComponentAutoConfiguration.java
+++ b/components-starter/camel-bean-starter/src/main/java/org/apache/camel/component/bean/springboot/BeanComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class BeanComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.bean", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-bean-starter/src/main/java/org/apache/camel/component/beanclass/springboot/ClassComponentAutoConfiguration.java b/components-starter/camel-bean-starter/src/main/java/org/apache/camel/component/beanclass/springboot/ClassComponentAutoConfiguration.java
index 230e169c1b2..d5c4fd71ebe 100644
--- a/components-starter/camel-bean-starter/src/main/java/org/apache/camel/component/beanclass/springboot/ClassComponentAutoConfiguration.java
+++ b/components-starter/camel-bean-starter/src/main/java/org/apache/camel/component/beanclass/springboot/ClassComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ClassComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.class", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-bean-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java b/components-starter/camel-bean-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java
index 0d28e1c4f59..da8ba21c0ee 100644
--- a/components-starter/camel-bean-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java
+++ b/components-starter/camel-bean-starter/src/main/java/org/apache/camel/language/bean/springboot/BeanLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class BeanLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.bean", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentAutoConfiguration.java b/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentAutoConfiguration.java
index 82b956341fb..1503d5dad14 100644
--- a/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentAutoConfiguration.java
+++ b/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class BeanValidatorComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.bean-validator", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentConverter.java b/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentConverter.java
index a8141463817..90968555120 100644
--- a/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentConverter.java
+++ b/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.bean.validator.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -51,21 +52,6 @@ public class BeanValidatorComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "jakarta.validation.ConstraintValidatorFactory": return applicationContext.getBean(ref, jakarta.validation.ConstraintValidatorFactory.class);
- case "jakarta.validation.MessageInterpolator": return applicationContext.getBean(ref, jakarta.validation.MessageInterpolator.class);
- case "jakarta.validation.TraversableResolver": return applicationContext.getBean(ref, jakarta.validation.TraversableResolver.class);
- case "jakarta.validation.ValidationProviderResolver": return applicationContext.getBean(ref, jakarta.validation.ValidationProviderResolver.class);
- case "jakarta.validation.ValidatorFactory": return applicationContext.getBean(ref, jakarta.validation.ValidatorFactory.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.bean-validator");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-beanio-starter/src/main/java/org/apache/camel/dataformat/beanio/springboot/BeanIODataFormatAutoConfiguration.java b/components-starter/camel-beanio-starter/src/main/java/org/apache/camel/dataformat/beanio/springboot/BeanIODataFormatAutoConfiguration.java
index 23bb53dc529..93bdbc56110 100644
--- a/components-starter/camel-beanio-starter/src/main/java/org/apache/camel/dataformat/beanio/springboot/BeanIODataFormatAutoConfiguration.java
+++ b/components-starter/camel-beanio-starter/src/main/java/org/apache/camel/dataformat/beanio/springboot/BeanIODataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class BeanIODataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.beanio", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatAutoConfiguration.java b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatAutoConfiguration.java
index 8e0b8f3e4d6..5b3bf99a2cb 100644
--- a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatAutoConfiguration.java
+++ b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class BindyCsvDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.bindy-csv", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatAutoConfiguration.java b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatAutoConfiguration.java
index 8621e0affb6..b5e556ba3be 100644
--- a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatAutoConfiguration.java
+++ b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class BindyFixedLengthDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.bindy-fixed", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatAutoConfiguration.java b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatAutoConfiguration.java
index 768f36c8562..ba3b5c14e51 100644
--- a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatAutoConfiguration.java
+++ b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class BindyKeyValuePairDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.bindy-kvp", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-bonita-starter/src/main/java/org/apache/camel/component/bonita/springboot/BonitaComponentAutoConfiguration.java b/components-starter/camel-bonita-starter/src/main/java/org/apache/camel/component/bonita/springboot/BonitaComponentAutoConfiguration.java
index 8d4e7ed430f..fb16712a009 100644
--- a/components-starter/camel-bonita-starter/src/main/java/org/apache/camel/component/bonita/springboot/BonitaComponentAutoConfiguration.java
+++ b/components-starter/camel-bonita-starter/src/main/java/org/apache/camel/component/bonita/springboot/BonitaComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class BonitaComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.bonita", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentAutoConfiguration.java b/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentAutoConfiguration.java
index 0d0cb0154d7..e3a824b8585 100644
--- a/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentAutoConfiguration.java
+++ b/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class BoxComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.box", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentConverter.java b/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentConverter.java
index 48103c4790d..2868fb4f7f8 100644
--- a/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentConverter.java
+++ b/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.box.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -49,19 +50,6 @@ public class BoxComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.box.BoxConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.box.BoxConfiguration.class);
- case "com.box.sdk.IAccessTokenCache": return applicationContext.getBean(ref, com.box.sdk.IAccessTokenCache.class);
- case "org.apache.camel.support.jsse.SSLContextParameters": return applicationContext.getBean(ref, org.apache.camel.support.jsse.SSLContextParameters.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.box");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-braintree-starter/src/main/java/org/apache/camel/component/braintree/springboot/BraintreeComponentAutoConfiguration.java b/components-starter/camel-braintree-starter/src/main/java/org/apache/camel/component/braintree/springboot/BraintreeComponentAutoConfiguration.java
index 9bdd56c2f70..556a1ee1fd0 100644
--- a/components-starter/camel-braintree-starter/src/main/java/org/apache/camel/component/braintree/springboot/BraintreeComponentAutoConfiguration.java
+++ b/components-starter/camel-braintree-starter/src/main/java/org/apache/camel/component/braintree/springboot/BraintreeComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class BraintreeComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.braintree", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-braintree-starter/src/main/java/org/apache/camel/component/braintree/springboot/BraintreeComponentConverter.java b/components-starter/camel-braintree-starter/src/main/java/org/apache/camel/component/braintree/springboot/BraintreeComponentConverter.java
index 7a0ede1e5af..546e95a0bb8 100644
--- a/components-starter/camel-braintree-starter/src/main/java/org/apache/camel/component/braintree/springboot/BraintreeComponentConverter.java
+++ b/components-starter/camel-braintree-starter/src/main/java/org/apache/camel/component/braintree/springboot/BraintreeComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.braintree.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class BraintreeComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.braintree.BraintreeConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.braintree.BraintreeConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.braintree");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-browse-starter/src/main/java/org/apache/camel/component/browse/springboot/BrowseComponentAutoConfiguration.java b/components-starter/camel-browse-starter/src/main/java/org/apache/camel/component/browse/springboot/BrowseComponentAutoConfiguration.java
index d3f2312ed01..e53dc68f862 100644
--- a/components-starter/camel-browse-starter/src/main/java/org/apache/camel/component/browse/springboot/BrowseComponentAutoConfiguration.java
+++ b/components-starter/camel-browse-starter/src/main/java/org/apache/camel/component/browse/springboot/BrowseComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class BrowseComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.browse", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentAutoConfiguration.java b/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentAutoConfiguration.java
index d49ca36639b..6a6f69170b0 100644
--- a/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentAutoConfiguration.java
+++ b/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class CaffeineCacheComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.caffeine-cache", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConverter.java b/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConverter.java
index c49523615e4..5d844b136d7 100644
--- a/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConverter.java
+++ b/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.caffeine.cache.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -50,20 +51,6 @@ public class CaffeineCacheComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.github.benmanes.caffeine.cache.CacheLoader": return applicationContext.getBean(ref, com.github.benmanes.caffeine.cache.CacheLoader.class);
- case "org.apache.camel.component.caffeine.CaffeineConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.caffeine.CaffeineConfiguration.class);
- case "com.github.benmanes.caffeine.cache.RemovalListener": return applicationContext.getBean(ref, com.github.benmanes.caffeine.cache.RemovalListener.class);
- case "com.github.benmanes.caffeine.cache.stats.StatsCounter": return applicationContext.getBean(ref, com.github.benmanes.caffeine.cache.stats.StatsCounter.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.caffeine-cache");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentAutoConfiguration.java b/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentAutoConfiguration.java
index 6becc04c2fc..888c648280c 100644
--- a/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentAutoConfiguration.java
+++ b/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class CaffeineLoadCacheComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.caffeine-loadcache", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConverter.java b/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConverter.java
index 2e60a2fac86..3df0ccf68bd 100644
--- a/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConverter.java
+++ b/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.caffeine.load.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -50,20 +51,6 @@ public class CaffeineLoadCacheComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.github.benmanes.caffeine.cache.CacheLoader": return applicationContext.getBean(ref, com.github.benmanes.caffeine.cache.CacheLoader.class);
- case "org.apache.camel.component.caffeine.CaffeineConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.caffeine.CaffeineConfiguration.class);
- case "com.github.benmanes.caffeine.cache.RemovalListener": return applicationContext.getBean(ref, com.github.benmanes.caffeine.cache.RemovalListener.class);
- case "com.github.benmanes.caffeine.cache.stats.StatsCounter": return applicationContext.getBean(ref, com.github.benmanes.caffeine.cache.stats.StatsCounter.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.caffeine-loadcache");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-cassandraql-starter/src/main/java/org/apache/camel/component/cassandra/springboot/CassandraComponentAutoConfiguration.java b/components-starter/camel-cassandraql-starter/src/main/java/org/apache/camel/component/cassandra/springboot/CassandraComponentAutoConfiguration.java
index 8858566d8c0..0b252f446ea 100644
--- a/components-starter/camel-cassandraql-starter/src/main/java/org/apache/camel/component/cassandra/springboot/CassandraComponentAutoConfiguration.java
+++ b/components-starter/camel-cassandraql-starter/src/main/java/org/apache/camel/component/cassandra/springboot/CassandraComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class CassandraComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.cql", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-cbor-starter/src/main/java/org/apache/camel/component/cbor/springboot/CBORDataFormatAutoConfiguration.java b/components-starter/camel-cbor-starter/src/main/java/org/apache/camel/component/cbor/springboot/CBORDataFormatAutoConfiguration.java
index df6e817172b..be4c80d8c54 100644
--- a/components-starter/camel-cbor-starter/src/main/java/org/apache/camel/component/cbor/springboot/CBORDataFormatAutoConfiguration.java
+++ b/components-starter/camel-cbor-starter/src/main/java/org/apache/camel/component/cbor/springboot/CBORDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class CBORDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.cbor", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-chatscript-starter/src/main/java/org/apache/camel/component/chatscript/springboot/ChatScriptComponentAutoConfiguration.java b/components-starter/camel-chatscript-starter/src/main/java/org/apache/camel/component/chatscript/springboot/ChatScriptComponentAutoConfiguration.java
index 50967bdddcd..cc0f02787d7 100644
--- a/components-starter/camel-chatscript-starter/src/main/java/org/apache/camel/component/chatscript/springboot/ChatScriptComponentAutoConfiguration.java
+++ b/components-starter/camel-chatscript-starter/src/main/java/org/apache/camel/component/chatscript/springboot/ChatScriptComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ChatScriptComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.chatscript", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-chunk-starter/src/main/java/org/apache/camel/component/chunk/springboot/ChunkComponentAutoConfiguration.java b/components-starter/camel-chunk-starter/src/main/java/org/apache/camel/component/chunk/springboot/ChunkComponentAutoConfiguration.java
index 95e97426b40..a349a4e06bf 100644
--- a/components-starter/camel-chunk-starter/src/main/java/org/apache/camel/component/chunk/springboot/ChunkComponentAutoConfiguration.java
+++ b/components-starter/camel-chunk-starter/src/main/java/org/apache/camel/component/chunk/springboot/ChunkComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ChunkComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.chunk", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-clickhouse-starter/src/main/java/org/apache/camel/component/clickhouse/springboot/ClickHouseComponentAutoConfiguration.java b/components-starter/camel-clickhouse-starter/src/main/java/org/apache/camel/component/clickhouse/springboot/ClickHouseComponentAutoConfiguration.java
index e6286aa22f8..850717a801d 100644
--- a/components-starter/camel-clickhouse-starter/src/main/java/org/apache/camel/component/clickhouse/springboot/ClickHouseComponentAutoConfiguration.java
+++ b/components-starter/camel-clickhouse-starter/src/main/java/org/apache/camel/component/clickhouse/springboot/ClickHouseComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ClickHouseComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.clickhouse", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-clickhouse-starter/src/main/java/org/apache/camel/component/clickhouse/springboot/ClickHouseComponentConverter.java b/components-starter/camel-clickhouse-starter/src/main/java/org/apache/camel/component/clickhouse/springboot/ClickHouseComponentConverter.java
index 96e3eafaa24..40aed24205e 100644
--- a/components-starter/camel-clickhouse-starter/src/main/java/org/apache/camel/component/clickhouse/springboot/ClickHouseComponentConverter.java
+++ b/components-starter/camel-clickhouse-starter/src/main/java/org/apache/camel/component/clickhouse/springboot/ClickHouseComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.clickhouse.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class ClickHouseComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.clickhouse.client.api.Client": return applicationContext.getBean(ref, com.clickhouse.client.api.Client.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.clickhouse");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-clickup-starter/src/main/java/org/apache/camel/component/clickup/springboot/ClickUpComponentAutoConfiguration.java b/components-starter/camel-clickup-starter/src/main/java/org/apache/camel/component/clickup/springboot/ClickUpComponentAutoConfiguration.java
index dc1d066652e..a54320c4bcf 100644
--- a/components-starter/camel-clickup-starter/src/main/java/org/apache/camel/component/clickup/springboot/ClickUpComponentAutoConfiguration.java
+++ b/components-starter/camel-clickup-starter/src/main/java/org/apache/camel/component/clickup/springboot/ClickUpComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ClickUpComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.clickup", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-cm-sms-starter/src/main/java/org/apache/camel/component/cm/springboot/CMComponentAutoConfiguration.java b/components-starter/camel-cm-sms-starter/src/main/java/org/apache/camel/component/cm/springboot/CMComponentAutoConfiguration.java
index f543f15e31b..d658fc17895 100644
--- a/components-starter/camel-cm-sms-starter/src/main/java/org/apache/camel/component/cm/springboot/CMComponentAutoConfiguration.java
+++ b/components-starter/camel-cm-sms-starter/src/main/java/org/apache/camel/component/cm/springboot/CMComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class CMComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.cm-sms", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-coap-starter/src/main/java/org/apache/camel/coap/springboot/CoAPComponentAutoConfiguration.java b/components-starter/camel-coap-starter/src/main/java/org/apache/camel/coap/springboot/CoAPComponentAutoConfiguration.java
index c21e20ddc24..3ea1acc19c1 100644
--- a/components-starter/camel-coap-starter/src/main/java/org/apache/camel/coap/springboot/CoAPComponentAutoConfiguration.java
+++ b/components-starter/camel-coap-starter/src/main/java/org/apache/camel/coap/springboot/CoAPComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class CoAPComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.coap", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-coap-starter/src/main/java/org/apache/camel/coap/springboot/CoAPComponentConverter.java b/components-starter/camel-coap-starter/src/main/java/org/apache/camel/coap/springboot/CoAPComponentConverter.java
index 86974bad1cb..509709b2d2c 100644
--- a/components-starter/camel-coap-starter/src/main/java/org/apache/camel/coap/springboot/CoAPComponentConverter.java
+++ b/components-starter/camel-coap-starter/src/main/java/org/apache/camel/coap/springboot/CoAPComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.coap.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class CoAPComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.eclipse.californium.core.CoapClient": return applicationContext.getBean(ref, org.eclipse.californium.core.CoapClient.class);
- case "org.apache.camel.spi.HeaderFilterStrategy": return applicationContext.getBean(ref, org.apache.camel.spi.HeaderFilterStrategy.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.coap");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-cometd-starter/src/main/java/org/apache/camel/component/cometd/springboot/CometdComponentAutoConfiguration.java b/components-starter/camel-cometd-starter/src/main/java/org/apache/camel/component/cometd/springboot/CometdComponentAutoConfiguration.java
index 40585bdf3cf..9021309dbf3 100644
--- a/components-starter/camel-cometd-starter/src/main/java/org/apache/camel/component/cometd/springboot/CometdComponentAutoConfiguration.java
+++ b/components-starter/camel-cometd-starter/src/main/java/org/apache/camel/component/cometd/springboot/CometdComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class CometdComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.cometd", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-cometd-starter/src/main/java/org/apache/camel/component/cometd/springboot/CometdComponentConverter.java b/components-starter/camel-cometd-starter/src/main/java/org/apache/camel/component/cometd/springboot/CometdComponentConverter.java
index 035b41ee51f..7651544f011 100644
--- a/components-starter/camel-cometd-starter/src/main/java/org/apache/camel/component/cometd/springboot/CometdComponentConverter.java
+++ b/components-starter/camel-cometd-starter/src/main/java/org/apache/camel/component/cometd/springboot/CometdComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.cometd.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class CometdComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.cometd.bayeux.server.SecurityPolicy": return applicationContext.getBean(ref, org.cometd.bayeux.server.SecurityPolicy.class);
- case "org.apache.camel.support.jsse.SSLContextParameters": return applicationContext.getBean(ref, org.apache.camel.support.jsse.SSLContextParameters.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.cometd");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/ConsulComponentAutoConfiguration.java b/components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/ConsulComponentAutoConfiguration.java
index f1b1eee8229..00edd9bbdd7 100644
--- a/components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/ConsulComponentAutoConfiguration.java
+++ b/components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/ConsulComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ConsulComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.consul", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/ConsulComponentConverter.java b/components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/ConsulComponentConverter.java
index 7a8bd6b057c..b98f94a5d8f 100644
--- a/components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/ConsulComponentConverter.java
+++ b/components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/ConsulComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.consul.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -50,20 +51,6 @@ public class ConsulComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.consul.ConsulConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.consul.ConsulConfiguration.class);
- case "org.kiwiproject.consul.Consul": return applicationContext.getBean(ref, org.kiwiproject.consul.Consul.class);
- case "org.apache.camel.support.jsse.SSLContextParameters": return applicationContext.getBean(ref, org.apache.camel.support.jsse.SSLContextParameters.class);
- case "java.math.BigInteger": return applicationContext.getBean(ref, java.math.BigInteger.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.consul");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-controlbus-starter/src/main/java/org/apache/camel/component/controlbus/springboot/ControlBusComponentAutoConfiguration.java b/components-starter/camel-controlbus-starter/src/main/java/org/apache/camel/component/controlbus/springboot/ControlBusComponentAutoConfiguration.java
index e4f65ce6f93..ae825f8111b 100644
--- a/components-starter/camel-controlbus-starter/src/main/java/org/apache/camel/component/controlbus/springboot/ControlBusComponentAutoConfiguration.java
+++ b/components-starter/camel-controlbus-starter/src/main/java/org/apache/camel/component/controlbus/springboot/ControlBusComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ControlBusComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.controlbus", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java
index dafb13f138d..0bdf363b629 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/constant/springboot/ConstantLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class ConstantLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.constant", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java
index f9d8dae67a4..d6d31df153c 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/header/springboot/HeaderLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class HeaderLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.header", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java
index e4f03af1546..58af27f053e 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class ExchangePropertyLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.exchange-property", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java
index 8e85223b3c4..04ebc51ae1a 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class RefLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.ref", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java
index 60af862ac29..791b776bf8d 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class FileLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.file", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java
index ce660f54fdf..975bee1cee1 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class SimpleLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.simple", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java
index d33e5b4d041..989a1fb6898 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class TokenizeLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.tokenize", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/variable/springboot/VariableLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/variable/springboot/VariableLanguageAutoConfiguration.java
index 239e563aad7..0fed7a8562a 100644
--- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/variable/springboot/VariableLanguageAutoConfiguration.java
+++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/variable/springboot/VariableLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class VariableLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.variable", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-couchbase-starter/src/main/java/org/apache/camel/component/couchbase/springboot/CouchbaseComponentAutoConfiguration.java b/components-starter/camel-couchbase-starter/src/main/java/org/apache/camel/component/couchbase/springboot/CouchbaseComponentAutoConfiguration.java
index 63ff5f7041a..fd5aeb3e555 100644
--- a/components-starter/camel-couchbase-starter/src/main/java/org/apache/camel/component/couchbase/springboot/CouchbaseComponentAutoConfiguration.java
+++ b/components-starter/camel-couchbase-starter/src/main/java/org/apache/camel/component/couchbase/springboot/CouchbaseComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class CouchbaseComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.couchbase", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-couchdb-starter/src/main/java/org/apache/camel/component/couchdb/springboot/CouchDbComponentAutoConfiguration.java b/components-starter/camel-couchdb-starter/src/main/java/org/apache/camel/component/couchdb/springboot/CouchDbComponentAutoConfiguration.java
index 21092c23c04..7c1427a566e 100644
--- a/components-starter/camel-couchdb-starter/src/main/java/org/apache/camel/component/couchdb/springboot/CouchDbComponentAutoConfiguration.java
+++ b/components-starter/camel-couchdb-starter/src/main/java/org/apache/camel/component/couchdb/springboot/CouchDbComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class CouchDbComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.couchdb", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-cron-starter/src/main/java/org/apache/camel/component/cron/springboot/CronComponentAutoConfiguration.java b/components-starter/camel-cron-starter/src/main/java/org/apache/camel/component/cron/springboot/CronComponentAutoConfiguration.java
index 358902e027e..27257d47516 100644
--- a/components-starter/camel-cron-starter/src/main/java/org/apache/camel/component/cron/springboot/CronComponentAutoConfiguration.java
+++ b/components-starter/camel-cron-starter/src/main/java/org/apache/camel/component/cron/springboot/CronComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class CronComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.cron", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-crypto-pgp-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatAutoConfiguration.java b/components-starter/camel-crypto-pgp-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatAutoConfiguration.java
index 4fe1118c7e1..0d65b6da150 100644
--- a/components-starter/camel-crypto-pgp-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatAutoConfiguration.java
+++ b/components-starter/camel-crypto-pgp-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class PGPDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.pgp", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/component/crypto/springboot/DigitalSignatureComponentAutoConfiguration.java b/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/component/crypto/springboot/DigitalSignatureComponentAutoConfiguration.java
index b10899b120f..319f8e8001d 100644
--- a/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/component/crypto/springboot/DigitalSignatureComponentAutoConfiguration.java
+++ b/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/component/crypto/springboot/DigitalSignatureComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DigitalSignatureComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.crypto", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/component/crypto/springboot/DigitalSignatureComponentConverter.java b/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/component/crypto/springboot/DigitalSignatureComponentConverter.java
index 101ac553f3a..b661def70bc 100644
--- a/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/component/crypto/springboot/DigitalSignatureComponentConverter.java
+++ b/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/component/crypto/springboot/DigitalSignatureComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.crypto.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -53,23 +54,6 @@ public class DigitalSignatureComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "java.security.KeyStore": return applicationContext.getBean(ref, java.security.KeyStore.class);
- case "java.security.PrivateKey": return applicationContext.getBean(ref, java.security.PrivateKey.class);
- case "java.security.cert.Certificate": return applicationContext.getBean(ref, java.security.cert.Certificate.class);
- case "org.apache.camel.component.crypto.DigitalSignatureConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.crypto.DigitalSignatureConfiguration.class);
- case "org.apache.camel.support.jsse.KeyStoreParameters": return applicationContext.getBean(ref, org.apache.camel.support.jsse.KeyStoreParameters.class);
- case "java.security.PublicKey": return applicationContext.getBean(ref, java.security.PublicKey.class);
- case "java.security.SecureRandom": return applicationContext.getBean(ref, java.security.SecureRandom.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.crypto");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatAutoConfiguration.java b/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatAutoConfiguration.java
index 036d02f9e76..cf1a47963d7 100644
--- a/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatAutoConfiguration.java
+++ b/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class CryptoDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.crypto", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatConverter.java b/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatConverter.java
index cab40a8a461..38e616c5cc3 100644
--- a/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatConverter.java
+++ b/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatConverter.java
@@ -18,7 +18,7 @@ package org.apache.camel.converter.crypto.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
-import org.apache.camel.CamelContext;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -49,18 +49,6 @@ public class CryptoDataFormatConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "java.security.Key": return applicationContext.getBean(ref, java.security.Key.class);
- case "java.security.spec.AlgorithmParameterSpec": return applicationContext.getBean(ref, java.security.spec.AlgorithmParameterSpec.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.dataformat.crypto");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatAutoConfiguration.java b/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatAutoConfiguration.java
index f6d43d28495..398523b3df2 100644
--- a/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatAutoConfiguration.java
+++ b/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class CsvDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.csv", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-cxf-rest-starter/src/main/java/org/apache/camel/component/cxf/jaxrs/springboot/CxfRsComponentAutoConfiguration.java b/components-starter/camel-cxf-rest-starter/src/main/java/org/apache/camel/component/cxf/jaxrs/springboot/CxfRsComponentAutoConfiguration.java
index 62f70537090..22787dcbebd 100644
--- a/components-starter/camel-cxf-rest-starter/src/main/java/org/apache/camel/component/cxf/jaxrs/springboot/CxfRsComponentAutoConfiguration.java
+++ b/components-starter/camel-cxf-rest-starter/src/main/java/org/apache/camel/component/cxf/jaxrs/springboot/CxfRsComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class CxfRsComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.cxfrs", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-cxf-rest-starter/src/main/java/org/apache/camel/component/cxf/jaxrs/springboot/CxfRsComponentConverter.java b/components-starter/camel-cxf-rest-starter/src/main/java/org/apache/camel/component/cxf/jaxrs/springboot/CxfRsComponentConverter.java
index f1e1d7bc257..fae37981a5c 100644
--- a/components-starter/camel-cxf-rest-starter/src/main/java/org/apache/camel/component/cxf/jaxrs/springboot/CxfRsComponentConverter.java
+++ b/components-starter/camel-cxf-rest-starter/src/main/java/org/apache/camel/component/cxf/jaxrs/springboot/CxfRsComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.cxf.jaxrs.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class CxfRsComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.spi.HeaderFilterStrategy": return applicationContext.getBean(ref, org.apache.camel.spi.HeaderFilterStrategy.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.cxfrs");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-cxf-soap-starter/src/main/java/org/apache/camel/component/cxf/jaxws/springboot/CxfComponentAutoConfiguration.java b/components-starter/camel-cxf-soap-starter/src/main/java/org/apache/camel/component/cxf/jaxws/springboot/CxfComponentAutoConfiguration.java
index 25226276b2f..ee18f339bd1 100644
--- a/components-starter/camel-cxf-soap-starter/src/main/java/org/apache/camel/component/cxf/jaxws/springboot/CxfComponentAutoConfiguration.java
+++ b/components-starter/camel-cxf-soap-starter/src/main/java/org/apache/camel/component/cxf/jaxws/springboot/CxfComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class CxfComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.cxf", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-cxf-soap-starter/src/main/java/org/apache/camel/component/cxf/jaxws/springboot/CxfComponentConverter.java b/components-starter/camel-cxf-soap-starter/src/main/java/org/apache/camel/component/cxf/jaxws/springboot/CxfComponentConverter.java
index a784a241232..7df583d9bac 100644
--- a/components-starter/camel-cxf-soap-starter/src/main/java/org/apache/camel/component/cxf/jaxws/springboot/CxfComponentConverter.java
+++ b/components-starter/camel-cxf-soap-starter/src/main/java/org/apache/camel/component/cxf/jaxws/springboot/CxfComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.cxf.jaxws.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class CxfComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.spi.HeaderFilterStrategy": return applicationContext.getBean(ref, org.apache.camel.spi.HeaderFilterStrategy.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.cxf");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-cyberark-vault-starter/src/main/java/org/apache/camel/component/cyberark/vault/springboot/CyberArkVaultComponentAutoConfiguration.java b/components-starter/camel-cyberark-vault-starter/src/main/java/org/apache/camel/component/cyberark/vault/springboot/CyberArkVaultComponentAutoConfiguration.java
index d1eea2502c3..c59e5953594 100644
--- a/components-starter/camel-cyberark-vault-starter/src/main/java/org/apache/camel/component/cyberark/vault/springboot/CyberArkVaultComponentAutoConfiguration.java
+++ b/components-starter/camel-cyberark-vault-starter/src/main/java/org/apache/camel/component/cyberark/vault/springboot/CyberArkVaultComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class CyberArkVaultComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.cyberark-vault", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-cyberark-vault-starter/src/main/java/org/apache/camel/component/cyberark/vault/springboot/CyberArkVaultComponentConverter.java b/components-starter/camel-cyberark-vault-starter/src/main/java/org/apache/camel/component/cyberark/vault/springboot/CyberArkVaultComponentConverter.java
index 2f04fe5a9db..0b6230f9bb9 100644
--- a/components-starter/camel-cyberark-vault-starter/src/main/java/org/apache/camel/component/cyberark/vault/springboot/CyberArkVaultComponentConverter.java
+++ b/components-starter/camel-cyberark-vault-starter/src/main/java/org/apache/camel/component/cyberark/vault/springboot/CyberArkVaultComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.cyberark.vault.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class CyberArkVaultComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.cyberark.vault.CyberArkVaultConfiguration.class);
- case "org.apache.camel.component.cyberark.vault.client.ConjurClient": return applicationContext.getBean(ref, org.apache.camel.component.cyberark.vault.client.ConjurClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.cyberark-vault");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-dapr-starter/src/main/java/org/apache/camel/component/dapr/springboot/DaprComponentAutoConfiguration.java b/components-starter/camel-dapr-starter/src/main/java/org/apache/camel/component/dapr/springboot/DaprComponentAutoConfiguration.java
index 25731648741..07a478b432b 100644
--- a/components-starter/camel-dapr-starter/src/main/java/org/apache/camel/component/dapr/springboot/DaprComponentAutoConfiguration.java
+++ b/components-starter/camel-dapr-starter/src/main/java/org/apache/camel/component/dapr/springboot/DaprComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DaprComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.dapr", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-dapr-starter/src/main/java/org/apache/camel/component/dapr/springboot/DaprComponentConverter.java b/components-starter/camel-dapr-starter/src/main/java/org/apache/camel/component/dapr/springboot/DaprComponentConverter.java
index f23feee6c82..409098babce 100644
--- a/components-starter/camel-dapr-starter/src/main/java/org/apache/camel/component/dapr/springboot/DaprComponentConverter.java
+++ b/components-starter/camel-dapr-starter/src/main/java/org/apache/camel/component/dapr/springboot/DaprComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.dapr.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -52,22 +53,6 @@ public class DaprComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "io.dapr.client.DaprClient": return applicationContext.getBean(ref, io.dapr.client.DaprClient.class);
- case "org.apache.camel.component.dapr.DaprConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.dapr.DaprConfiguration.class);
- case "io.dapr.client.DaprPreviewClient": return applicationContext.getBean(ref, io.dapr.client.DaprPreviewClient.class);
- case "io.dapr.client.domain.HttpExtension": return applicationContext.getBean(ref, io.dapr.client.domain.HttpExtension.class);
- case "io.dapr.workflows.client.DaprWorkflowClient": return applicationContext.getBean(ref, io.dapr.workflows.client.DaprWorkflowClient.class);
- case "org.apache.camel.spi.HeaderFilterStrategy": return applicationContext.getBean(ref, org.apache.camel.spi.HeaderFilterStrategy.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.dapr");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-dataformat-starter/src/main/java/org/apache/camel/component/dataformat/springboot/DataFormatComponentAutoConfiguration.java b/components-starter/camel-dataformat-starter/src/main/java/org/apache/camel/component/dataformat/springboot/DataFormatComponentAutoConfiguration.java
index c36f7d27a48..ab8d198c85b 100644
--- a/components-starter/camel-dataformat-starter/src/main/java/org/apache/camel/component/dataformat/springboot/DataFormatComponentAutoConfiguration.java
+++ b/components-starter/camel-dataformat-starter/src/main/java/org/apache/camel/component/dataformat/springboot/DataFormatComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DataFormatComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.dataformat", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-dataset-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetComponentAutoConfiguration.java b/components-starter/camel-dataset-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetComponentAutoConfiguration.java
index 574e24f3b52..c9d91414c7e 100644
--- a/components-starter/camel-dataset-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetComponentAutoConfiguration.java
+++ b/components-starter/camel-dataset-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DataSetComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.dataset", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-dataset-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetComponentConverter.java b/components-starter/camel-dataset-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetComponentConverter.java
index f0e882a21d1..07b70c9426d 100644
--- a/components-starter/camel-dataset-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetComponentConverter.java
+++ b/components-starter/camel-dataset-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.dataset.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class DataSetComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.spi.ExchangeFormatter": return applicationContext.getBean(ref, org.apache.camel.spi.ExchangeFormatter.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.dataset");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-dataset-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetTestComponentAutoConfiguration.java b/components-starter/camel-dataset-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetTestComponentAutoConfiguration.java
index fcec3abb6cb..02cc9776279 100644
--- a/components-starter/camel-dataset-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetTestComponentAutoConfiguration.java
+++ b/components-starter/camel-dataset-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetTestComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DataSetTestComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.dataset-test", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-dataset-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetTestComponentConverter.java b/components-starter/camel-dataset-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetTestComponentConverter.java
index e9829d65ff4..4cf8e5c90e7 100644
--- a/components-starter/camel-dataset-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetTestComponentConverter.java
+++ b/components-starter/camel-dataset-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetTestComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.dataset.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class DataSetTestComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.spi.ExchangeFormatter": return applicationContext.getBean(ref, org.apache.camel.spi.ExchangeFormatter.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.dataset-test");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-datasonnet-starter/src/main/java/org/apache/camel/language/datasonnet/springboot/DatasonnetLanguageAutoConfiguration.java b/components-starter/camel-datasonnet-starter/src/main/java/org/apache/camel/language/datasonnet/springboot/DatasonnetLanguageAutoConfiguration.java
index 0dbb2e4e3c5..e41d1e3d6c0 100644
--- a/components-starter/camel-datasonnet-starter/src/main/java/org/apache/camel/language/datasonnet/springboot/DatasonnetLanguageAutoConfiguration.java
+++ b/components-starter/camel-datasonnet-starter/src/main/java/org/apache/camel/language/datasonnet/springboot/DatasonnetLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class DatasonnetLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.datasonnet", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-debezium-db2-starter/src/main/java/org/apache/camel/component/debezium/db2/springboot/DebeziumDb2ComponentAutoConfiguration.java b/components-starter/camel-debezium-db2-starter/src/main/java/org/apache/camel/component/debezium/db2/springboot/DebeziumDb2ComponentAutoConfiguration.java
index 7fec86442d1..4b71808528b 100644
--- a/components-starter/camel-debezium-db2-starter/src/main/java/org/apache/camel/component/debezium/db2/springboot/DebeziumDb2ComponentAutoConfiguration.java
+++ b/components-starter/camel-debezium-db2-starter/src/main/java/org/apache/camel/component/debezium/db2/springboot/DebeziumDb2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DebeziumDb2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.debezium-db2", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-debezium-db2-starter/src/main/java/org/apache/camel/component/debezium/db2/springboot/DebeziumDb2ComponentConverter.java b/components-starter/camel-debezium-db2-starter/src/main/java/org/apache/camel/component/debezium/db2/springboot/DebeziumDb2ComponentConverter.java
index 9a498a109a2..b57964d7e37 100644
--- a/components-starter/camel-debezium-db2-starter/src/main/java/org/apache/camel/component/debezium/db2/springboot/DebeziumDb2ComponentConverter.java
+++ b/components-starter/camel-debezium-db2-starter/src/main/java/org/apache/camel/component/debezium/db2/springboot/DebeziumDb2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.debezium.db2.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class DebeziumDb2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.debezium.db2.configuration.Db2ConnectorEmbeddedDebeziumConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.debezium.db2.configuration.Db2ConnectorEmbeddedDebeziumConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.debezium-db2");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-debezium-mongodb-starter/src/main/java/org/apache/camel/component/debezium/mongodb/springboot/DebeziumMongodbComponentAutoConfiguration.java b/components-starter/camel-debezium-mongodb-starter/src/main/java/org/apache/camel/component/debezium/mongodb/springboot/DebeziumMongodbComponentAutoConfiguration.java
index c5ca050ea3e..fb04b89935a 100644
--- a/components-starter/camel-debezium-mongodb-starter/src/main/java/org/apache/camel/component/debezium/mongodb/springboot/DebeziumMongodbComponentAutoConfiguration.java
+++ b/components-starter/camel-debezium-mongodb-starter/src/main/java/org/apache/camel/component/debezium/mongodb/springboot/DebeziumMongodbComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DebeziumMongodbComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.debezium-mongodb", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-debezium-mongodb-starter/src/main/java/org/apache/camel/component/debezium/mongodb/springboot/DebeziumMongodbComponentConverter.java b/components-starter/camel-debezium-mongodb-starter/src/main/java/org/apache/camel/component/debezium/mongodb/springboot/DebeziumMongodbComponentConverter.java
index e51cacafed7..e0c71d18a13 100644
--- a/components-starter/camel-debezium-mongodb-starter/src/main/java/org/apache/camel/component/debezium/mongodb/springboot/DebeziumMongodbComponentConverter.java
+++ b/components-starter/camel-debezium-mongodb-starter/src/main/java/org/apache/camel/component/debezium/mongodb/springboot/DebeziumMongodbComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.debezium.mongodb.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class DebeziumMongodbComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.debezium.mongodb.configuration.MongoDbConnectorEmbeddedDebeziumConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.debezium.mongodb.configuration.MongoDbConnectorEmbeddedDebeziumConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.debezium-mongodb");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-debezium-mysql-starter/src/main/java/org/apache/camel/component/debezium/mysql/springboot/DebeziumMySqlComponentAutoConfiguration.java b/components-starter/camel-debezium-mysql-starter/src/main/java/org/apache/camel/component/debezium/mysql/springboot/DebeziumMySqlComponentAutoConfiguration.java
index be20eb32f16..931e99c030b 100644
--- a/components-starter/camel-debezium-mysql-starter/src/main/java/org/apache/camel/component/debezium/mysql/springboot/DebeziumMySqlComponentAutoConfiguration.java
+++ b/components-starter/camel-debezium-mysql-starter/src/main/java/org/apache/camel/component/debezium/mysql/springboot/DebeziumMySqlComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DebeziumMySqlComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.debezium-mysql", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-debezium-mysql-starter/src/main/java/org/apache/camel/component/debezium/mysql/springboot/DebeziumMySqlComponentConverter.java b/components-starter/camel-debezium-mysql-starter/src/main/java/org/apache/camel/component/debezium/mysql/springboot/DebeziumMySqlComponentConverter.java
index cdcc5466c85..fcf6630e1e1 100644
--- a/components-starter/camel-debezium-mysql-starter/src/main/java/org/apache/camel/component/debezium/mysql/springboot/DebeziumMySqlComponentConverter.java
+++ b/components-starter/camel-debezium-mysql-starter/src/main/java/org/apache/camel/component/debezium/mysql/springboot/DebeziumMySqlComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.debezium.mysql.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class DebeziumMySqlComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.debezium.mysql.configuration.MySqlConnectorEmbeddedDebeziumConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.debezium.mysql.configuration.MySqlConnectorEmbeddedDebeziumConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.debezium-mysql");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-debezium-oracle-starter/src/main/java/org/apache/camel/component/debezium/oracle/springboot/DebeziumOracleComponentAutoConfiguration.java b/components-starter/camel-debezium-oracle-starter/src/main/java/org/apache/camel/component/debezium/oracle/springboot/DebeziumOracleComponentAutoConfiguration.java
index 902e08d7f09..e4cb42bad9a 100644
--- a/components-starter/camel-debezium-oracle-starter/src/main/java/org/apache/camel/component/debezium/oracle/springboot/DebeziumOracleComponentAutoConfiguration.java
+++ b/components-starter/camel-debezium-oracle-starter/src/main/java/org/apache/camel/component/debezium/oracle/springboot/DebeziumOracleComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DebeziumOracleComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.debezium-oracle", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-debezium-oracle-starter/src/main/java/org/apache/camel/component/debezium/oracle/springboot/DebeziumOracleComponentConverter.java b/components-starter/camel-debezium-oracle-starter/src/main/java/org/apache/camel/component/debezium/oracle/springboot/DebeziumOracleComponentConverter.java
index 80296378152..bdf5469fdb5 100644
--- a/components-starter/camel-debezium-oracle-starter/src/main/java/org/apache/camel/component/debezium/oracle/springboot/DebeziumOracleComponentConverter.java
+++ b/components-starter/camel-debezium-oracle-starter/src/main/java/org/apache/camel/component/debezium/oracle/springboot/DebeziumOracleComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.debezium.oracle.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class DebeziumOracleComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.debezium.oracle.configuration.OracleConnectorEmbeddedDebeziumConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.debezium.oracle.configuration.OracleConnectorEmbeddedDebeziumConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.debezium-oracle");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-debezium-postgres-starter/src/main/java/org/apache/camel/component/debezium/postgres/springboot/DebeziumPostgresComponentAutoConfiguration.java b/components-starter/camel-debezium-postgres-starter/src/main/java/org/apache/camel/component/debezium/postgres/springboot/DebeziumPostgresComponentAutoConfiguration.java
index e31bdd9d677..5e4d678beed 100644
--- a/components-starter/camel-debezium-postgres-starter/src/main/java/org/apache/camel/component/debezium/postgres/springboot/DebeziumPostgresComponentAutoConfiguration.java
+++ b/components-starter/camel-debezium-postgres-starter/src/main/java/org/apache/camel/component/debezium/postgres/springboot/DebeziumPostgresComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DebeziumPostgresComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.debezium-postgres", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-debezium-postgres-starter/src/main/java/org/apache/camel/component/debezium/postgres/springboot/DebeziumPostgresComponentConverter.java b/components-starter/camel-debezium-postgres-starter/src/main/java/org/apache/camel/component/debezium/postgres/springboot/DebeziumPostgresComponentConverter.java
index 63ae8ad447b..77a8ec82e81 100644
--- a/components-starter/camel-debezium-postgres-starter/src/main/java/org/apache/camel/component/debezium/postgres/springboot/DebeziumPostgresComponentConverter.java
+++ b/components-starter/camel-debezium-postgres-starter/src/main/java/org/apache/camel/component/debezium/postgres/springboot/DebeziumPostgresComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.debezium.postgres.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class DebeziumPostgresComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.debezium.postgres.configuration.PostgresConnectorEmbeddedDebeziumConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.debezium.postgres.configuration.PostgresConnectorEmbeddedDebeziumConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.debezium-postgres");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-debezium-sqlserver-starter/src/main/java/org/apache/camel/component/debezium/sqlserver/springboot/DebeziumSqlserverComponentAutoConfiguration.java b/components-starter/camel-debezium-sqlserver-starter/src/main/java/org/apache/camel/component/debezium/sqlserver/springboot/DebeziumSqlserverComponentAutoConfiguration.java
index 09a22bf691e..7cb7943d87a 100644
--- a/components-starter/camel-debezium-sqlserver-starter/src/main/java/org/apache/camel/component/debezium/sqlserver/springboot/DebeziumSqlserverComponentAutoConfiguration.java
+++ b/components-starter/camel-debezium-sqlserver-starter/src/main/java/org/apache/camel/component/debezium/sqlserver/springboot/DebeziumSqlserverComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DebeziumSqlserverComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.debezium-sqlserver", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-debezium-sqlserver-starter/src/main/java/org/apache/camel/component/debezium/sqlserver/springboot/DebeziumSqlserverComponentConverter.java b/components-starter/camel-debezium-sqlserver-starter/src/main/java/org/apache/camel/component/debezium/sqlserver/springboot/DebeziumSqlserverComponentConverter.java
index a0b394b3923..e568c2366b2 100644
--- a/components-starter/camel-debezium-sqlserver-starter/src/main/java/org/apache/camel/component/debezium/sqlserver/springboot/DebeziumSqlserverComponentConverter.java
+++ b/components-starter/camel-debezium-sqlserver-starter/src/main/java/org/apache/camel/component/debezium/sqlserver/springboot/DebeziumSqlserverComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.debezium.sqlserver.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class DebeziumSqlserverComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.debezium.sqlserver.configuration.SqlServerConnectorEmbeddedDebeziumConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.debezium.sqlserver.configuration.SqlServerConnectorEmbeddedDebeziumConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.debezium-sqlserver");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-dfdl-starter/src/main/java/org/apache/camel/component/dfdl/springboot/DfdlComponentAutoConfiguration.java b/components-starter/camel-dfdl-starter/src/main/java/org/apache/camel/component/dfdl/springboot/DfdlComponentAutoConfiguration.java
index 0a7c36b6d1e..7a80ab988e1 100644
--- a/components-starter/camel-dfdl-starter/src/main/java/org/apache/camel/component/dfdl/springboot/DfdlComponentAutoConfiguration.java
+++ b/components-starter/camel-dfdl-starter/src/main/java/org/apache/camel/component/dfdl/springboot/DfdlComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DfdlComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.dfdl", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-dfdl-starter/src/main/java/org/apache/camel/dataformat/dfdl/springboot/DfdlDataFormatAutoConfiguration.java b/components-starter/camel-dfdl-starter/src/main/java/org/apache/camel/dataformat/dfdl/springboot/DfdlDataFormatAutoConfiguration.java
index a2811aec8db..26217304a43 100644
--- a/components-starter/camel-dfdl-starter/src/main/java/org/apache/camel/dataformat/dfdl/springboot/DfdlDataFormatAutoConfiguration.java
+++ b/components-starter/camel-dfdl-starter/src/main/java/org/apache/camel/dataformat/dfdl/springboot/DfdlDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class DfdlDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.dfdl", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-dhis2-starter/src/main/java/org/apache/camel/component/dhis2/springboot/Dhis2ComponentAutoConfiguration.java b/components-starter/camel-dhis2-starter/src/main/java/org/apache/camel/component/dhis2/springboot/Dhis2ComponentAutoConfiguration.java
index 2e7658b74e7..25844983c4e 100644
--- a/components-starter/camel-dhis2-starter/src/main/java/org/apache/camel/component/dhis2/springboot/Dhis2ComponentAutoConfiguration.java
+++ b/components-starter/camel-dhis2-starter/src/main/java/org/apache/camel/component/dhis2/springboot/Dhis2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Dhis2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.dhis2", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-dhis2-starter/src/main/java/org/apache/camel/component/dhis2/springboot/Dhis2ComponentConverter.java b/components-starter/camel-dhis2-starter/src/main/java/org/apache/camel/component/dhis2/springboot/Dhis2ComponentConverter.java
index 1f1728523f1..1e502bc794d 100644
--- a/components-starter/camel-dhis2-starter/src/main/java/org/apache/camel/component/dhis2/springboot/Dhis2ComponentConverter.java
+++ b/components-starter/camel-dhis2-starter/src/main/java/org/apache/camel/component/dhis2/springboot/Dhis2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.dhis2.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class Dhis2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.hisp.dhis.integration.sdk.api.Dhis2Client": return applicationContext.getBean(ref, org.hisp.dhis.integration.sdk.api.Dhis2Client.class);
- case "org.apache.camel.component.dhis2.Dhis2Configuration": return applicationContext.getBean(ref, org.apache.camel.component.dhis2.Dhis2Configuration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.dhis2");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-direct-starter/src/main/java/org/apache/camel/component/direct/springboot/DirectComponentAutoConfiguration.java b/components-starter/camel-direct-starter/src/main/java/org/apache/camel/component/direct/springboot/DirectComponentAutoConfiguration.java
index 808a381a60d..1045e890329 100644
--- a/components-starter/camel-direct-starter/src/main/java/org/apache/camel/component/direct/springboot/DirectComponentAutoConfiguration.java
+++ b/components-starter/camel-direct-starter/src/main/java/org/apache/camel/component/direct/springboot/DirectComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DirectComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.direct", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/springboot/DisruptorComponentAutoConfiguration.java b/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/springboot/DisruptorComponentAutoConfiguration.java
index 2e212f8141c..d213adb6d36 100644
--- a/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/springboot/DisruptorComponentAutoConfiguration.java
+++ b/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/springboot/DisruptorComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DisruptorComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.disruptor", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/vm/springboot/DisruptorVmComponentAutoConfiguration.java b/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/vm/springboot/DisruptorVmComponentAutoConfiguration.java
index cf65b820207..d3ef10f20ac 100644
--- a/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/vm/springboot/DisruptorVmComponentAutoConfiguration.java
+++ b/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/vm/springboot/DisruptorVmComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DisruptorVmComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.disruptor-vm", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-djl-starter/src/main/java/org/apache/camel/component/djl/springboot/DJLComponentAutoConfiguration.java b/components-starter/camel-djl-starter/src/main/java/org/apache/camel/component/djl/springboot/DJLComponentAutoConfiguration.java
index 05ffc243de2..0c17dd287e4 100644
--- a/components-starter/camel-djl-starter/src/main/java/org/apache/camel/component/djl/springboot/DJLComponentAutoConfiguration.java
+++ b/components-starter/camel-djl-starter/src/main/java/org/apache/camel/component/djl/springboot/DJLComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DJLComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.djl", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-dns-starter/src/main/java/org/apache/camel/component/dns/springboot/DnsComponentAutoConfiguration.java b/components-starter/camel-dns-starter/src/main/java/org/apache/camel/component/dns/springboot/DnsComponentAutoConfiguration.java
index e0ab829c237..ce9d6fcc181 100644
--- a/components-starter/camel-dns-starter/src/main/java/org/apache/camel/component/dns/springboot/DnsComponentAutoConfiguration.java
+++ b/components-starter/camel-dns-starter/src/main/java/org/apache/camel/component/dns/springboot/DnsComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DnsComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.dns", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-docker-starter/src/main/java/org/apache/camel/component/docker/springboot/DockerComponentAutoConfiguration.java b/components-starter/camel-docker-starter/src/main/java/org/apache/camel/component/docker/springboot/DockerComponentAutoConfiguration.java
index 7fc30120406..6b3504b2260 100644
--- a/components-starter/camel-docker-starter/src/main/java/org/apache/camel/component/docker/springboot/DockerComponentAutoConfiguration.java
+++ b/components-starter/camel-docker-starter/src/main/java/org/apache/camel/component/docker/springboot/DockerComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DockerComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.docker", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-docker-starter/src/main/java/org/apache/camel/component/docker/springboot/DockerComponentConverter.java b/components-starter/camel-docker-starter/src/main/java/org/apache/camel/component/docker/springboot/DockerComponentConverter.java
index 54914a9c68b..771c45c485e 100644
--- a/components-starter/camel-docker-starter/src/main/java/org/apache/camel/component/docker/springboot/DockerComponentConverter.java
+++ b/components-starter/camel-docker-starter/src/main/java/org/apache/camel/component/docker/springboot/DockerComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.docker.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class DockerComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.docker.DockerConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.docker.DockerConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.docker");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-docling-starter/src/main/java/org/apache/camel/component/docling/springboot/DoclingComponentAutoConfiguration.java b/components-starter/camel-docling-starter/src/main/java/org/apache/camel/component/docling/springboot/DoclingComponentAutoConfiguration.java
index 778c9355eb4..e28724abfcd 100644
--- a/components-starter/camel-docling-starter/src/main/java/org/apache/camel/component/docling/springboot/DoclingComponentAutoConfiguration.java
+++ b/components-starter/camel-docling-starter/src/main/java/org/apache/camel/component/docling/springboot/DoclingComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DoclingComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.docling", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-docling-starter/src/main/java/org/apache/camel/component/docling/springboot/DoclingComponentConverter.java b/components-starter/camel-docling-starter/src/main/java/org/apache/camel/component/docling/springboot/DoclingComponentConverter.java
index af1131246e5..16f43dda1ed 100644
--- a/components-starter/camel-docling-starter/src/main/java/org/apache/camel/component/docling/springboot/DoclingComponentConverter.java
+++ b/components-starter/camel-docling-starter/src/main/java/org/apache/camel/component/docling/springboot/DoclingComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.docling.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class DoclingComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.docling.DoclingConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.docling.DoclingConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.docling");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-drill-starter/src/main/java/org/apache/camel/component/drill/springboot/DrillComponentAutoConfiguration.java b/components-starter/camel-drill-starter/src/main/java/org/apache/camel/component/drill/springboot/DrillComponentAutoConfiguration.java
index a1c70cec36f..101209ec1e1 100644
--- a/components-starter/camel-drill-starter/src/main/java/org/apache/camel/component/drill/springboot/DrillComponentAutoConfiguration.java
+++ b/components-starter/camel-drill-starter/src/main/java/org/apache/camel/component/drill/springboot/DrillComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DrillComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.drill", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-dropbox-starter/src/main/java/org/apache/camel/component/dropbox/springboot/DropboxComponentAutoConfiguration.java b/components-starter/camel-dropbox-starter/src/main/java/org/apache/camel/component/dropbox/springboot/DropboxComponentAutoConfiguration.java
index 1d55aa99c39..b1e59361cea 100644
--- a/components-starter/camel-dropbox-starter/src/main/java/org/apache/camel/component/dropbox/springboot/DropboxComponentAutoConfiguration.java
+++ b/components-starter/camel-dropbox-starter/src/main/java/org/apache/camel/component/dropbox/springboot/DropboxComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DropboxComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.dropbox", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-duckdb-starter/src/main/java/org/apache/camel/component/duckdb/springboot/DuckDbComponentAutoConfiguration.java b/components-starter/camel-duckdb-starter/src/main/java/org/apache/camel/component/duckdb/springboot/DuckDbComponentAutoConfiguration.java
index 9198847f95c..e9082c9c2bd 100644
--- a/components-starter/camel-duckdb-starter/src/main/java/org/apache/camel/component/duckdb/springboot/DuckDbComponentAutoConfiguration.java
+++ b/components-starter/camel-duckdb-starter/src/main/java/org/apache/camel/component/duckdb/springboot/DuckDbComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DuckDbComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.duckdb", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-duckdb-starter/src/main/java/org/apache/camel/component/duckdb/springboot/DuckDbComponentConverter.java b/components-starter/camel-duckdb-starter/src/main/java/org/apache/camel/component/duckdb/springboot/DuckDbComponentConverter.java
index 660a4138220..32787cb6ffb 100644
--- a/components-starter/camel-duckdb-starter/src/main/java/org/apache/camel/component/duckdb/springboot/DuckDbComponentConverter.java
+++ b/components-starter/camel-duckdb-starter/src/main/java/org/apache/camel/component/duckdb/springboot/DuckDbComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.duckdb.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class DuckDbComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "javax.sql.DataSource": return applicationContext.getBean(ref, javax.sql.DataSource.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.duckdb");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-dynamic-router-starter/src/main/java/org/apache/camel/component/dynamicrouter/control/springboot/DynamicRouterControlComponentAutoConfiguration.java b/components-starter/camel-dynamic-router-starter/src/main/java/org/apache/camel/component/dynamicrouter/control/springboot/DynamicRouterControlComponentAutoConfiguration.java
index 4b181f49f21..6519c16ca61 100644
--- a/components-starter/camel-dynamic-router-starter/src/main/java/org/apache/camel/component/dynamicrouter/control/springboot/DynamicRouterControlComponentAutoConfiguration.java
+++ b/components-starter/camel-dynamic-router-starter/src/main/java/org/apache/camel/component/dynamicrouter/control/springboot/DynamicRouterControlComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DynamicRouterControlComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.dynamic-router-control", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-dynamic-router-starter/src/main/java/org/apache/camel/component/dynamicrouter/routing/springboot/DynamicRouterComponentAutoConfiguration.java b/components-starter/camel-dynamic-router-starter/src/main/java/org/apache/camel/component/dynamicrouter/routing/springboot/DynamicRouterComponentAutoConfiguration.java
index 56b8bf54d0f..721ddbefb16 100644
--- a/components-starter/camel-dynamic-router-starter/src/main/java/org/apache/camel/component/dynamicrouter/routing/springboot/DynamicRouterComponentAutoConfiguration.java
+++ b/components-starter/camel-dynamic-router-starter/src/main/java/org/apache/camel/component/dynamicrouter/routing/springboot/DynamicRouterComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DynamicRouterComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.dynamic-router", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ehcache-starter/src/main/java/org/apache/camel/component/ehcache/springboot/EhcacheComponentAutoConfiguration.java b/components-starter/camel-ehcache-starter/src/main/java/org/apache/camel/component/ehcache/springboot/EhcacheComponentAutoConfiguration.java
index 7b5f764a8ba..11ae4f8f691 100644
--- a/components-starter/camel-ehcache-starter/src/main/java/org/apache/camel/component/ehcache/springboot/EhcacheComponentAutoConfiguration.java
+++ b/components-starter/camel-ehcache-starter/src/main/java/org/apache/camel/component/ehcache/springboot/EhcacheComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class EhcacheComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ehcache", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ehcache-starter/src/main/java/org/apache/camel/component/ehcache/springboot/EhcacheComponentConverter.java b/components-starter/camel-ehcache-starter/src/main/java/org/apache/camel/component/ehcache/springboot/EhcacheComponentConverter.java
index c26ff07959f..7d496d4dd94 100644
--- a/components-starter/camel-ehcache-starter/src/main/java/org/apache/camel/component/ehcache/springboot/EhcacheComponentConverter.java
+++ b/components-starter/camel-ehcache-starter/src/main/java/org/apache/camel/component/ehcache/springboot/EhcacheComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.ehcache.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -49,19 +50,6 @@ public class EhcacheComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.ehcache.CacheManager": return applicationContext.getBean(ref, org.ehcache.CacheManager.class);
- case "org.ehcache.config.Configuration": return applicationContext.getBean(ref, org.ehcache.config.Configuration.class);
- case "org.ehcache.config.CacheConfiguration": return applicationContext.getBean(ref, org.ehcache.config.CacheConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.ehcache");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentAutoConfiguration.java b/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentAutoConfiguration.java
index 2ff8abaa9d9..e713e9916c9 100644
--- a/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentAutoConfiguration.java
+++ b/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ElasticsearchRestClientComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.elasticsearch-rest-client", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentConverter.java b/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentConverter.java
index 5772d6d6f81..1439874f7ff 100644
--- a/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentConverter.java
+++ b/components-starter/camel-elasticsearch-rest-client-starter/src/main/java/org/apache/camel/component/elasticsearch/rest/client/springboot/ElasticsearchRestClientComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.elasticsearch.rest.client.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -50,18 +51,6 @@ public class ElasticsearchRestClientComponentConverter
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.elasticsearch.client.RestClient": return applicationContext.getBean(ref, org.elasticsearch.client.RestClient.class);
- case "org.apache.camel.support.jsse.SSLContextParameters": return applicationContext.getBean(ref, org.apache.camel.support.jsse.SSLContextParameters.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.elasticsearch-rest-client");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-elasticsearch-starter/src/main/java/org/apache/camel/component/es/springboot/ElasticsearchComponentAutoConfiguration.java b/components-starter/camel-elasticsearch-starter/src/main/java/org/apache/camel/component/es/springboot/ElasticsearchComponentAutoConfiguration.java
index 4e26316a279..6d004941c8e 100644
--- a/components-starter/camel-elasticsearch-starter/src/main/java/org/apache/camel/component/es/springboot/ElasticsearchComponentAutoConfiguration.java
+++ b/components-starter/camel-elasticsearch-starter/src/main/java/org/apache/camel/component/es/springboot/ElasticsearchComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ElasticsearchComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.elasticsearch", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-elasticsearch-starter/src/main/java/org/apache/camel/component/es/springboot/ElasticsearchComponentConverter.java b/components-starter/camel-elasticsearch-starter/src/main/java/org/apache/camel/component/es/springboot/ElasticsearchComponentConverter.java
index bc187763374..0b16efd49cb 100644
--- a/components-starter/camel-elasticsearch-starter/src/main/java/org/apache/camel/component/es/springboot/ElasticsearchComponentConverter.java
+++ b/components-starter/camel-elasticsearch-starter/src/main/java/org/apache/camel/component/es/springboot/ElasticsearchComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.es.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class ElasticsearchComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.elasticsearch.client.RestClient": return applicationContext.getBean(ref, org.elasticsearch.client.RestClient.class);
- case "org.apache.camel.support.jsse.SSLContextParameters": return applicationContext.getBean(ref, org.apache.camel.support.jsse.SSLContextParameters.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.elasticsearch");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-exec-starter/src/main/java/org/apache/camel/component/exec/springboot/ExecComponentAutoConfiguration.java b/components-starter/camel-exec-starter/src/main/java/org/apache/camel/component/exec/springboot/ExecComponentAutoConfiguration.java
index 19994477c1a..bd4a43e5d3f 100644
--- a/components-starter/camel-exec-starter/src/main/java/org/apache/camel/component/exec/springboot/ExecComponentAutoConfiguration.java
+++ b/components-starter/camel-exec-starter/src/main/java/org/apache/camel/component/exec/springboot/ExecComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ExecComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.exec", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-exec-starter/src/main/java/org/apache/camel/component/exec/springboot/ExecComponentConverter.java b/components-starter/camel-exec-starter/src/main/java/org/apache/camel/component/exec/springboot/ExecComponentConverter.java
index d5d6ab5b1f3..7e03b680887 100644
--- a/components-starter/camel-exec-starter/src/main/java/org/apache/camel/component/exec/springboot/ExecComponentConverter.java
+++ b/components-starter/camel-exec-starter/src/main/java/org/apache/camel/component/exec/springboot/ExecComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.exec.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class ExecComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.exec.ExecBinding": return applicationContext.getBean(ref, org.apache.camel.component.exec.ExecBinding.class);
- case "org.apache.camel.component.exec.ExecCommandExecutor": return applicationContext.getBean(ref, org.apache.camel.component.exec.ExecCommandExecutor.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.exec");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-fastjson-starter/src/main/java/org/apache/camel/component/fastjson/springboot/FastjsonDataFormatAutoConfiguration.java b/components-starter/camel-fastjson-starter/src/main/java/org/apache/camel/component/fastjson/springboot/FastjsonDataFormatAutoConfiguration.java
index 6b04873e2d0..e3b26e0b3ba 100644
--- a/components-starter/camel-fastjson-starter/src/main/java/org/apache/camel/component/fastjson/springboot/FastjsonDataFormatAutoConfiguration.java
+++ b/components-starter/camel-fastjson-starter/src/main/java/org/apache/camel/component/fastjson/springboot/FastjsonDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class FastjsonDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.fastjson", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirComponentAutoConfiguration.java b/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirComponentAutoConfiguration.java
index 325d5ed59b8..709518fda93 100644
--- a/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirComponentAutoConfiguration.java
+++ b/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class FhirComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.fhir", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirComponentConverter.java b/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirComponentConverter.java
index d0592f7b1bb..9e0224429bd 100644
--- a/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirComponentConverter.java
+++ b/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.fhir.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -50,20 +51,6 @@ public class FhirComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "ca.uhn.fhir.rest.client.api.IGenericClient": return applicationContext.getBean(ref, ca.uhn.fhir.rest.client.api.IGenericClient.class);
- case "ca.uhn.fhir.rest.client.api.IRestfulClientFactory": return applicationContext.getBean(ref, ca.uhn.fhir.rest.client.api.IRestfulClientFactory.class);
- case "org.apache.camel.component.fhir.FhirConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.fhir.FhirConfiguration.class);
- case "ca.uhn.fhir.context.FhirContext": return applicationContext.getBean(ref, ca.uhn.fhir.context.FhirContext.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.fhir");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirJsonDataFormatAutoConfiguration.java b/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirJsonDataFormatAutoConfiguration.java
index 4e56dfbde6c..5653da34a8c 100644
--- a/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirJsonDataFormatAutoConfiguration.java
+++ b/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirJsonDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class FhirJsonDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.fhir-json", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirXmlDataFormatAutoConfiguration.java b/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirXmlDataFormatAutoConfiguration.java
index b805b7e8e3e..f56bc0f6315 100644
--- a/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirXmlDataFormatAutoConfiguration.java
+++ b/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirXmlDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class FhirXmlDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.fhir-xml", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-file-starter/src/main/java/org/apache/camel/component/file/springboot/FileComponentAutoConfiguration.java b/components-starter/camel-file-starter/src/main/java/org/apache/camel/component/file/springboot/FileComponentAutoConfiguration.java
index 270e477bd2a..1e726dec367 100644
--- a/components-starter/camel-file-starter/src/main/java/org/apache/camel/component/file/springboot/FileComponentAutoConfiguration.java
+++ b/components-starter/camel-file-starter/src/main/java/org/apache/camel/component/file/springboot/FileComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class FileComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.file", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-file-watch-starter/src/main/java/org/apache/camel/component/file/watch/springboot/FileWatchComponentAutoConfiguration.java b/components-starter/camel-file-watch-starter/src/main/java/org/apache/camel/component/file/watch/springboot/FileWatchComponentAutoConfiguration.java
index 2c1e48ab475..51a87c04e2c 100644
--- a/components-starter/camel-file-watch-starter/src/main/java/org/apache/camel/component/file/watch/springboot/FileWatchComponentAutoConfiguration.java
+++ b/components-starter/camel-file-watch-starter/src/main/java/org/apache/camel/component/file/watch/springboot/FileWatchComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class FileWatchComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.file-watch", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-file-watch-starter/src/main/java/org/apache/camel/component/file/watch/springboot/FileWatchComponentConverter.java b/components-starter/camel-file-watch-starter/src/main/java/org/apache/camel/component/file/watch/springboot/FileWatchComponentConverter.java
index 04293797e2b..e9f75ae05fb 100644
--- a/components-starter/camel-file-watch-starter/src/main/java/org/apache/camel/component/file/watch/springboot/FileWatchComponentConverter.java
+++ b/components-starter/camel-file-watch-starter/src/main/java/org/apache/camel/component/file/watch/springboot/FileWatchComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.file.watch.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class FileWatchComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "io.methvin.watcher.hashing.FileHasher": return applicationContext.getBean(ref, io.methvin.watcher.hashing.FileHasher.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.file-watch");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/component/flatpack/springboot/FlatpackComponentAutoConfiguration.java b/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/component/flatpack/springboot/FlatpackComponentAutoConfiguration.java
index 8bdac27cddc..c8c85773d3d 100644
--- a/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/component/flatpack/springboot/FlatpackComponentAutoConfiguration.java
+++ b/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/component/flatpack/springboot/FlatpackComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class FlatpackComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.flatpack", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatAutoConfiguration.java b/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatAutoConfiguration.java
index 3a313549dc0..3f9661b6219 100644
--- a/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatAutoConfiguration.java
+++ b/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class FlatpackDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.flatpack", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatConverter.java b/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatConverter.java
index f6e82bdae33..e94071d8456 100644
--- a/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatConverter.java
+++ b/components-starter/camel-flatpack-starter/src/main/java/org/apache/camel/dataformat/flatpack/springboot/FlatpackDataFormatConverter.java
@@ -18,7 +18,7 @@ package org.apache.camel.dataformat.flatpack.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
-import org.apache.camel.CamelContext;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,17 +48,6 @@ public class FlatpackDataFormatConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "net.sf.flatpack.ParserFactory": return applicationContext.getBean(ref, net.sf.flatpack.ParserFactory.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.dataformat.flatpack");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-flink-starter/src/main/java/org/apache/camel/component/flink/springboot/FlinkComponentAutoConfiguration.java b/components-starter/camel-flink-starter/src/main/java/org/apache/camel/component/flink/springboot/FlinkComponentAutoConfiguration.java
index 941f89aafda..5969ae3c704 100644
--- a/components-starter/camel-flink-starter/src/main/java/org/apache/camel/component/flink/springboot/FlinkComponentAutoConfiguration.java
+++ b/components-starter/camel-flink-starter/src/main/java/org/apache/camel/component/flink/springboot/FlinkComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class FlinkComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.flink", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-flink-starter/src/main/java/org/apache/camel/component/flink/springboot/FlinkComponentConverter.java b/components-starter/camel-flink-starter/src/main/java/org/apache/camel/component/flink/springboot/FlinkComponentConverter.java
index 5b93cc8bce7..884b278f872 100644
--- a/components-starter/camel-flink-starter/src/main/java/org/apache/camel/component/flink/springboot/FlinkComponentConverter.java
+++ b/components-starter/camel-flink-starter/src/main/java/org/apache/camel/component/flink/springboot/FlinkComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.flink.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -49,19 +50,6 @@ public class FlinkComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.flink.DataSetCallback": return applicationContext.getBean(ref, org.apache.camel.component.flink.DataSetCallback.class);
- case "org.apache.flink.streaming.api.datastream.DataStream": return applicationContext.getBean(ref, org.apache.flink.streaming.api.datastream.DataStream.class);
- case "org.apache.camel.component.flink.DataStreamCallback": return applicationContext.getBean(ref, org.apache.camel.component.flink.DataStreamCallback.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.flink");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-flowable-starter/src/main/java/org/apache/camel/component/flowable/springboot/FlowableComponentAutoConfiguration.java b/components-starter/camel-flowable-starter/src/main/java/org/apache/camel/component/flowable/springboot/FlowableComponentAutoConfiguration.java
index e7ca8fc419f..e2d8631cb5c 100644
--- a/components-starter/camel-flowable-starter/src/main/java/org/apache/camel/component/flowable/springboot/FlowableComponentAutoConfiguration.java
+++ b/components-starter/camel-flowable-starter/src/main/java/org/apache/camel/component/flowable/springboot/FlowableComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class FlowableComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.flowable", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-fop-starter/src/main/java/org/apache/camel/component/fop/springboot/FopComponentAutoConfiguration.java b/components-starter/camel-fop-starter/src/main/java/org/apache/camel/component/fop/springboot/FopComponentAutoConfiguration.java
index 1656b268d35..380094ca2af 100644
--- a/components-starter/camel-fop-starter/src/main/java/org/apache/camel/component/fop/springboot/FopComponentAutoConfiguration.java
+++ b/components-starter/camel-fop-starter/src/main/java/org/apache/camel/component/fop/springboot/FopComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class FopComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.fop", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-fory-starter/src/main/java/org/apache/camel/component/fory/springboot/ForyDataFormatAutoConfiguration.java b/components-starter/camel-fory-starter/src/main/java/org/apache/camel/component/fory/springboot/ForyDataFormatAutoConfiguration.java
index 0c4030ea0f5..ab271a1f607 100644
--- a/components-starter/camel-fory-starter/src/main/java/org/apache/camel/component/fory/springboot/ForyDataFormatAutoConfiguration.java
+++ b/components-starter/camel-fory-starter/src/main/java/org/apache/camel/component/fory/springboot/ForyDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class ForyDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.fory", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-freemarker-starter/src/main/java/org/apache/camel/component/freemarker/springboot/FreemarkerComponentAutoConfiguration.java b/components-starter/camel-freemarker-starter/src/main/java/org/apache/camel/component/freemarker/springboot/FreemarkerComponentAutoConfiguration.java
index e356659366d..dbe8bdc3de3 100644
--- a/components-starter/camel-freemarker-starter/src/main/java/org/apache/camel/component/freemarker/springboot/FreemarkerComponentAutoConfiguration.java
+++ b/components-starter/camel-freemarker-starter/src/main/java/org/apache/camel/component/freemarker/springboot/FreemarkerComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class FreemarkerComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.freemarker", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-freemarker-starter/src/main/java/org/apache/camel/component/freemarker/springboot/FreemarkerComponentConverter.java b/components-starter/camel-freemarker-starter/src/main/java/org/apache/camel/component/freemarker/springboot/FreemarkerComponentConverter.java
index f9125601937..f092a8491ab 100644
--- a/components-starter/camel-freemarker-starter/src/main/java/org/apache/camel/component/freemarker/springboot/FreemarkerComponentConverter.java
+++ b/components-starter/camel-freemarker-starter/src/main/java/org/apache/camel/component/freemarker/springboot/FreemarkerComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.freemarker.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class FreemarkerComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "freemarker.template.Configuration": return applicationContext.getBean(ref, freemarker.template.Configuration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.freemarker");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpComponentAutoConfiguration.java b/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpComponentAutoConfiguration.java
index 545f1d7d5a0..e03cc26b1c1 100644
--- a/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpComponentAutoConfiguration.java
+++ b/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class FtpComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ftp", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpsComponentAutoConfiguration.java b/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpsComponentAutoConfiguration.java
index df3fe68c7f7..3bf2bb0d0f5 100644
--- a/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpsComponentAutoConfiguration.java
+++ b/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/FtpsComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class FtpsComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ftps", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/SftpComponentAutoConfiguration.java b/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/SftpComponentAutoConfiguration.java
index f7c42005109..2202e0d8ca1 100644
--- a/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/SftpComponentAutoConfiguration.java
+++ b/components-starter/camel-ftp-starter/src/main/java/org/apache/camel/component/file/remote/springboot/SftpComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class SftpComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.sftp", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-geocoder-starter/src/main/java/org/apache/camel/component/geocoder/springboot/GeoCoderComponentAutoConfiguration.java b/components-starter/camel-geocoder-starter/src/main/java/org/apache/camel/component/geocoder/springboot/GeoCoderComponentAutoConfiguration.java
index 26ee86901d8..63803bf9e4e 100644
--- a/components-starter/camel-geocoder-starter/src/main/java/org/apache/camel/component/geocoder/springboot/GeoCoderComponentAutoConfiguration.java
+++ b/components-starter/camel-geocoder-starter/src/main/java/org/apache/camel/component/geocoder/springboot/GeoCoderComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GeoCoderComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.geocoder", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-geocoder-starter/src/main/java/org/apache/camel/component/geocoder/springboot/GeoCoderComponentConverter.java b/components-starter/camel-geocoder-starter/src/main/java/org/apache/camel/component/geocoder/springboot/GeoCoderComponentConverter.java
index bfcc3e12aac..61b02230376 100644
--- a/components-starter/camel-geocoder-starter/src/main/java/org/apache/camel/component/geocoder/springboot/GeoCoderComponentConverter.java
+++ b/components-starter/camel-geocoder-starter/src/main/java/org/apache/camel/component/geocoder/springboot/GeoCoderComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.geocoder.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class GeoCoderComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.google.maps.GeoApiContext": return applicationContext.getBean(ref, com.google.maps.GeoApiContext.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.geocoder");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-git-starter/src/main/java/org/apache/camel/component/git/springboot/GitComponentAutoConfiguration.java b/components-starter/camel-git-starter/src/main/java/org/apache/camel/component/git/springboot/GitComponentAutoConfiguration.java
index 0ddebf0c3d6..d6b97640f6a 100644
--- a/components-starter/camel-git-starter/src/main/java/org/apache/camel/component/git/springboot/GitComponentAutoConfiguration.java
+++ b/components-starter/camel-git-starter/src/main/java/org/apache/camel/component/git/springboot/GitComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GitComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.git", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-github2-starter/src/main/java/org/apache/camel/component/github2/springboot/GitHub2ComponentAutoConfiguration.java b/components-starter/camel-github2-starter/src/main/java/org/apache/camel/component/github2/springboot/GitHub2ComponentAutoConfiguration.java
index 0583b0ef1d4..097f21e56f0 100644
--- a/components-starter/camel-github2-starter/src/main/java/org/apache/camel/component/github2/springboot/GitHub2ComponentAutoConfiguration.java
+++ b/components-starter/camel-github2-starter/src/main/java/org/apache/camel/component/github2/springboot/GitHub2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GitHub2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.github2", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-bigquery-starter/src/main/java/org/apache/camel/component/google/bigquery/springboot/GoogleBigQueryComponentAutoConfiguration.java b/components-starter/camel-google-bigquery-starter/src/main/java/org/apache/camel/component/google/bigquery/springboot/GoogleBigQueryComponentAutoConfiguration.java
index 1d6897ee3e2..6f564e8a518 100644
--- a/components-starter/camel-google-bigquery-starter/src/main/java/org/apache/camel/component/google/bigquery/springboot/GoogleBigQueryComponentAutoConfiguration.java
+++ b/components-starter/camel-google-bigquery-starter/src/main/java/org/apache/camel/component/google/bigquery/springboot/GoogleBigQueryComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GoogleBigQueryComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-bigquery", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-bigquery-starter/src/main/java/org/apache/camel/component/google/bigquery/springboot/GoogleBigQueryComponentConverter.java b/components-starter/camel-google-bigquery-starter/src/main/java/org/apache/camel/component/google/bigquery/springboot/GoogleBigQueryComponentConverter.java
index 405decacaf5..4a4c25877a9 100644
--- a/components-starter/camel-google-bigquery-starter/src/main/java/org/apache/camel/component/google/bigquery/springboot/GoogleBigQueryComponentConverter.java
+++ b/components-starter/camel-google-bigquery-starter/src/main/java/org/apache/camel/component/google/bigquery/springboot/GoogleBigQueryComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.google.bigquery.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class GoogleBigQueryComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.google.bigquery.GoogleBigQueryConnectionFactory": return applicationContext.getBean(ref, org.apache.camel.component.google.bigquery.GoogleBigQueryConnectionFactory.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.google-bigquery");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-google-bigquery-starter/src/main/java/org/apache/camel/component/google/bigquery/sql/springboot/GoogleBigQuerySQLComponentAutoConfiguration.java b/components-starter/camel-google-bigquery-starter/src/main/java/org/apache/camel/component/google/bigquery/sql/springboot/GoogleBigQuerySQLComponentAutoConfiguration.java
index 2b4013c50da..28628e6f89f 100644
--- a/components-starter/camel-google-bigquery-starter/src/main/java/org/apache/camel/component/google/bigquery/sql/springboot/GoogleBigQuerySQLComponentAutoConfiguration.java
+++ b/components-starter/camel-google-bigquery-starter/src/main/java/org/apache/camel/component/google/bigquery/sql/springboot/GoogleBigQuerySQLComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GoogleBigQuerySQLComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-bigquery-sql", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-bigquery-starter/src/main/java/org/apache/camel/component/google/bigquery/sql/springboot/GoogleBigQuerySQLComponentConverter.java b/components-starter/camel-google-bigquery-starter/src/main/java/org/apache/camel/component/google/bigquery/sql/springboot/GoogleBigQuerySQLComponentConverter.java
index 54f60001c58..a36e7d15827 100644
--- a/components-starter/camel-google-bigquery-starter/src/main/java/org/apache/camel/component/google/bigquery/sql/springboot/GoogleBigQuerySQLComponentConverter.java
+++ b/components-starter/camel-google-bigquery-starter/src/main/java/org/apache/camel/component/google/bigquery/sql/springboot/GoogleBigQuerySQLComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.google.bigquery.sql.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class GoogleBigQuerySQLComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.google.bigquery.GoogleBigQueryConnectionFactory": return applicationContext.getBean(ref, org.apache.camel.component.google.bigquery.GoogleBigQueryConnectionFactory.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.google-bigquery-sql");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/springboot/GoogleCalendarComponentAutoConfiguration.java b/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/springboot/GoogleCalendarComponentAutoConfiguration.java
index 394e5045b9b..93d7c6ceaab 100644
--- a/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/springboot/GoogleCalendarComponentAutoConfiguration.java
+++ b/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/springboot/GoogleCalendarComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GoogleCalendarComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-calendar", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/springboot/GoogleCalendarComponentConverter.java b/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/springboot/GoogleCalendarComponentConverter.java
index 5b44d7e7813..90a8a16f850 100644
--- a/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/springboot/GoogleCalendarComponentConverter.java
+++ b/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/springboot/GoogleCalendarComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.google.calendar.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class GoogleCalendarComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.google.calendar.GoogleCalendarConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.google.calendar.GoogleCalendarConfiguration.class);
- case "org.apache.camel.component.google.calendar.GoogleCalendarClientFactory": return applicationContext.getBean(ref, org.apache.camel.component.google.calendar.GoogleCalendarClientFactory.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.google-calendar");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/stream/springboot/GoogleCalendarStreamComponentAutoConfiguration.java b/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/stream/springboot/GoogleCalendarStreamComponentAutoConfiguration.java
index 85a8c6af581..881d34152ff 100644
--- a/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/stream/springboot/GoogleCalendarStreamComponentAutoConfiguration.java
+++ b/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/stream/springboot/GoogleCalendarStreamComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GoogleCalendarStreamComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-calendar-stream", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/stream/springboot/GoogleCalendarStreamComponentConverter.java b/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/stream/springboot/GoogleCalendarStreamComponentConverter.java
index e2e4cfc94e8..d531bab8f7d 100644
--- a/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/stream/springboot/GoogleCalendarStreamComponentConverter.java
+++ b/components-starter/camel-google-calendar-starter/src/main/java/org/apache/camel/component/google/calendar/stream/springboot/GoogleCalendarStreamComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.google.calendar.stream.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -50,18 +51,6 @@ public class GoogleCalendarStreamComponentConverter
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.google.calendar.stream.GoogleCalendarStreamConfiguration.class);
- case "org.apache.camel.component.google.calendar.GoogleCalendarClientFactory": return applicationContext.getBean(ref, org.apache.camel.component.google.calendar.GoogleCalendarClientFactory.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.google-calendar-stream");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-google-drive-starter/src/main/java/org/apache/camel/component/google/drive/springboot/GoogleDriveComponentAutoConfiguration.java b/components-starter/camel-google-drive-starter/src/main/java/org/apache/camel/component/google/drive/springboot/GoogleDriveComponentAutoConfiguration.java
index 7ab491bd8d8..0568471da16 100644
--- a/components-starter/camel-google-drive-starter/src/main/java/org/apache/camel/component/google/drive/springboot/GoogleDriveComponentAutoConfiguration.java
+++ b/components-starter/camel-google-drive-starter/src/main/java/org/apache/camel/component/google/drive/springboot/GoogleDriveComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GoogleDriveComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-drive", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-drive-starter/src/main/java/org/apache/camel/component/google/drive/springboot/GoogleDriveComponentConverter.java b/components-starter/camel-google-drive-starter/src/main/java/org/apache/camel/component/google/drive/springboot/GoogleDriveComponentConverter.java
index c4e6598a522..e82d651d32c 100644
--- a/components-starter/camel-google-drive-starter/src/main/java/org/apache/camel/component/google/drive/springboot/GoogleDriveComponentConverter.java
+++ b/components-starter/camel-google-drive-starter/src/main/java/org/apache/camel/component/google/drive/springboot/GoogleDriveComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.google.drive.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class GoogleDriveComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.google.drive.GoogleDriveConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.google.drive.GoogleDriveConfiguration.class);
- case "org.apache.camel.component.google.drive.GoogleDriveClientFactory": return applicationContext.getBean(ref, org.apache.camel.component.google.drive.GoogleDriveClientFactory.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.google-drive");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-google-firestore-starter/src/main/java/org/apache/camel/component/google/firestore/springboot/GoogleFirestoreComponentAutoConfiguration.java b/components-starter/camel-google-firestore-starter/src/main/java/org/apache/camel/component/google/firestore/springboot/GoogleFirestoreComponentAutoConfiguration.java
index e6ed53702df..6457c7893d4 100644
--- a/components-starter/camel-google-firestore-starter/src/main/java/org/apache/camel/component/google/firestore/springboot/GoogleFirestoreComponentAutoConfiguration.java
+++ b/components-starter/camel-google-firestore-starter/src/main/java/org/apache/camel/component/google/firestore/springboot/GoogleFirestoreComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GoogleFirestoreComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-firestore", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-firestore-starter/src/main/java/org/apache/camel/component/google/firestore/springboot/GoogleFirestoreComponentConverter.java b/components-starter/camel-google-firestore-starter/src/main/java/org/apache/camel/component/google/firestore/springboot/GoogleFirestoreComponentConverter.java
index 20152c16286..8d8859e3711 100644
--- a/components-starter/camel-google-firestore-starter/src/main/java/org/apache/camel/component/google/firestore/springboot/GoogleFirestoreComponentConverter.java
+++ b/components-starter/camel-google-firestore-starter/src/main/java/org/apache/camel/component/google/firestore/springboot/GoogleFirestoreComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.google.firestore.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class GoogleFirestoreComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.google.firestore.GoogleFirestoreConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.google.firestore.GoogleFirestoreConfiguration.class);
- case "com.google.cloud.firestore.Firestore": return applicationContext.getBean(ref, com.google.cloud.firestore.Firestore.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.google-firestore");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-google-functions-starter/src/main/java/org/apache/camel/component/google/functions/springboot/GoogleCloudFunctionsComponentAutoConfiguration.java b/components-starter/camel-google-functions-starter/src/main/java/org/apache/camel/component/google/functions/springboot/GoogleCloudFunctionsComponentAutoConfiguration.java
index 93880683bd4..d6db58673d4 100644
--- a/components-starter/camel-google-functions-starter/src/main/java/org/apache/camel/component/google/functions/springboot/GoogleCloudFunctionsComponentAutoConfiguration.java
+++ b/components-starter/camel-google-functions-starter/src/main/java/org/apache/camel/component/google/functions/springboot/GoogleCloudFunctionsComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GoogleCloudFunctionsComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-functions", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-mail-starter/src/main/java/org/apache/camel/component/google/mail/springboot/GoogleMailComponentAutoConfiguration.java b/components-starter/camel-google-mail-starter/src/main/java/org/apache/camel/component/google/mail/springboot/GoogleMailComponentAutoConfiguration.java
index c1aa7269f87..ba726e53e0b 100644
--- a/components-starter/camel-google-mail-starter/src/main/java/org/apache/camel/component/google/mail/springboot/GoogleMailComponentAutoConfiguration.java
+++ b/components-starter/camel-google-mail-starter/src/main/java/org/apache/camel/component/google/mail/springboot/GoogleMailComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GoogleMailComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-mail", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-mail-starter/src/main/java/org/apache/camel/component/google/mail/springboot/GoogleMailComponentConverter.java b/components-starter/camel-google-mail-starter/src/main/java/org/apache/camel/component/google/mail/springboot/GoogleMailComponentConverter.java
index d748b0b2bfe..063961e7663 100644
--- a/components-starter/camel-google-mail-starter/src/main/java/org/apache/camel/component/google/mail/springboot/GoogleMailComponentConverter.java
+++ b/components-starter/camel-google-mail-starter/src/main/java/org/apache/camel/component/google/mail/springboot/GoogleMailComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.google.mail.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class GoogleMailComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.google.mail.GoogleMailConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.google.mail.GoogleMailConfiguration.class);
- case "org.apache.camel.component.google.mail.GoogleMailClientFactory": return applicationContext.getBean(ref, org.apache.camel.component.google.mail.GoogleMailClientFactory.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.google-mail");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-google-mail-starter/src/main/java/org/apache/camel/component/google/mail/stream/springboot/GoogleMailStreamComponentAutoConfiguration.java b/components-starter/camel-google-mail-starter/src/main/java/org/apache/camel/component/google/mail/stream/springboot/GoogleMailStreamComponentAutoConfiguration.java
index 2c03f46832b..291429b31fc 100644
--- a/components-starter/camel-google-mail-starter/src/main/java/org/apache/camel/component/google/mail/stream/springboot/GoogleMailStreamComponentAutoConfiguration.java
+++ b/components-starter/camel-google-mail-starter/src/main/java/org/apache/camel/component/google/mail/stream/springboot/GoogleMailStreamComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GoogleMailStreamComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-mail-stream", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-mail-starter/src/main/java/org/apache/camel/component/google/mail/stream/springboot/GoogleMailStreamComponentConverter.java b/components-starter/camel-google-mail-starter/src/main/java/org/apache/camel/component/google/mail/stream/springboot/GoogleMailStreamComponentConverter.java
index f6da04fb492..6bdd5b78fbd 100644
--- a/components-starter/camel-google-mail-starter/src/main/java/org/apache/camel/component/google/mail/stream/springboot/GoogleMailStreamComponentConverter.java
+++ b/components-starter/camel-google-mail-starter/src/main/java/org/apache/camel/component/google/mail/stream/springboot/GoogleMailStreamComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.google.mail.stream.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class GoogleMailStreamComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.google.mail.GoogleMailClientFactory": return applicationContext.getBean(ref, org.apache.camel.component.google.mail.GoogleMailClientFactory.class);
- case "org.apache.camel.component.google.mail.stream.GoogleMailStreamConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.google.mail.stream.GoogleMailStreamConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.google-mail-stream");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-google-pubsub-starter/src/main/java/org/apache/camel/component/google/pubsub/springboot/GooglePubsubComponentAutoConfiguration.java b/components-starter/camel-google-pubsub-starter/src/main/java/org/apache/camel/component/google/pubsub/springboot/GooglePubsubComponentAutoConfiguration.java
index 39c9a235189..47dee22232b 100644
--- a/components-starter/camel-google-pubsub-starter/src/main/java/org/apache/camel/component/google/pubsub/springboot/GooglePubsubComponentAutoConfiguration.java
+++ b/components-starter/camel-google-pubsub-starter/src/main/java/org/apache/camel/component/google/pubsub/springboot/GooglePubsubComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GooglePubsubComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-pubsub", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-pubsub-starter/src/main/java/org/apache/camel/component/google/pubsub/springboot/GooglePubsubComponentConverter.java b/components-starter/camel-google-pubsub-starter/src/main/java/org/apache/camel/component/google/pubsub/springboot/GooglePubsubComponentConverter.java
index 4d24daac927..8faa1fa55bf 100644
--- a/components-starter/camel-google-pubsub-starter/src/main/java/org/apache/camel/component/google/pubsub/springboot/GooglePubsubComponentConverter.java
+++ b/components-starter/camel-google-pubsub-starter/src/main/java/org/apache/camel/component/google/pubsub/springboot/GooglePubsubComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.google.pubsub.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class GooglePubsubComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.spi.HeaderFilterStrategy": return applicationContext.getBean(ref, org.apache.camel.spi.HeaderFilterStrategy.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.google-pubsub");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-google-secret-manager-starter/src/main/java/org/apache/camel/component/google/secret/manager/springboot/GoogleSecretManagerComponentAutoConfiguration.java b/components-starter/camel-google-secret-manager-starter/src/main/java/org/apache/camel/component/google/secret/manager/springboot/GoogleSecretManagerComponentAutoConfiguration.java
index ea74a102eab..e7b767df582 100644
--- a/components-starter/camel-google-secret-manager-starter/src/main/java/org/apache/camel/component/google/secret/manager/springboot/GoogleSecretManagerComponentAutoConfiguration.java
+++ b/components-starter/camel-google-secret-manager-starter/src/main/java/org/apache/camel/component/google/secret/manager/springboot/GoogleSecretManagerComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GoogleSecretManagerComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-secret-manager", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-sheets-starter/src/main/java/org/apache/camel/component/google/sheets/springboot/GoogleSheetsComponentAutoConfiguration.java b/components-starter/camel-google-sheets-starter/src/main/java/org/apache/camel/component/google/sheets/springboot/GoogleSheetsComponentAutoConfiguration.java
index 32f368f55a8..9eb5687e4a7 100644
--- a/components-starter/camel-google-sheets-starter/src/main/java/org/apache/camel/component/google/sheets/springboot/GoogleSheetsComponentAutoConfiguration.java
+++ b/components-starter/camel-google-sheets-starter/src/main/java/org/apache/camel/component/google/sheets/springboot/GoogleSheetsComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GoogleSheetsComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-sheets", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-sheets-starter/src/main/java/org/apache/camel/component/google/sheets/springboot/GoogleSheetsComponentConverter.java b/components-starter/camel-google-sheets-starter/src/main/java/org/apache/camel/component/google/sheets/springboot/GoogleSheetsComponentConverter.java
index 89379124ed6..32e05e1887b 100644
--- a/components-starter/camel-google-sheets-starter/src/main/java/org/apache/camel/component/google/sheets/springboot/GoogleSheetsComponentConverter.java
+++ b/components-starter/camel-google-sheets-starter/src/main/java/org/apache/camel/component/google/sheets/springboot/GoogleSheetsComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.google.sheets.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class GoogleSheetsComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.google.sheets.GoogleSheetsConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.google.sheets.GoogleSheetsConfiguration.class);
- case "org.apache.camel.component.google.sheets.GoogleSheetsClientFactory": return applicationContext.getBean(ref, org.apache.camel.component.google.sheets.GoogleSheetsClientFactory.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.google-sheets");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-google-sheets-starter/src/main/java/org/apache/camel/component/google/sheets/stream/springboot/GoogleSheetsStreamComponentAutoConfiguration.java b/components-starter/camel-google-sheets-starter/src/main/java/org/apache/camel/component/google/sheets/stream/springboot/GoogleSheetsStreamComponentAutoConfiguration.java
index a7980dafdf2..d40598e2d4b 100644
--- a/components-starter/camel-google-sheets-starter/src/main/java/org/apache/camel/component/google/sheets/stream/springboot/GoogleSheetsStreamComponentAutoConfiguration.java
+++ b/components-starter/camel-google-sheets-starter/src/main/java/org/apache/camel/component/google/sheets/stream/springboot/GoogleSheetsStreamComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GoogleSheetsStreamComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-sheets-stream", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-sheets-starter/src/main/java/org/apache/camel/component/google/sheets/stream/springboot/GoogleSheetsStreamComponentConverter.java b/components-starter/camel-google-sheets-starter/src/main/java/org/apache/camel/component/google/sheets/stream/springboot/GoogleSheetsStreamComponentConverter.java
index f17bf9e2259..44d3e8186cd 100644
--- a/components-starter/camel-google-sheets-starter/src/main/java/org/apache/camel/component/google/sheets/stream/springboot/GoogleSheetsStreamComponentConverter.java
+++ b/components-starter/camel-google-sheets-starter/src/main/java/org/apache/camel/component/google/sheets/stream/springboot/GoogleSheetsStreamComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.google.sheets.stream.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class GoogleSheetsStreamComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.google.sheets.stream.GoogleSheetsStreamConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.google.sheets.stream.GoogleSheetsStreamConfiguration.class);
- case "org.apache.camel.component.google.sheets.GoogleSheetsClientFactory": return applicationContext.getBean(ref, org.apache.camel.component.google.sheets.GoogleSheetsClientFactory.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.google-sheets-stream");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-google-speech-to-text-starter/src/main/java/org/apache/camel/component/google/speechtotext/springboot/GoogleCloudSpeechToTextComponentAutoConfiguration.java b/components-starter/camel-google-speech-to-text-starter/src/main/java/org/apache/camel/component/google/speechtotext/springboot/GoogleCloudSpeechToTextComponentAutoConfiguration.java
index b0e016b2e2f..9631783557f 100644
--- a/components-starter/camel-google-speech-to-text-starter/src/main/java/org/apache/camel/component/google/speechtotext/springboot/GoogleCloudSpeechToTextComponentAutoConfiguration.java
+++ b/components-starter/camel-google-speech-to-text-starter/src/main/java/org/apache/camel/component/google/speechtotext/springboot/GoogleCloudSpeechToTextComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GoogleCloudSpeechToTextComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-speech-to-text", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-storage-starter/src/main/java/org/apache/camel/component/google/storage/springboot/GoogleCloudStorageComponentAutoConfiguration.java b/components-starter/camel-google-storage-starter/src/main/java/org/apache/camel/component/google/storage/springboot/GoogleCloudStorageComponentAutoConfiguration.java
index 554fa4a1519..15887de463b 100644
--- a/components-starter/camel-google-storage-starter/src/main/java/org/apache/camel/component/google/storage/springboot/GoogleCloudStorageComponentAutoConfiguration.java
+++ b/components-starter/camel-google-storage-starter/src/main/java/org/apache/camel/component/google/storage/springboot/GoogleCloudStorageComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GoogleCloudStorageComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-storage", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-storage-starter/src/main/java/org/apache/camel/component/google/storage/springboot/GoogleCloudStorageComponentConverter.java b/components-starter/camel-google-storage-starter/src/main/java/org/apache/camel/component/google/storage/springboot/GoogleCloudStorageComponentConverter.java
index e711e979d28..f6749ae1bae 100644
--- a/components-starter/camel-google-storage-starter/src/main/java/org/apache/camel/component/google/storage/springboot/GoogleCloudStorageComponentConverter.java
+++ b/components-starter/camel-google-storage-starter/src/main/java/org/apache/camel/component/google/storage/springboot/GoogleCloudStorageComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.google.storage.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -49,19 +50,6 @@ public class GoogleCloudStorageComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.google.storage.GoogleCloudStorageConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.google.storage.GoogleCloudStorageConfiguration.class);
- case "com.google.cloud.storage.StorageClass": return applicationContext.getBean(ref, com.google.cloud.storage.StorageClass.class);
- case "com.google.cloud.storage.Storage": return applicationContext.getBean(ref, com.google.cloud.storage.Storage.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.google-storage");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-google-text-to-speech-starter/src/main/java/org/apache/camel/component/google/texttospeech/springboot/GoogleCloudTextToSpeechComponentAutoConfiguration.java b/components-starter/camel-google-text-to-speech-starter/src/main/java/org/apache/camel/component/google/texttospeech/springboot/GoogleCloudTextToSpeechComponentAutoConfiguration.java
index 2c6da6c1a71..3bd5987bdca 100644
--- a/components-starter/camel-google-text-to-speech-starter/src/main/java/org/apache/camel/component/google/texttospeech/springboot/GoogleCloudTextToSpeechComponentAutoConfiguration.java
+++ b/components-starter/camel-google-text-to-speech-starter/src/main/java/org/apache/camel/component/google/texttospeech/springboot/GoogleCloudTextToSpeechComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GoogleCloudTextToSpeechComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-text-to-speech", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-vertexai-starter/src/main/java/org/apache/camel/component/google/vertexai/springboot/GoogleVertexAIComponentAutoConfiguration.java b/components-starter/camel-google-vertexai-starter/src/main/java/org/apache/camel/component/google/vertexai/springboot/GoogleVertexAIComponentAutoConfiguration.java
index 8344682789d..a251c1ec0b7 100644
--- a/components-starter/camel-google-vertexai-starter/src/main/java/org/apache/camel/component/google/vertexai/springboot/GoogleVertexAIComponentAutoConfiguration.java
+++ b/components-starter/camel-google-vertexai-starter/src/main/java/org/apache/camel/component/google/vertexai/springboot/GoogleVertexAIComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GoogleVertexAIComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-vertexai", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-google-vertexai-starter/src/main/java/org/apache/camel/component/google/vertexai/springboot/GoogleVertexAIComponentConverter.java b/components-starter/camel-google-vertexai-starter/src/main/java/org/apache/camel/component/google/vertexai/springboot/GoogleVertexAIComponentConverter.java
index e7169d87e86..fe9eef734a1 100644
--- a/components-starter/camel-google-vertexai-starter/src/main/java/org/apache/camel/component/google/vertexai/springboot/GoogleVertexAIComponentConverter.java
+++ b/components-starter/camel-google-vertexai-starter/src/main/java/org/apache/camel/component/google/vertexai/springboot/GoogleVertexAIComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.google.vertexai.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -49,19 +50,6 @@ public class GoogleVertexAIComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.google.vertexai.GoogleVertexAIConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.google.vertexai.GoogleVertexAIConfiguration.class);
- case "com.google.genai.Client": return applicationContext.getBean(ref, com.google.genai.Client.class);
- case "com.google.cloud.aiplatform.v1.PredictionServiceClient": return applicationContext.getBean(ref, com.google.cloud.aiplatform.v1.PredictionServiceClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.google-vertexai");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-google-vision-starter/src/main/java/org/apache/camel/component/google/vision/springboot/GoogleCloudVisionComponentAutoConfiguration.java b/components-starter/camel-google-vision-starter/src/main/java/org/apache/camel/component/google/vision/springboot/GoogleCloudVisionComponentAutoConfiguration.java
index 436e8d52cd9..69c05afde28 100644
--- a/components-starter/camel-google-vision-starter/src/main/java/org/apache/camel/component/google/vision/springboot/GoogleCloudVisionComponentAutoConfiguration.java
+++ b/components-starter/camel-google-vision-starter/src/main/java/org/apache/camel/component/google/vision/springboot/GoogleCloudVisionComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GoogleCloudVisionComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.google-vision", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-graphql-starter/src/main/java/org/apache/camel/component/graphql/springboot/GraphqlComponentAutoConfiguration.java b/components-starter/camel-graphql-starter/src/main/java/org/apache/camel/component/graphql/springboot/GraphqlComponentAutoConfiguration.java
index dacb508844d..e9406bb0ab5 100644
--- a/components-starter/camel-graphql-starter/src/main/java/org/apache/camel/component/graphql/springboot/GraphqlComponentAutoConfiguration.java
+++ b/components-starter/camel-graphql-starter/src/main/java/org/apache/camel/component/graphql/springboot/GraphqlComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GraphqlComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.graphql", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-graphql-starter/src/main/java/org/apache/camel/component/graphql/springboot/GraphqlComponentConverter.java b/components-starter/camel-graphql-starter/src/main/java/org/apache/camel/component/graphql/springboot/GraphqlComponentConverter.java
index 6f50f6a970b..0c799d3d245 100644
--- a/components-starter/camel-graphql-starter/src/main/java/org/apache/camel/component/graphql/springboot/GraphqlComponentConverter.java
+++ b/components-starter/camel-graphql-starter/src/main/java/org/apache/camel/component/graphql/springboot/GraphqlComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.graphql.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class GraphqlComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.hc.client5.http.classic.HttpClient": return applicationContext.getBean(ref, org.apache.hc.client5.http.classic.HttpClient.class);
- case "org.apache.camel.spi.HeaderFilterStrategy": return applicationContext.getBean(ref, org.apache.camel.spi.HeaderFilterStrategy.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.graphql");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-grok-starter/src/main/java/org/apache/camel/component/grok/springboot/GrokDataFormatAutoConfiguration.java b/components-starter/camel-grok-starter/src/main/java/org/apache/camel/component/grok/springboot/GrokDataFormatAutoConfiguration.java
index 2f0a9a65471..ed5713c4d8a 100644
--- a/components-starter/camel-grok-starter/src/main/java/org/apache/camel/component/grok/springboot/GrokDataFormatAutoConfiguration.java
+++ b/components-starter/camel-grok-starter/src/main/java/org/apache/camel/component/grok/springboot/GrokDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class GrokDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.grok", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-groovy-starter/src/main/java/org/apache/camel/groovy/json/springboot/GroovyJSonlDataFormatAutoConfiguration.java b/components-starter/camel-groovy-starter/src/main/java/org/apache/camel/groovy/json/springboot/GroovyJSonlDataFormatAutoConfiguration.java
index 4679c916be4..faf95ee4a6d 100644
--- a/components-starter/camel-groovy-starter/src/main/java/org/apache/camel/groovy/json/springboot/GroovyJSonlDataFormatAutoConfiguration.java
+++ b/components-starter/camel-groovy-starter/src/main/java/org/apache/camel/groovy/json/springboot/GroovyJSonlDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class GroovyJSonlDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.groovy-json", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-groovy-starter/src/main/java/org/apache/camel/groovy/xml/springboot/GroovyXmlDataFormatAutoConfiguration.java b/components-starter/camel-groovy-starter/src/main/java/org/apache/camel/groovy/xml/springboot/GroovyXmlDataFormatAutoConfiguration.java
index 47ada2f3aa6..b870bfdf69b 100644
--- a/components-starter/camel-groovy-starter/src/main/java/org/apache/camel/groovy/xml/springboot/GroovyXmlDataFormatAutoConfiguration.java
+++ b/components-starter/camel-groovy-starter/src/main/java/org/apache/camel/groovy/xml/springboot/GroovyXmlDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class GroovyXmlDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.groovy-xml", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-groovy-starter/src/main/java/org/apache/camel/language/groovy/springboot/GroovyLanguageAutoConfiguration.java b/components-starter/camel-groovy-starter/src/main/java/org/apache/camel/language/groovy/springboot/GroovyLanguageAutoConfiguration.java
index ba25db3d460..403df5ec50c 100644
--- a/components-starter/camel-groovy-starter/src/main/java/org/apache/camel/language/groovy/springboot/GroovyLanguageAutoConfiguration.java
+++ b/components-starter/camel-groovy-starter/src/main/java/org/apache/camel/language/groovy/springboot/GroovyLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class GroovyLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.groovy", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-grpc-starter/src/main/java/org/apache/camel/component/grpc/springboot/GrpcComponentAutoConfiguration.java b/components-starter/camel-grpc-starter/src/main/java/org/apache/camel/component/grpc/springboot/GrpcComponentAutoConfiguration.java
index 65f3a336625..16461edc7da 100644
--- a/components-starter/camel-grpc-starter/src/main/java/org/apache/camel/component/grpc/springboot/GrpcComponentAutoConfiguration.java
+++ b/components-starter/camel-grpc-starter/src/main/java/org/apache/camel/component/grpc/springboot/GrpcComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class GrpcComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.grpc", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-gson-starter/src/main/java/org/apache/camel/component/gson/springboot/GsonDataFormatAutoConfiguration.java b/components-starter/camel-gson-starter/src/main/java/org/apache/camel/component/gson/springboot/GsonDataFormatAutoConfiguration.java
index 1be4eb44933..a175bbb40d7 100644
--- a/components-starter/camel-gson-starter/src/main/java/org/apache/camel/component/gson/springboot/GsonDataFormatAutoConfiguration.java
+++ b/components-starter/camel-gson-starter/src/main/java/org/apache/camel/component/gson/springboot/GsonDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class GsonDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.gson", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-hashicorp-vault-starter/src/main/java/org/apache/camel/component/hashicorp/vault/springboot/HashicorpVaultComponentAutoConfiguration.java b/components-starter/camel-hashicorp-vault-starter/src/main/java/org/apache/camel/component/hashicorp/vault/springboot/HashicorpVaultComponentAutoConfiguration.java
index eb4956446b5..308d576f48c 100644
--- a/components-starter/camel-hashicorp-vault-starter/src/main/java/org/apache/camel/component/hashicorp/vault/springboot/HashicorpVaultComponentAutoConfiguration.java
+++ b/components-starter/camel-hashicorp-vault-starter/src/main/java/org/apache/camel/component/hashicorp/vault/springboot/HashicorpVaultComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class HashicorpVaultComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hashicorp-vault", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/atomicnumber/springboot/HazelcastAtomicnumberComponentAutoConfiguration.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/atomicnumber/springboot/HazelcastAtomicnumberComponentAutoConfiguration.java
index 0bfca7f8d9b..8c07f018700 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/atomicnumber/springboot/HazelcastAtomicnumberComponentAutoConfiguration.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/atomicnumber/springboot/HazelcastAtomicnumberComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class HazelcastAtomicnumberComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hazelcast-atomicvalue", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/atomicnumber/springboot/HazelcastAtomicnumberComponentConverter.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/atomicnumber/springboot/HazelcastAtomicnumberComponentConverter.java
index 75e8e1e991c..a9eb8c50f6f 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/atomicnumber/springboot/HazelcastAtomicnumberComponentConverter.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/atomicnumber/springboot/HazelcastAtomicnumberComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.hazelcast.atomicnumber.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -49,17 +50,6 @@ public class HazelcastAtomicnumberComponentConverter
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.hazelcast.core.HazelcastInstance": return applicationContext.getBean(ref, com.hazelcast.core.HazelcastInstance.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.hazelcast-atomicvalue");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/instance/springboot/HazelcastInstanceComponentAutoConfiguration.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/instance/springboot/HazelcastInstanceComponentAutoConfiguration.java
index b1c7058f81e..1ba74fb78ed 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/instance/springboot/HazelcastInstanceComponentAutoConfiguration.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/instance/springboot/HazelcastInstanceComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class HazelcastInstanceComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hazelcast-instance", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/instance/springboot/HazelcastInstanceComponentConverter.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/instance/springboot/HazelcastInstanceComponentConverter.java
index 048874ba4f2..1b3b09e4eef 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/instance/springboot/HazelcastInstanceComponentConverter.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/instance/springboot/HazelcastInstanceComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.hazelcast.instance.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class HazelcastInstanceComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.hazelcast.core.HazelcastInstance": return applicationContext.getBean(ref, com.hazelcast.core.HazelcastInstance.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.hazelcast-instance");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/list/springboot/HazelcastListComponentAutoConfiguration.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/list/springboot/HazelcastListComponentAutoConfiguration.java
index 06dc6ca97ad..167bf5e9142 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/list/springboot/HazelcastListComponentAutoConfiguration.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/list/springboot/HazelcastListComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class HazelcastListComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hazelcast-list", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/list/springboot/HazelcastListComponentConverter.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/list/springboot/HazelcastListComponentConverter.java
index 4f921318db8..c8bb7abe243 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/list/springboot/HazelcastListComponentConverter.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/list/springboot/HazelcastListComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.hazelcast.list.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class HazelcastListComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.hazelcast.core.HazelcastInstance": return applicationContext.getBean(ref, com.hazelcast.core.HazelcastInstance.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.hazelcast-list");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/map/springboot/HazelcastMapComponentAutoConfiguration.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/map/springboot/HazelcastMapComponentAutoConfiguration.java
index 76ad53213a0..b04b47ca180 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/map/springboot/HazelcastMapComponentAutoConfiguration.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/map/springboot/HazelcastMapComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class HazelcastMapComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hazelcast-map", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/map/springboot/HazelcastMapComponentConverter.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/map/springboot/HazelcastMapComponentConverter.java
index 3f376e4421a..6fa37646f44 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/map/springboot/HazelcastMapComponentConverter.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/map/springboot/HazelcastMapComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.hazelcast.map.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class HazelcastMapComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.hazelcast.core.HazelcastInstance": return applicationContext.getBean(ref, com.hazelcast.core.HazelcastInstance.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.hazelcast-map");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/multimap/springboot/HazelcastMultimapComponentAutoConfiguration.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/multimap/springboot/HazelcastMultimapComponentAutoConfiguration.java
index 2c6349712a8..c6a05c23814 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/multimap/springboot/HazelcastMultimapComponentAutoConfiguration.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/multimap/springboot/HazelcastMultimapComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class HazelcastMultimapComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hazelcast-multimap", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/multimap/springboot/HazelcastMultimapComponentConverter.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/multimap/springboot/HazelcastMultimapComponentConverter.java
index 0bc5f9dcdd8..2b8eacc5754 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/multimap/springboot/HazelcastMultimapComponentConverter.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/multimap/springboot/HazelcastMultimapComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.hazelcast.multimap.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class HazelcastMultimapComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.hazelcast.core.HazelcastInstance": return applicationContext.getBean(ref, com.hazelcast.core.HazelcastInstance.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.hazelcast-multimap");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/pncounter/springboot/HazelcastPNCounterComponentAutoConfiguration.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/pncounter/springboot/HazelcastPNCounterComponentAutoConfiguration.java
index b48c801f74a..3ed94a76738 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/pncounter/springboot/HazelcastPNCounterComponentAutoConfiguration.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/pncounter/springboot/HazelcastPNCounterComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class HazelcastPNCounterComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hazelcast-pncounter", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/pncounter/springboot/HazelcastPNCounterComponentConverter.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/pncounter/springboot/HazelcastPNCounterComponentConverter.java
index cee84accf1f..616391fc30e 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/pncounter/springboot/HazelcastPNCounterComponentConverter.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/pncounter/springboot/HazelcastPNCounterComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.hazelcast.pncounter.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class HazelcastPNCounterComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.hazelcast.core.HazelcastInstance": return applicationContext.getBean(ref, com.hazelcast.core.HazelcastInstance.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.hazelcast-pncounter");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/queue/springboot/HazelcastQueueComponentAutoConfiguration.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/queue/springboot/HazelcastQueueComponentAutoConfiguration.java
index 04df91ca31e..d51eaac6cc7 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/queue/springboot/HazelcastQueueComponentAutoConfiguration.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/queue/springboot/HazelcastQueueComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class HazelcastQueueComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hazelcast-queue", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/queue/springboot/HazelcastQueueComponentConverter.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/queue/springboot/HazelcastQueueComponentConverter.java
index d00c7d987f6..b330f31cdac 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/queue/springboot/HazelcastQueueComponentConverter.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/queue/springboot/HazelcastQueueComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.hazelcast.queue.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class HazelcastQueueComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.hazelcast.core.HazelcastInstance": return applicationContext.getBean(ref, com.hazelcast.core.HazelcastInstance.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.hazelcast-queue");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/replicatedmap/springboot/HazelcastReplicatedmapComponentAutoConfiguration.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/replicatedmap/springboot/HazelcastReplicatedmapComponentAutoConfiguration.java
index b585ad8d161..0b35ec4421d 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/replicatedmap/springboot/HazelcastReplicatedmapComponentAutoConfiguration.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/replicatedmap/springboot/HazelcastReplicatedmapComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class HazelcastReplicatedmapComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hazelcast-replicatedmap", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/replicatedmap/springboot/HazelcastReplicatedmapComponentConverter.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/replicatedmap/springboot/HazelcastReplicatedmapComponentConverter.java
index b373b6596c6..37772181fb4 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/replicatedmap/springboot/HazelcastReplicatedmapComponentConverter.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/replicatedmap/springboot/HazelcastReplicatedmapComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.hazelcast.replicatedmap.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -49,17 +50,6 @@ public class HazelcastReplicatedmapComponentConverter
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.hazelcast.core.HazelcastInstance": return applicationContext.getBean(ref, com.hazelcast.core.HazelcastInstance.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.hazelcast-replicatedmap");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/ringbuffer/springboot/HazelcastRingbufferComponentAutoConfiguration.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/ringbuffer/springboot/HazelcastRingbufferComponentAutoConfiguration.java
index 4ebab346f24..6614f7a9485 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/ringbuffer/springboot/HazelcastRingbufferComponentAutoConfiguration.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/ringbuffer/springboot/HazelcastRingbufferComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class HazelcastRingbufferComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hazelcast-ringbuffer", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/ringbuffer/springboot/HazelcastRingbufferComponentConverter.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/ringbuffer/springboot/HazelcastRingbufferComponentConverter.java
index 91a308ae17d..e7327a25e7c 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/ringbuffer/springboot/HazelcastRingbufferComponentConverter.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/ringbuffer/springboot/HazelcastRingbufferComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.hazelcast.ringbuffer.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -49,17 +50,6 @@ public class HazelcastRingbufferComponentConverter
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.hazelcast.core.HazelcastInstance": return applicationContext.getBean(ref, com.hazelcast.core.HazelcastInstance.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.hazelcast-ringbuffer");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/seda/springboot/HazelcastSedaComponentAutoConfiguration.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/seda/springboot/HazelcastSedaComponentAutoConfiguration.java
index 5e27b8558da..004750745f0 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/seda/springboot/HazelcastSedaComponentAutoConfiguration.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/seda/springboot/HazelcastSedaComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class HazelcastSedaComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hazelcast-seda", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/seda/springboot/HazelcastSedaComponentConverter.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/seda/springboot/HazelcastSedaComponentConverter.java
index 2c212026eff..ce0c3325d0c 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/seda/springboot/HazelcastSedaComponentConverter.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/seda/springboot/HazelcastSedaComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.hazelcast.seda.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class HazelcastSedaComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.hazelcast.core.HazelcastInstance": return applicationContext.getBean(ref, com.hazelcast.core.HazelcastInstance.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.hazelcast-seda");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/set/springboot/HazelcastSetComponentAutoConfiguration.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/set/springboot/HazelcastSetComponentAutoConfiguration.java
index facb3f184e5..772187af7b5 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/set/springboot/HazelcastSetComponentAutoConfiguration.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/set/springboot/HazelcastSetComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class HazelcastSetComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hazelcast-set", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/set/springboot/HazelcastSetComponentConverter.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/set/springboot/HazelcastSetComponentConverter.java
index 71e42af5500..3e67794822b 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/set/springboot/HazelcastSetComponentConverter.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/set/springboot/HazelcastSetComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.hazelcast.set.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class HazelcastSetComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.hazelcast.core.HazelcastInstance": return applicationContext.getBean(ref, com.hazelcast.core.HazelcastInstance.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.hazelcast-set");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/topic/springboot/HazelcastTopicComponentAutoConfiguration.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/topic/springboot/HazelcastTopicComponentAutoConfiguration.java
index 552ef6bed09..9ea057079d9 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/topic/springboot/HazelcastTopicComponentAutoConfiguration.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/topic/springboot/HazelcastTopicComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class HazelcastTopicComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hazelcast-topic", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/topic/springboot/HazelcastTopicComponentConverter.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/topic/springboot/HazelcastTopicComponentConverter.java
index 7e4c16febee..308dd50fe38 100644
--- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/topic/springboot/HazelcastTopicComponentConverter.java
+++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/topic/springboot/HazelcastTopicComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.hazelcast.topic.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class HazelcastTopicComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.hazelcast.core.HazelcastInstance": return applicationContext.getBean(ref, com.hazelcast.core.HazelcastInstance.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.hazelcast-topic");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatAutoConfiguration.java b/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatAutoConfiguration.java
index 74832849daf..d59cf09f544 100644
--- a/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatAutoConfiguration.java
+++ b/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class HL7DataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.hl7", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatConverter.java b/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatConverter.java
index 50e2ad4aae6..58134c98c94 100644
--- a/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatConverter.java
+++ b/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/HL7DataFormatConverter.java
@@ -18,7 +18,7 @@ package org.apache.camel.component.hl7.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
-import org.apache.camel.CamelContext;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,17 +48,6 @@ public class HL7DataFormatConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "ca.uhn.hl7v2.parser.Parser": return applicationContext.getBean(ref, ca.uhn.hl7v2.parser.Parser.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.dataformat.hl7");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/Hl7TerserLanguageAutoConfiguration.java b/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/Hl7TerserLanguageAutoConfiguration.java
index 2e859f6002c..4f0583b937c 100644
--- a/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/Hl7TerserLanguageAutoConfiguration.java
+++ b/components-starter/camel-hl7-starter/src/main/java/org/apache/camel/component/hl7/springboot/Hl7TerserLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class Hl7TerserLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.hl7terser", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-http-starter/src/main/java/org/apache/camel/component/http/springboot/HttpComponentAutoConfiguration.java b/components-starter/camel-http-starter/src/main/java/org/apache/camel/component/http/springboot/HttpComponentAutoConfiguration.java
index 03bd2f5132a..5864be261ea 100644
--- a/components-starter/camel-http-starter/src/main/java/org/apache/camel/component/http/springboot/HttpComponentAutoConfiguration.java
+++ b/components-starter/camel-http-starter/src/main/java/org/apache/camel/component/http/springboot/HttpComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class HttpComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.http", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-http-starter/src/main/java/org/apache/camel/component/http/springboot/HttpComponentConverter.java b/components-starter/camel-http-starter/src/main/java/org/apache/camel/component/http/springboot/HttpComponentConverter.java
index e32c093ce0e..2e0fc9b2667 100644
--- a/components-starter/camel-http-starter/src/main/java/org/apache/camel/component/http/springboot/HttpComponentConverter.java
+++ b/components-starter/camel-http-starter/src/main/java/org/apache/camel/component/http/springboot/HttpComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.http.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -56,26 +57,6 @@ public class HttpComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.hc.client5.http.cookie.CookieStore": return applicationContext.getBean(ref, org.apache.hc.client5.http.cookie.CookieStore.class);
- case "org.apache.camel.component.http.HttpActivityListener": return applicationContext.getBean(ref, org.apache.camel.component.http.HttpActivityListener.class);
- case "org.apache.hc.client5.http.io.HttpClientConnectionManager": return applicationContext.getBean(ref, org.apache.hc.client5.http.io.HttpClientConnectionManager.class);
- case "org.apache.camel.http.common.HttpBinding": return applicationContext.getBean(ref, org.apache.camel.http.common.HttpBinding.class);
- case "org.apache.camel.component.http.HttpClientConfigurer": return applicationContext.getBean(ref, org.apache.camel.component.http.HttpClientConfigurer.class);
- case "org.apache.camel.http.common.HttpConfiguration": return applicationContext.getBean(ref, org.apache.camel.http.common.HttpConfiguration.class);
- case "org.apache.hc.core5.http.protocol.HttpContext": return applicationContext.getBean(ref, org.apache.hc.core5.http.protocol.HttpContext.class);
- case "org.apache.camel.spi.HeaderFilterStrategy": return applicationContext.getBean(ref, org.apache.camel.spi.HeaderFilterStrategy.class);
- case "org.apache.camel.support.jsse.SSLContextParameters": return applicationContext.getBean(ref, org.apache.camel.support.jsse.SSLContextParameters.class);
- case "javax.net.ssl.HostnameVerifier": return applicationContext.getBean(ref, javax.net.ssl.HostnameVerifier.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.http");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-http-starter/src/test/java/com/example/httpstarter/ThirdPartyHttpProperties.java b/components-starter/camel-http-starter/src/test/java/com/example/httpstarter/ThirdPartyHttpProperties.java
new file mode 100644
index 00000000000..2c62a4fcd57
--- /dev/null
+++ b/components-starter/camel-http-starter/src/test/java/com/example/httpstarter/ThirdPartyHttpProperties.java
@@ -0,0 +1,39 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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 com.example.httpstarter;
+
+import javax.net.ssl.HostnameVerifier;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+/**
+ * Stands in for an application class that happens to have a field of a type HttpComponentConverter registers itself
+ * for. Deliberately outside the org.apache.camel packages.
+ */
+@ConfigurationProperties(prefix = "thirdparty.http")
+public class ThirdPartyHttpProperties {
+
+ private HostnameVerifier verifier;
+
+ public HostnameVerifier getVerifier() {
+ return verifier;
+ }
+
+ public void setVerifier(HostnameVerifier verifier) {
+ this.verifier = verifier;
+ }
+}
diff --git a/components-starter/camel-http-starter/src/test/java/org/apache/camel/component/http/springboot/HttpComponentBeanReferenceBindingTest.java b/components-starter/camel-http-starter/src/test/java/org/apache/camel/component/http/springboot/HttpComponentBeanReferenceBindingTest.java
new file mode 100644
index 00000000000..e351743589b
--- /dev/null
+++ b/components-starter/camel-http-starter/src/test/java/org/apache/camel/component/http/springboot/HttpComponentBeanReferenceBindingTest.java
@@ -0,0 +1,126 @@
+/*
+ * 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.component.http.springboot;
+
+import com.example.httpstarter.ThirdPartyHttpProperties;
+import org.apache.camel.support.jsse.SSLContextParameters;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.autoconfigure.AutoConfigurations;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.boot.test.context.runner.ApplicationContextRunner;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+/**
+ * A complex (object) typed option such as {@code sslContextParameters} is configured with a reference to a bean in the
+ * Spring application context. A value that cannot be resolved must be reported, not silently turned into null.
+ */
+class HttpComponentBeanReferenceBindingTest {
+
+ private final ApplicationContextRunner runner = new ApplicationContextRunner()
+ .withConfiguration(AutoConfigurations.of(TestConfiguration.class))
+ .withUserConfiguration(HttpComponentConverter.class);
+
+ @Test
+ void testBeanSyntaxIsResolved() {
+ runner.withPropertyValues("camel.component.http.ssl-context-parameters=#bean:mySslContextParameters")
+ .run(context -> {
+ assertThat(context).hasNotFailed();
+ assertThat(context.getBean(HttpComponentConfiguration.class).getSslContextParameters())
+ .isSameAs(context.getBean("mySslContextParameters"));
+ });
+ }
+
+ @Test
+ void testHashSyntaxIsResolved() {
+ runner.withPropertyValues("camel.component.http.ssl-context-parameters=#mySslContextParameters")
+ .run(context -> {
+ assertThat(context).hasNotFailed();
+ assertThat(context.getBean(HttpComponentConfiguration.class).getSslContextParameters())
+ .isSameAs(context.getBean("mySslContextParameters"));
+ });
+ }
+
+ @Test
+ void testPlainBeanIdIsResolved() {
+ // a plain bean id used to be silently converted to null
+ runner.withPropertyValues("camel.component.http.ssl-context-parameters=mySslContextParameters")
+ .run(context -> {
+ assertThat(context).hasNotFailed();
+ assertThat(context.getBean(HttpComponentConfiguration.class).getSslContextParameters())
+ .isSameAs(context.getBean("mySslContextParameters"));
+ });
+ }
+
+ @Test
+ void testUnresolvableValueIsReported() {
+ // a typo used to leave the option unset without any error
+ runner.withPropertyValues("camel.component.http.ssl-context-parameters=#bean:mySslContextParametrs")
+ .run(context -> {
+ assertThat(context).hasFailed();
+ assertThat(context.getStartupFailure())
+ .hasStackTraceContaining("mySslContextParametrs")
+ .hasStackTraceContaining("camel.component.http");
+ });
+ }
+
+ @Test
+ void testThirdPartyPropertiesAreNotIntercepted() {
+ // HttpComponentConverter is registered with @ConfigurationPropertiesBinding and so takes part in every
+ // @ConfigurationProperties binding, not only in Camel's own. Adding the starter to the classpath must not
+ // make an unrelated property of the same type fail to bind.
+ new ApplicationContextRunner()
+ .withConfiguration(AutoConfigurations.of(ThirdPartyConfiguration.class))
+ .withUserConfiguration(HttpComponentConverter.class)
+ .withPropertyValues("thirdparty.http.verifier=someValue")
+ .run(context -> {
+ assertThat(context).hasNotFailed();
+ assertNull(context.getBean(ThirdPartyHttpProperties.class).getVerifier());
+ });
+ }
+
+ @Test
+ void testThirdPartyPropertiesStillResolveHashReferences() {
+ new ApplicationContextRunner()
+ .withConfiguration(AutoConfigurations.of(ThirdPartyConfiguration.class))
+ .withUserConfiguration(HttpComponentConverter.class)
+ .withPropertyValues("thirdparty.http.verifier=#bean:noSuchVerifier")
+ .run(context -> {
+ assertThat(context).hasFailed();
+ assertThat(context.getStartupFailure()).hasStackTraceContaining("noSuchVerifier");
+ });
+ }
+
+ @Configuration(proxyBeanMethods = false)
+ @EnableConfigurationProperties(ThirdPartyHttpProperties.class)
+ static class ThirdPartyConfiguration {
+ }
+
+ @Configuration(proxyBeanMethods = false)
+ @EnableConfigurationProperties(HttpComponentConfiguration.class)
+ static class TestConfiguration {
+
+ @Bean(name = "mySslContextParameters")
+ SSLContextParameters mySslContextParameters() {
+ return new SSLContextParameters();
+ }
+ }
+
+}
diff --git a/components-starter/camel-huaweicloud-dms-starter/src/main/java/org/apache/camel/component/huaweicloud/dms/springboot/DMSComponentAutoConfiguration.java b/components-starter/camel-huaweicloud-dms-starter/src/main/java/org/apache/camel/component/huaweicloud/dms/springboot/DMSComponentAutoConfiguration.java
index 5189729966c..42676d39929 100644
--- a/components-starter/camel-huaweicloud-dms-starter/src/main/java/org/apache/camel/component/huaweicloud/dms/springboot/DMSComponentAutoConfiguration.java
+++ b/components-starter/camel-huaweicloud-dms-starter/src/main/java/org/apache/camel/component/huaweicloud/dms/springboot/DMSComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class DMSComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hwcloud-dms", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-huaweicloud-frs-starter/src/main/java/org/apache/camel/component/huaweicloud/frs/springboot/FaceRecognitionComponentAutoConfiguration.java b/components-starter/camel-huaweicloud-frs-starter/src/main/java/org/apache/camel/component/huaweicloud/frs/springboot/FaceRecognitionComponentAutoConfiguration.java
index ae53c813d9c..468cab4a72f 100644
--- a/components-starter/camel-huaweicloud-frs-starter/src/main/java/org/apache/camel/component/huaweicloud/frs/springboot/FaceRecognitionComponentAutoConfiguration.java
+++ b/components-starter/camel-huaweicloud-frs-starter/src/main/java/org/apache/camel/component/huaweicloud/frs/springboot/FaceRecognitionComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class FaceRecognitionComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hwcloud-frs", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-huaweicloud-functiongraph-starter/src/main/java/org/apache/camel/springboot/FunctionGraphComponentAutoConfiguration.java b/components-starter/camel-huaweicloud-functiongraph-starter/src/main/java/org/apache/camel/springboot/FunctionGraphComponentAutoConfiguration.java
index 67d700e15ec..9b5266309e0 100644
--- a/components-starter/camel-huaweicloud-functiongraph-starter/src/main/java/org/apache/camel/springboot/FunctionGraphComponentAutoConfiguration.java
+++ b/components-starter/camel-huaweicloud-functiongraph-starter/src/main/java/org/apache/camel/springboot/FunctionGraphComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class FunctionGraphComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hwcloud-functiongraph", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-huaweicloud-iam-starter/src/main/java/org/apache/camel/component/huaweicloud/iam/springboot/IAMComponentAutoConfiguration.java b/components-starter/camel-huaweicloud-iam-starter/src/main/java/org/apache/camel/component/huaweicloud/iam/springboot/IAMComponentAutoConfiguration.java
index 8b54bc66b35..ee08de90d55 100644
--- a/components-starter/camel-huaweicloud-iam-starter/src/main/java/org/apache/camel/component/huaweicloud/iam/springboot/IAMComponentAutoConfiguration.java
+++ b/components-starter/camel-huaweicloud-iam-starter/src/main/java/org/apache/camel/component/huaweicloud/iam/springboot/IAMComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class IAMComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hwcloud-iam", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-huaweicloud-imagerecognition-starter/src/main/java/org/apache/camel/component/huaweicloud/image/springboot/ImageRecognitionComponentAutoConfiguration.java b/components-starter/camel-huaweicloud-imagerecognition-starter/src/main/java/org/apache/camel/component/huaweicloud/image/springboot/ImageRecognitionComponentAutoConfiguration.java
index c71b009712a..964ea56be0f 100644
--- a/components-starter/camel-huaweicloud-imagerecognition-starter/src/main/java/org/apache/camel/component/huaweicloud/image/springboot/ImageRecognitionComponentAutoConfiguration.java
+++ b/components-starter/camel-huaweicloud-imagerecognition-starter/src/main/java/org/apache/camel/component/huaweicloud/image/springboot/ImageRecognitionComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ImageRecognitionComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hwcloud-imagerecognition", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-huaweicloud-obs-starter/src/main/java/org/apache/camel/component/huaweicloud/obs/springboot/OBSComponentAutoConfiguration.java b/components-starter/camel-huaweicloud-obs-starter/src/main/java/org/apache/camel/component/huaweicloud/obs/springboot/OBSComponentAutoConfiguration.java
index 29b481ab06b..a8b50403555 100644
--- a/components-starter/camel-huaweicloud-obs-starter/src/main/java/org/apache/camel/component/huaweicloud/obs/springboot/OBSComponentAutoConfiguration.java
+++ b/components-starter/camel-huaweicloud-obs-starter/src/main/java/org/apache/camel/component/huaweicloud/obs/springboot/OBSComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class OBSComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hwcloud-obs", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-huaweicloud-smn-starter/src/main/java/org/apache/camel/component/huaweicloud/smn/springboot/SimpleNotificationComponentAutoConfiguration.java b/components-starter/camel-huaweicloud-smn-starter/src/main/java/org/apache/camel/component/huaweicloud/smn/springboot/SimpleNotificationComponentAutoConfiguration.java
index 66b04a66049..30ea1021727 100644
--- a/components-starter/camel-huaweicloud-smn-starter/src/main/java/org/apache/camel/component/huaweicloud/smn/springboot/SimpleNotificationComponentAutoConfiguration.java
+++ b/components-starter/camel-huaweicloud-smn-starter/src/main/java/org/apache/camel/component/huaweicloud/smn/springboot/SimpleNotificationComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class SimpleNotificationComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.hwcloud-smn", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-huggingface-starter/src/main/java/org/apache/camel/component/huggingface/springboot/HuggingFaceComponentAutoConfiguration.java b/components-starter/camel-huggingface-starter/src/main/java/org/apache/camel/component/huggingface/springboot/HuggingFaceComponentAutoConfiguration.java
index 29c4e700ed8..7a9f6eb3831 100644
--- a/components-starter/camel-huggingface-starter/src/main/java/org/apache/camel/component/huggingface/springboot/HuggingFaceComponentAutoConfiguration.java
+++ b/components-starter/camel-huggingface-starter/src/main/java/org/apache/camel/component/huggingface/springboot/HuggingFaceComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class HuggingFaceComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.huggingface", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-huggingface-starter/src/main/java/org/apache/camel/component/huggingface/springboot/HuggingFaceComponentConverter.java b/components-starter/camel-huggingface-starter/src/main/java/org/apache/camel/component/huggingface/springboot/HuggingFaceComponentConverter.java
index 22c16667620..5456b4297ad 100644
--- a/components-starter/camel-huggingface-starter/src/main/java/org/apache/camel/component/huggingface/springboot/HuggingFaceComponentConverter.java
+++ b/components-starter/camel-huggingface-starter/src/main/java/org/apache/camel/component/huggingface/springboot/HuggingFaceComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.huggingface.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class HuggingFaceComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.huggingface.HuggingFaceConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.huggingface.HuggingFaceConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.huggingface");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-ibm-cos-starter/src/main/java/org/apache/camel/component/ibm/cos/springboot/IBMCOSComponentAutoConfiguration.java b/components-starter/camel-ibm-cos-starter/src/main/java/org/apache/camel/component/ibm/cos/springboot/IBMCOSComponentAutoConfiguration.java
index 5ac0103ddca..e66d9d040f7 100644
--- a/components-starter/camel-ibm-cos-starter/src/main/java/org/apache/camel/component/ibm/cos/springboot/IBMCOSComponentAutoConfiguration.java
+++ b/components-starter/camel-ibm-cos-starter/src/main/java/org/apache/camel/component/ibm/cos/springboot/IBMCOSComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class IBMCOSComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ibm-cos", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ibm-cos-starter/src/main/java/org/apache/camel/component/ibm/cos/springboot/IBMCOSComponentConverter.java b/components-starter/camel-ibm-cos-starter/src/main/java/org/apache/camel/component/ibm/cos/springboot/IBMCOSComponentConverter.java
index 77f5c0a5782..5424d30d7c8 100644
--- a/components-starter/camel-ibm-cos-starter/src/main/java/org/apache/camel/component/ibm/cos/springboot/IBMCOSComponentConverter.java
+++ b/components-starter/camel-ibm-cos-starter/src/main/java/org/apache/camel/component/ibm/cos/springboot/IBMCOSComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.ibm.cos.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class IBMCOSComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.ibm.cos.IBMCOSConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.ibm.cos.IBMCOSConfiguration.class);
- case "com.ibm.cloud.objectstorage.services.s3.AmazonS3": return applicationContext.getBean(ref, com.ibm.cloud.objectstorage.services.s3.AmazonS3.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.ibm-cos");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-ibm-secrets-manager-starter/src/main/java/org/apache/camel/component/ibm/secrets/manager/springboot/IBMSecretsManagerComponentAutoConfiguration.java b/components-starter/camel-ibm-secrets-manager-starter/src/main/java/org/apache/camel/component/ibm/secrets/manager/springboot/IBMSecretsManagerComponentAutoConfiguration.java
index 7dde420dd1b..25e21a7c7d5 100644
--- a/components-starter/camel-ibm-secrets-manager-starter/src/main/java/org/apache/camel/component/ibm/secrets/manager/springboot/IBMSecretsManagerComponentAutoConfiguration.java
+++ b/components-starter/camel-ibm-secrets-manager-starter/src/main/java/org/apache/camel/component/ibm/secrets/manager/springboot/IBMSecretsManagerComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class IBMSecretsManagerComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ibm-secrets-manager", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ibm-watson-discovery-starter/src/main/java/org/apache/camel/component/ibm/watson/discovery/springboot/WatsonDiscoveryComponentAutoConfiguration.java b/components-starter/camel-ibm-watson-discovery-starter/src/main/java/org/apache/camel/component/ibm/watson/discovery/springboot/WatsonDiscoveryComponentAutoConfiguration.java
index cbb5cb9b2d0..4fcddb46b31 100644
--- a/components-starter/camel-ibm-watson-discovery-starter/src/main/java/org/apache/camel/component/ibm/watson/discovery/springboot/WatsonDiscoveryComponentAutoConfiguration.java
+++ b/components-starter/camel-ibm-watson-discovery-starter/src/main/java/org/apache/camel/component/ibm/watson/discovery/springboot/WatsonDiscoveryComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class WatsonDiscoveryComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ibm-watson-discovery", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ibm-watson-discovery-starter/src/main/java/org/apache/camel/component/ibm/watson/discovery/springboot/WatsonDiscoveryComponentConverter.java b/components-starter/camel-ibm-watson-discovery-starter/src/main/java/org/apache/camel/component/ibm/watson/discovery/springboot/WatsonDiscoveryComponentConverter.java
index be8f10588d4..548e1c50df3 100644
--- a/components-starter/camel-ibm-watson-discovery-starter/src/main/java/org/apache/camel/component/ibm/watson/discovery/springboot/WatsonDiscoveryComponentConverter.java
+++ b/components-starter/camel-ibm-watson-discovery-starter/src/main/java/org/apache/camel/component/ibm/watson/discovery/springboot/WatsonDiscoveryComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.ibm.watson.discovery.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class WatsonDiscoveryComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.ibm.watson.discovery.WatsonDiscoveryConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.ibm.watson.discovery.WatsonDiscoveryConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.ibm-watson-discovery");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-ibm-watson-language-starter/src/main/java/org/apache/camel/component/ibm/watson/language/springboot/WatsonLanguageComponentAutoConfiguration.java b/components-starter/camel-ibm-watson-language-starter/src/main/java/org/apache/camel/component/ibm/watson/language/springboot/WatsonLanguageComponentAutoConfiguration.java
index 124f92ac681..9e405bb03a7 100644
--- a/components-starter/camel-ibm-watson-language-starter/src/main/java/org/apache/camel/component/ibm/watson/language/springboot/WatsonLanguageComponentAutoConfiguration.java
+++ b/components-starter/camel-ibm-watson-language-starter/src/main/java/org/apache/camel/component/ibm/watson/language/springboot/WatsonLanguageComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class WatsonLanguageComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ibm-watson-language", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ibm-watson-language-starter/src/main/java/org/apache/camel/component/ibm/watson/language/springboot/WatsonLanguageComponentConverter.java b/components-starter/camel-ibm-watson-language-starter/src/main/java/org/apache/camel/component/ibm/watson/language/springboot/WatsonLanguageComponentConverter.java
index 5f97f154758..290b00d67f6 100644
--- a/components-starter/camel-ibm-watson-language-starter/src/main/java/org/apache/camel/component/ibm/watson/language/springboot/WatsonLanguageComponentConverter.java
+++ b/components-starter/camel-ibm-watson-language-starter/src/main/java/org/apache/camel/component/ibm/watson/language/springboot/WatsonLanguageComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.ibm.watson.language.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class WatsonLanguageComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.ibm.watson.language.WatsonLanguageConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.ibm.watson.language.WatsonLanguageConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.ibm-watson-language");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-ibm-watson-speech-to-text-starter/src/main/java/org/apache/camel/component/ibm/watson/stt/springboot/WatsonSpeechToTextComponentAutoConfiguration.java b/components-starter/camel-ibm-watson-speech-to-text-starter/src/main/java/org/apache/camel/component/ibm/watson/stt/springboot/WatsonSpeechToTextComponentAutoConfiguration.java
index 1f2fe473b5b..eb15aa7ebab 100644
--- a/components-starter/camel-ibm-watson-speech-to-text-starter/src/main/java/org/apache/camel/component/ibm/watson/stt/springboot/WatsonSpeechToTextComponentAutoConfiguration.java
+++ b/components-starter/camel-ibm-watson-speech-to-text-starter/src/main/java/org/apache/camel/component/ibm/watson/stt/springboot/WatsonSpeechToTextComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class WatsonSpeechToTextComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ibm-watson-speech-to-text", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ibm-watson-speech-to-text-starter/src/main/java/org/apache/camel/component/ibm/watson/stt/springboot/WatsonSpeechToTextComponentConverter.java b/components-starter/camel-ibm-watson-speech-to-text-starter/src/main/java/org/apache/camel/component/ibm/watson/stt/springboot/WatsonSpeechToTextComponentConverter.java
index 879972f101d..408638ef1fa 100644
--- a/components-starter/camel-ibm-watson-speech-to-text-starter/src/main/java/org/apache/camel/component/ibm/watson/stt/springboot/WatsonSpeechToTextComponentConverter.java
+++ b/components-starter/camel-ibm-watson-speech-to-text-starter/src/main/java/org/apache/camel/component/ibm/watson/stt/springboot/WatsonSpeechToTextComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.ibm.watson.stt.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class WatsonSpeechToTextComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.ibm.watson.stt.WatsonSpeechToTextConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.ibm.watson.stt.WatsonSpeechToTextConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.ibm-watson-speech-to-text");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-ibm-watson-text-to-speech-starter/src/main/java/org/apache/camel/component/ibm/watson/tts/springboot/WatsonTextToSpeechComponentAutoConfiguration.java b/components-starter/camel-ibm-watson-text-to-speech-starter/src/main/java/org/apache/camel/component/ibm/watson/tts/springboot/WatsonTextToSpeechComponentAutoConfiguration.java
index 6b1f4e525e3..6dc83b0894f 100644
--- a/components-starter/camel-ibm-watson-text-to-speech-starter/src/main/java/org/apache/camel/component/ibm/watson/tts/springboot/WatsonTextToSpeechComponentAutoConfiguration.java
+++ b/components-starter/camel-ibm-watson-text-to-speech-starter/src/main/java/org/apache/camel/component/ibm/watson/tts/springboot/WatsonTextToSpeechComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class WatsonTextToSpeechComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ibm-watson-text-to-speech", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ibm-watson-text-to-speech-starter/src/main/java/org/apache/camel/component/ibm/watson/tts/springboot/WatsonTextToSpeechComponentConverter.java b/components-starter/camel-ibm-watson-text-to-speech-starter/src/main/java/org/apache/camel/component/ibm/watson/tts/springboot/WatsonTextToSpeechComponentConverter.java
index 7d5a2ca7800..9fc5e951b2c 100644
--- a/components-starter/camel-ibm-watson-text-to-speech-starter/src/main/java/org/apache/camel/component/ibm/watson/tts/springboot/WatsonTextToSpeechComponentConverter.java
+++ b/components-starter/camel-ibm-watson-text-to-speech-starter/src/main/java/org/apache/camel/component/ibm/watson/tts/springboot/WatsonTextToSpeechComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.ibm.watson.tts.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class WatsonTextToSpeechComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.ibm.watson.tts.WatsonTextToSpeechConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.ibm.watson.tts.WatsonTextToSpeechConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.ibm-watson-text-to-speech");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-ibm-watsonx-ai-starter/src/main/java/org/apache/camel/component/ibm/watsonx/ai/springboot/WatsonxAiComponentAutoConfiguration.java b/components-starter/camel-ibm-watsonx-ai-starter/src/main/java/org/apache/camel/component/ibm/watsonx/ai/springboot/WatsonxAiComponentAutoConfiguration.java
index 728f0465520..9ac6352fd04 100644
--- a/components-starter/camel-ibm-watsonx-ai-starter/src/main/java/org/apache/camel/component/ibm/watsonx/ai/springboot/WatsonxAiComponentAutoConfiguration.java
+++ b/components-starter/camel-ibm-watsonx-ai-starter/src/main/java/org/apache/camel/component/ibm/watsonx/ai/springboot/WatsonxAiComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class WatsonxAiComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ibm-watsonx-ai", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ibm-watsonx-ai-starter/src/main/java/org/apache/camel/component/ibm/watsonx/ai/springboot/WatsonxAiComponentConverter.java b/components-starter/camel-ibm-watsonx-ai-starter/src/main/java/org/apache/camel/component/ibm/watsonx/ai/springboot/WatsonxAiComponentConverter.java
index 6c081dab25c..6d6ee176c2c 100644
--- a/components-starter/camel-ibm-watsonx-ai-starter/src/main/java/org/apache/camel/component/ibm/watsonx/ai/springboot/WatsonxAiComponentConverter.java
+++ b/components-starter/camel-ibm-watsonx-ai-starter/src/main/java/org/apache/camel/component/ibm/watsonx/ai/springboot/WatsonxAiComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.ibm.watsonx.ai.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class WatsonxAiComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.ibm.watsonx.ai.WatsonxAiConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.ibm.watsonx.ai.WatsonxAiConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.ibm-watsonx-ai");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-ical-starter/src/main/java/org/apache/camel/component/ical/springboot/ICalDataFormatAutoConfiguration.java b/components-starter/camel-ical-starter/src/main/java/org/apache/camel/component/ical/springboot/ICalDataFormatAutoConfiguration.java
index 5f2e6573b3f..c4653b0da2f 100644
--- a/components-starter/camel-ical-starter/src/main/java/org/apache/camel/component/ical/springboot/ICalDataFormatAutoConfiguration.java
+++ b/components-starter/camel-ical-starter/src/main/java/org/apache/camel/component/ical/springboot/ICalDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class ICalDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.ical", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-iggy-starter/src/main/java/org/apache/camel/component/iggy/springboot/IggyComponentAutoConfiguration.java b/components-starter/camel-iggy-starter/src/main/java/org/apache/camel/component/iggy/springboot/IggyComponentAutoConfiguration.java
index f810c061bcb..9b6f6e593da 100644
--- a/components-starter/camel-iggy-starter/src/main/java/org/apache/camel/component/iggy/springboot/IggyComponentAutoConfiguration.java
+++ b/components-starter/camel-iggy-starter/src/main/java/org/apache/camel/component/iggy/springboot/IggyComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class IggyComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.iggy", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-iggy-starter/src/main/java/org/apache/camel/component/iggy/springboot/IggyComponentConverter.java b/components-starter/camel-iggy-starter/src/main/java/org/apache/camel/component/iggy/springboot/IggyComponentConverter.java
index c4168841502..f3445d3e45b 100644
--- a/components-starter/camel-iggy-starter/src/main/java/org/apache/camel/component/iggy/springboot/IggyComponentConverter.java
+++ b/components-starter/camel-iggy-starter/src/main/java/org/apache/camel/component/iggy/springboot/IggyComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.iggy.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -49,19 +50,6 @@ public class IggyComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.iggy.IggyConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.iggy.IggyConfiguration.class);
- case "org.apache.iggy.message.Partitioning": return applicationContext.getBean(ref, org.apache.iggy.message.Partitioning.class);
- case "org.apache.camel.support.jsse.SSLContextParameters": return applicationContext.getBean(ref, org.apache.camel.support.jsse.SSLContextParameters.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.iggy");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/cache/springboot/IgniteCacheComponentAutoConfiguration.java b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/cache/springboot/IgniteCacheComponentAutoConfiguration.java
index 27106605c42..b5c222c2ddc 100644
--- a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/cache/springboot/IgniteCacheComponentAutoConfiguration.java
+++ b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/cache/springboot/IgniteCacheComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class IgniteCacheComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ignite-cache", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/cache/springboot/IgniteCacheComponentConverter.java b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/cache/springboot/IgniteCacheComponentConverter.java
index e8a02bfe749..b009bf8a7a1 100644
--- a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/cache/springboot/IgniteCacheComponentConverter.java
+++ b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/cache/springboot/IgniteCacheComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.ignite.cache.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class IgniteCacheComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.ignite.Ignite": return applicationContext.getBean(ref, org.apache.ignite.Ignite.class);
- case "org.apache.ignite.configuration.IgniteConfiguration": return applicationContext.getBean(ref, org.apache.ignite.configuration.IgniteConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.ignite-cache");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/compute/springboot/IgniteComputeComponentAutoConfiguration.java b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/compute/springboot/IgniteComputeComponentAutoConfiguration.java
index bd20566ad7f..10f6a46d856 100644
--- a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/compute/springboot/IgniteComputeComponentAutoConfiguration.java
+++ b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/compute/springboot/IgniteComputeComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class IgniteComputeComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ignite-compute", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/compute/springboot/IgniteComputeComponentConverter.java b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/compute/springboot/IgniteComputeComponentConverter.java
index 9f67b6801f4..2bbb0151eb0 100644
--- a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/compute/springboot/IgniteComputeComponentConverter.java
+++ b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/compute/springboot/IgniteComputeComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.ignite.compute.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class IgniteComputeComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.ignite.Ignite": return applicationContext.getBean(ref, org.apache.ignite.Ignite.class);
- case "org.apache.ignite.configuration.IgniteConfiguration": return applicationContext.getBean(ref, org.apache.ignite.configuration.IgniteConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.ignite-compute");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/events/springboot/IgniteEventsComponentAutoConfiguration.java b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/events/springboot/IgniteEventsComponentAutoConfiguration.java
index e8b39f8f23e..6ad2331a853 100644
--- a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/events/springboot/IgniteEventsComponentAutoConfiguration.java
+++ b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/events/springboot/IgniteEventsComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class IgniteEventsComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ignite-events", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/events/springboot/IgniteEventsComponentConverter.java b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/events/springboot/IgniteEventsComponentConverter.java
index 0d99e5c596f..f1c88c644f0 100644
--- a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/events/springboot/IgniteEventsComponentConverter.java
+++ b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/events/springboot/IgniteEventsComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.ignite.events.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class IgniteEventsComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.ignite.Ignite": return applicationContext.getBean(ref, org.apache.ignite.Ignite.class);
- case "org.apache.ignite.configuration.IgniteConfiguration": return applicationContext.getBean(ref, org.apache.ignite.configuration.IgniteConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.ignite-events");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/idgen/springboot/IgniteIdGenComponentAutoConfiguration.java b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/idgen/springboot/IgniteIdGenComponentAutoConfiguration.java
index 1dc395a616a..813f8a1ecca 100644
--- a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/idgen/springboot/IgniteIdGenComponentAutoConfiguration.java
+++ b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/idgen/springboot/IgniteIdGenComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class IgniteIdGenComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ignite-idgen", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/idgen/springboot/IgniteIdGenComponentConverter.java b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/idgen/springboot/IgniteIdGenComponentConverter.java
index d938a9ad5e3..012e6f3ff35 100644
--- a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/idgen/springboot/IgniteIdGenComponentConverter.java
+++ b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/idgen/springboot/IgniteIdGenComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.ignite.idgen.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class IgniteIdGenComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.ignite.Ignite": return applicationContext.getBean(ref, org.apache.ignite.Ignite.class);
- case "org.apache.ignite.configuration.IgniteConfiguration": return applicationContext.getBean(ref, org.apache.ignite.configuration.IgniteConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.ignite-idgen");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/messaging/springboot/IgniteMessagingComponentAutoConfiguration.java b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/messaging/springboot/IgniteMessagingComponentAutoConfiguration.java
index 090dac6a2fa..c507b8ad308 100644
--- a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/messaging/springboot/IgniteMessagingComponentAutoConfiguration.java
+++ b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/messaging/springboot/IgniteMessagingComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class IgniteMessagingComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ignite-messaging", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/messaging/springboot/IgniteMessagingComponentConverter.java b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/messaging/springboot/IgniteMessagingComponentConverter.java
index b269956eebe..7c1946f7d6a 100644
--- a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/messaging/springboot/IgniteMessagingComponentConverter.java
+++ b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/messaging/springboot/IgniteMessagingComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.ignite.messaging.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class IgniteMessagingComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.ignite.Ignite": return applicationContext.getBean(ref, org.apache.ignite.Ignite.class);
- case "org.apache.ignite.configuration.IgniteConfiguration": return applicationContext.getBean(ref, org.apache.ignite.configuration.IgniteConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.ignite-messaging");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/queue/springboot/IgniteQueueComponentAutoConfiguration.java b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/queue/springboot/IgniteQueueComponentAutoConfiguration.java
index a5441f6b469..6288dec5401 100644
--- a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/queue/springboot/IgniteQueueComponentAutoConfiguration.java
+++ b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/queue/springboot/IgniteQueueComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class IgniteQueueComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ignite-queue", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/queue/springboot/IgniteQueueComponentConverter.java b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/queue/springboot/IgniteQueueComponentConverter.java
index 04b5a805a13..65ceef1cee5 100644
--- a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/queue/springboot/IgniteQueueComponentConverter.java
+++ b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/queue/springboot/IgniteQueueComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.ignite.queue.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class IgniteQueueComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.ignite.Ignite": return applicationContext.getBean(ref, org.apache.ignite.Ignite.class);
- case "org.apache.ignite.configuration.IgniteConfiguration": return applicationContext.getBean(ref, org.apache.ignite.configuration.IgniteConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.ignite-queue");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/set/springboot/IgniteSetComponentAutoConfiguration.java b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/set/springboot/IgniteSetComponentAutoConfiguration.java
index 3d0e8488ce5..b2e575cab2b 100644
--- a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/set/springboot/IgniteSetComponentAutoConfiguration.java
+++ b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/set/springboot/IgniteSetComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class IgniteSetComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.ignite-set", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/set/springboot/IgniteSetComponentConverter.java b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/set/springboot/IgniteSetComponentConverter.java
index ae2d2667814..5bc3937ff3d 100644
--- a/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/set/springboot/IgniteSetComponentConverter.java
+++ b/components-starter/camel-ignite-starter/src/main/java/org/apache/camel/component/ignite/set/springboot/IgniteSetComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.ignite.set.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class IgniteSetComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.ignite.Ignite": return applicationContext.getBean(ref, org.apache.ignite.Ignite.class);
- case "org.apache.ignite.configuration.IgniteConfiguration": return applicationContext.getBean(ref, org.apache.ignite.configuration.IgniteConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.ignite-set");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-infinispan-embedded-starter/src/main/java/org/apache/camel/component/infinispan/embedded/springboot/InfinispanEmbeddedComponentAutoConfiguration.java b/components-starter/camel-infinispan-embedded-starter/src/main/java/org/apache/camel/component/infinispan/embedded/springboot/InfinispanEmbeddedComponentAutoConfiguration.java
index e4ebafb59e2..9f648392b9a 100644
--- a/components-starter/camel-infinispan-embedded-starter/src/main/java/org/apache/camel/component/infinispan/embedded/springboot/InfinispanEmbeddedComponentAutoConfiguration.java
+++ b/components-starter/camel-infinispan-embedded-starter/src/main/java/org/apache/camel/component/infinispan/embedded/springboot/InfinispanEmbeddedComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class InfinispanEmbeddedComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.infinispan-embedded", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-infinispan-embedded-starter/src/main/java/org/apache/camel/component/infinispan/embedded/springboot/InfinispanEmbeddedComponentConverter.java b/components-starter/camel-infinispan-embedded-starter/src/main/java/org/apache/camel/component/infinispan/embedded/springboot/InfinispanEmbeddedComponentConverter.java
index 1ef31865137..e2877619d9d 100644
--- a/components-starter/camel-infinispan-embedded-starter/src/main/java/org/apache/camel/component/infinispan/embedded/springboot/InfinispanEmbeddedComponentConverter.java
+++ b/components-starter/camel-infinispan-embedded-starter/src/main/java/org/apache/camel/component/infinispan/embedded/springboot/InfinispanEmbeddedComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.infinispan.embedded.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -52,22 +53,6 @@ public class InfinispanEmbeddedComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration.class);
- case "org.apache.camel.component.infinispan.InfinispanQueryBuilder": return applicationContext.getBean(ref, org.apache.camel.component.infinispan.InfinispanQueryBuilder.class);
- case "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener": return applicationContext.getBean(ref, org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener.class);
- case "org.infinispan.manager.EmbeddedCacheManager": return applicationContext.getBean(ref, org.infinispan.manager.EmbeddedCacheManager.class);
- case "org.infinispan.configuration.cache.Configuration": return applicationContext.getBean(ref, org.infinispan.configuration.cache.Configuration.class);
- case "java.util.function.BiFunction": return applicationContext.getBean(ref, java.util.function.BiFunction.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.infinispan-embedded");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/InfinispanRemoteComponentAutoConfiguration.java b/components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/InfinispanRemoteComponentAutoConfiguration.java
index 744229c717a..7c1fd2d58cf 100644
--- a/components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/InfinispanRemoteComponentAutoConfiguration.java
+++ b/components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/InfinispanRemoteComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class InfinispanRemoteComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.infinispan", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/InfinispanRemoteComponentConverter.java b/components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/InfinispanRemoteComponentConverter.java
index 6bf5c538c9d..342f6766083 100644
--- a/components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/InfinispanRemoteComponentConverter.java
+++ b/components-starter/camel-infinispan-starter/src/main/java/org/apache/camel/component/infinispan/remote/springboot/InfinispanRemoteComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.infinispan.remote.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -52,22 +53,6 @@ public class InfinispanRemoteComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration.class);
- case "org.apache.camel.component.infinispan.InfinispanQueryBuilder": return applicationContext.getBean(ref, org.apache.camel.component.infinispan.InfinispanQueryBuilder.class);
- case "org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener": return applicationContext.getBean(ref, org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener.class);
- case "org.infinispan.client.hotrod.RemoteCacheManager": return applicationContext.getBean(ref, org.infinispan.client.hotrod.RemoteCacheManager.class);
- case "org.infinispan.client.hotrod.configuration.Configuration": return applicationContext.getBean(ref, org.infinispan.client.hotrod.configuration.Configuration.class);
- case "java.util.function.BiFunction": return applicationContext.getBean(ref, java.util.function.BiFunction.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.infinispan");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-influxdb-starter/src/main/java/org/apache/camel/component/influxdb/springboot/InfluxDbComponentAutoConfiguration.java b/components-starter/camel-influxdb-starter/src/main/java/org/apache/camel/component/influxdb/springboot/InfluxDbComponentAutoConfiguration.java
index ea225e26348..fbb674c71dc 100644
--- a/components-starter/camel-influxdb-starter/src/main/java/org/apache/camel/component/influxdb/springboot/InfluxDbComponentAutoConfiguration.java
+++ b/components-starter/camel-influxdb-starter/src/main/java/org/apache/camel/component/influxdb/springboot/InfluxDbComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class InfluxDbComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.influxdb", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-influxdb-starter/src/main/java/org/apache/camel/component/influxdb/springboot/InfluxDbComponentConverter.java b/components-starter/camel-influxdb-starter/src/main/java/org/apache/camel/component/influxdb/springboot/InfluxDbComponentConverter.java
index f24b8c0856b..d90bc6bbebf 100644
--- a/components-starter/camel-influxdb-starter/src/main/java/org/apache/camel/component/influxdb/springboot/InfluxDbComponentConverter.java
+++ b/components-starter/camel-influxdb-starter/src/main/java/org/apache/camel/component/influxdb/springboot/InfluxDbComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.influxdb.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class InfluxDbComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.influxdb.InfluxDB": return applicationContext.getBean(ref, org.influxdb.InfluxDB.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.influxdb");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-influxdb2-starter/src/main/java/org/apache/camel/component/influxdb2/springboot/InfluxDb2ComponentAutoConfiguration.java b/components-starter/camel-influxdb2-starter/src/main/java/org/apache/camel/component/influxdb2/springboot/InfluxDb2ComponentAutoConfiguration.java
index 7054fac0c37..3cc4a29d952 100644
--- a/components-starter/camel-influxdb2-starter/src/main/java/org/apache/camel/component/influxdb2/springboot/InfluxDb2ComponentAutoConfiguration.java
+++ b/components-starter/camel-influxdb2-starter/src/main/java/org/apache/camel/component/influxdb2/springboot/InfluxDb2ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class InfluxDb2ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.influxdb2", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-influxdb2-starter/src/main/java/org/apache/camel/component/influxdb2/springboot/InfluxDb2ComponentConverter.java b/components-starter/camel-influxdb2-starter/src/main/java/org/apache/camel/component/influxdb2/springboot/InfluxDb2ComponentConverter.java
index 74f81ec63fe..6003f5e7b56 100644
--- a/components-starter/camel-influxdb2-starter/src/main/java/org/apache/camel/component/influxdb2/springboot/InfluxDb2ComponentConverter.java
+++ b/components-starter/camel-influxdb2-starter/src/main/java/org/apache/camel/component/influxdb2/springboot/InfluxDb2ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.influxdb2.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class InfluxDb2ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.influxdb.client.InfluxDBClient": return applicationContext.getBean(ref, com.influxdb.client.InfluxDBClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.influxdb2");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-iso8583-starter/src/main/java/org/apache/camel/dataformat/iso8583/springboot/Iso8583DataFormatAutoConfiguration.java b/components-starter/camel-iso8583-starter/src/main/java/org/apache/camel/dataformat/iso8583/springboot/Iso8583DataFormatAutoConfiguration.java
index 620beba2795..e81a6bf0b1a 100644
--- a/components-starter/camel-iso8583-starter/src/main/java/org/apache/camel/dataformat/iso8583/springboot/Iso8583DataFormatAutoConfiguration.java
+++ b/components-starter/camel-iso8583-starter/src/main/java/org/apache/camel/dataformat/iso8583/springboot/Iso8583DataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class Iso8583DataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.iso8583", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-jackson-avro-starter/src/main/java/org/apache/camel/component/jackson/avro/springboot/JacksonAvroDataFormatAutoConfiguration.java b/components-starter/camel-jackson-avro-starter/src/main/java/org/apache/camel/component/jackson/avro/springboot/JacksonAvroDataFormatAutoConfiguration.java
index d521029e641..e972791282f 100644
--- a/components-starter/camel-jackson-avro-starter/src/main/java/org/apache/camel/component/jackson/avro/springboot/JacksonAvroDataFormatAutoConfiguration.java
+++ b/components-starter/camel-jackson-avro-starter/src/main/java/org/apache/camel/component/jackson/avro/springboot/JacksonAvroDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class JacksonAvroDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.avro-jackson", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-jackson-protobuf-starter/src/main/java/org/apache/camel/component/jackson/protobuf/springboot/JacksonProtobufDataFormatAutoConfiguration.java b/components-starter/camel-jackson-protobuf-starter/src/main/java/org/apache/camel/component/jackson/protobuf/springboot/JacksonProtobufDataFormatAutoConfiguration.java
index 4bb41ccca01..3f35ea5a4f5 100644
--- a/components-starter/camel-jackson-protobuf-starter/src/main/java/org/apache/camel/component/jackson/protobuf/springboot/JacksonProtobufDataFormatAutoConfiguration.java
+++ b/components-starter/camel-jackson-protobuf-starter/src/main/java/org/apache/camel/component/jackson/protobuf/springboot/JacksonProtobufDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class JacksonProtobufDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.protobuf-jackson", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatAutoConfiguration.java b/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatAutoConfiguration.java
index 9aff6812216..e09c30a7545 100644
--- a/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatAutoConfiguration.java
+++ b/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class JacksonDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.jackson", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatConverter.java b/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatConverter.java
index 1fe3878d51b..c91bd96daf3 100644
--- a/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatConverter.java
+++ b/components-starter/camel-jackson-starter/src/main/java/org/apache/camel/component/jackson/springboot/JacksonDataFormatConverter.java
@@ -18,7 +18,7 @@ package org.apache.camel.component.jackson.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
-import org.apache.camel.CamelContext;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,17 +48,6 @@ public class JacksonDataFormatConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.jackson.SchemaResolver": return applicationContext.getBean(ref, org.apache.camel.component.jackson.SchemaResolver.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.dataformat.jackson");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-jackson3-avro-starter/src/main/java/org/apache/camel/component/jackson3/avro/springboot/JacksonAvroDataFormatAutoConfiguration.java b/components-starter/camel-jackson3-avro-starter/src/main/java/org/apache/camel/component/jackson3/avro/springboot/JacksonAvroDataFormatAutoConfiguration.java
index be1976938a6..3c18f08b642 100644
--- a/components-starter/camel-jackson3-avro-starter/src/main/java/org/apache/camel/component/jackson3/avro/springboot/JacksonAvroDataFormatAutoConfiguration.java
+++ b/components-starter/camel-jackson3-avro-starter/src/main/java/org/apache/camel/component/jackson3/avro/springboot/JacksonAvroDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class JacksonAvroDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.avro-jackson", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-jackson3-protobuf-starter/src/main/java/org/apache/camel/component/jackson3/protobuf/springboot/JacksonProtobufDataFormatAutoConfiguration.java b/components-starter/camel-jackson3-protobuf-starter/src/main/java/org/apache/camel/component/jackson3/protobuf/springboot/JacksonProtobufDataFormatAutoConfiguration.java
index ce38d269076..b60d3541bf7 100644
--- a/components-starter/camel-jackson3-protobuf-starter/src/main/java/org/apache/camel/component/jackson3/protobuf/springboot/JacksonProtobufDataFormatAutoConfiguration.java
+++ b/components-starter/camel-jackson3-protobuf-starter/src/main/java/org/apache/camel/component/jackson3/protobuf/springboot/JacksonProtobufDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class JacksonProtobufDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.protobuf-jackson", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-jackson3-starter/src/main/java/org/apache/camel/component/jackson3/springboot/JacksonDataFormatAutoConfiguration.java b/components-starter/camel-jackson3-starter/src/main/java/org/apache/camel/component/jackson3/springboot/JacksonDataFormatAutoConfiguration.java
index 4d47ebce875..df04ddd5a71 100644
--- a/components-starter/camel-jackson3-starter/src/main/java/org/apache/camel/component/jackson3/springboot/JacksonDataFormatAutoConfiguration.java
+++ b/components-starter/camel-jackson3-starter/src/main/java/org/apache/camel/component/jackson3/springboot/JacksonDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class JacksonDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.jackson", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-jackson3-starter/src/main/java/org/apache/camel/component/jackson3/springboot/JacksonDataFormatConverter.java b/components-starter/camel-jackson3-starter/src/main/java/org/apache/camel/component/jackson3/springboot/JacksonDataFormatConverter.java
index 4acd12c8ed7..e01965aae3f 100644
--- a/components-starter/camel-jackson3-starter/src/main/java/org/apache/camel/component/jackson3/springboot/JacksonDataFormatConverter.java
+++ b/components-starter/camel-jackson3-starter/src/main/java/org/apache/camel/component/jackson3/springboot/JacksonDataFormatConverter.java
@@ -18,7 +18,7 @@ package org.apache.camel.component.jackson3.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
-import org.apache.camel.CamelContext;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,17 +48,6 @@ public class JacksonDataFormatConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.jackson3.SchemaResolver": return applicationContext.getBean(ref, org.apache.camel.component.jackson3.SchemaResolver.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.dataformat.jackson");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-jackson3xml-starter/src/main/java/org/apache/camel/component/jackson3xml/springboot/JacksonXMLDataFormatAutoConfiguration.java b/components-starter/camel-jackson3xml-starter/src/main/java/org/apache/camel/component/jackson3xml/springboot/JacksonXMLDataFormatAutoConfiguration.java
index 59ab5b92b8e..beecd35770e 100644
--- a/components-starter/camel-jackson3xml-starter/src/main/java/org/apache/camel/component/jackson3xml/springboot/JacksonXMLDataFormatAutoConfiguration.java
+++ b/components-starter/camel-jackson3xml-starter/src/main/java/org/apache/camel/component/jackson3xml/springboot/JacksonXMLDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class JacksonXMLDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.jackson-xml", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-jacksonxml-starter/src/main/java/org/apache/camel/component/jacksonxml/springboot/JacksonXMLDataFormatAutoConfiguration.java b/components-starter/camel-jacksonxml-starter/src/main/java/org/apache/camel/component/jacksonxml/springboot/JacksonXMLDataFormatAutoConfiguration.java
index a87e211e315..d468809a8f7 100644
--- a/components-starter/camel-jacksonxml-starter/src/main/java/org/apache/camel/component/jacksonxml/springboot/JacksonXMLDataFormatAutoConfiguration.java
+++ b/components-starter/camel-jacksonxml-starter/src/main/java/org/apache/camel/component/jacksonxml/springboot/JacksonXMLDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class JacksonXMLDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.jackson-xml", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-jactl-starter/src/main/java/org/apache/camel/language/jactl/springboot/JactlLanguageAutoConfiguration.java b/components-starter/camel-jactl-starter/src/main/java/org/apache/camel/language/jactl/springboot/JactlLanguageAutoConfiguration.java
index b33b5f30bb9..bfbacf163cf 100644
--- a/components-starter/camel-jactl-starter/src/main/java/org/apache/camel/language/jactl/springboot/JactlLanguageAutoConfiguration.java
+++ b/components-starter/camel-jactl-starter/src/main/java/org/apache/camel/language/jactl/springboot/JactlLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class JactlLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.jactl", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-javascript-starter/src/main/java/org/apache/camel/language/js/springboot/JavaScriptLanguageAutoConfiguration.java b/components-starter/camel-javascript-starter/src/main/java/org/apache/camel/language/js/springboot/JavaScriptLanguageAutoConfiguration.java
index f82d9bc5fab..edbf7617954 100644
--- a/components-starter/camel-javascript-starter/src/main/java/org/apache/camel/language/js/springboot/JavaScriptLanguageAutoConfiguration.java
+++ b/components-starter/camel-javascript-starter/src/main/java/org/apache/camel/language/js/springboot/JavaScriptLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class JavaScriptLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.js", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-jaxb-starter/src/main/java/org/apache/camel/converter/jaxb/springboot/JaxbDataFormatAutoConfiguration.java b/components-starter/camel-jaxb-starter/src/main/java/org/apache/camel/converter/jaxb/springboot/JaxbDataFormatAutoConfiguration.java
index 30d473095d3..a2527c70627 100644
--- a/components-starter/camel-jaxb-starter/src/main/java/org/apache/camel/converter/jaxb/springboot/JaxbDataFormatAutoConfiguration.java
+++ b/components-starter/camel-jaxb-starter/src/main/java/org/apache/camel/converter/jaxb/springboot/JaxbDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class JaxbDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.jaxb", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-jcache-starter/src/main/java/org/apache/camel/component/jcache/springboot/JCacheComponentAutoConfiguration.java b/components-starter/camel-jcache-starter/src/main/java/org/apache/camel/component/jcache/springboot/JCacheComponentAutoConfiguration.java
index 8af147a980e..ec563bf112d 100644
--- a/components-starter/camel-jcache-starter/src/main/java/org/apache/camel/component/jcache/springboot/JCacheComponentAutoConfiguration.java
+++ b/components-starter/camel-jcache-starter/src/main/java/org/apache/camel/component/jcache/springboot/JCacheComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class JCacheComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.jcache", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-jcache-starter/src/main/java/org/apache/camel/component/jcache/springboot/JCacheComponentConverter.java b/components-starter/camel-jcache-starter/src/main/java/org/apache/camel/component/jcache/springboot/JCacheComponentConverter.java
index a1a5a8e2fc7..dec605a63cf 100644
--- a/components-starter/camel-jcache-starter/src/main/java/org/apache/camel/component/jcache/springboot/JCacheComponentConverter.java
+++ b/components-starter/camel-jcache-starter/src/main/java/org/apache/camel/component/jcache/springboot/JCacheComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.jcache.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class JCacheComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "javax.cache.configuration.Configuration": return applicationContext.getBean(ref, javax.cache.configuration.Configuration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.jcache");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-jcr-starter/src/main/java/org/apache/camel/component/jcr/springboot/JcrComponentAutoConfiguration.java b/components-starter/camel-jcr-starter/src/main/java/org/apache/camel/component/jcr/springboot/JcrComponentAutoConfiguration.java
index d0d4fad97e9..8f6d5c61207 100644
--- a/components-starter/camel-jcr-starter/src/main/java/org/apache/camel/component/jcr/springboot/JcrComponentAutoConfiguration.java
+++ b/components-starter/camel-jcr-starter/src/main/java/org/apache/camel/component/jcr/springboot/JcrComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class JcrComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.jcr", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-jdbc-starter/src/main/java/org/apache/camel/component/jdbc/springboot/JdbcComponentAutoConfiguration.java b/components-starter/camel-jdbc-starter/src/main/java/org/apache/camel/component/jdbc/springboot/JdbcComponentAutoConfiguration.java
index 0cf73cf2c84..b44d26718fd 100644
--- a/components-starter/camel-jdbc-starter/src/main/java/org/apache/camel/component/jdbc/springboot/JdbcComponentAutoConfiguration.java
+++ b/components-starter/camel-jdbc-starter/src/main/java/org/apache/camel/component/jdbc/springboot/JdbcComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class JdbcComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.jdbc", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-jdbc-starter/src/main/java/org/apache/camel/component/jdbc/springboot/JdbcComponentConverter.java b/components-starter/camel-jdbc-starter/src/main/java/org/apache/camel/component/jdbc/springboot/JdbcComponentConverter.java
index 526cac1aac6..78873e20cd4 100644
--- a/components-starter/camel-jdbc-starter/src/main/java/org/apache/camel/component/jdbc/springboot/JdbcComponentConverter.java
+++ b/components-starter/camel-jdbc-starter/src/main/java/org/apache/camel/component/jdbc/springboot/JdbcComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.jdbc.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class JdbcComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "javax.sql.DataSource": return applicationContext.getBean(ref, javax.sql.DataSource.class);
- case "org.apache.camel.component.jdbc.ConnectionStrategy": return applicationContext.getBean(ref, org.apache.camel.component.jdbc.ConnectionStrategy.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.jdbc");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-jetty-starter/src/main/java/org/apache/camel/component/jetty12/springboot/JettyHttpComponentAutoConfiguration12.java b/components-starter/camel-jetty-starter/src/main/java/org/apache/camel/component/jetty12/springboot/JettyHttpComponentAutoConfiguration12.java
index 73db943f0b6..ec9f5550105 100644
--- a/components-starter/camel-jetty-starter/src/main/java/org/apache/camel/component/jetty12/springboot/JettyHttpComponentAutoConfiguration12.java
+++ b/components-starter/camel-jetty-starter/src/main/java/org/apache/camel/component/jetty12/springboot/JettyHttpComponentAutoConfiguration12.java
@@ -58,7 +58,8 @@ public class JettyHttpComponentAutoConfiguration12 {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.jetty", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-jetty-starter/src/main/java/org/apache/camel/component/jetty12/springboot/JettyHttpComponentConverter12.java b/components-starter/camel-jetty-starter/src/main/java/org/apache/camel/component/jetty12/springboot/JettyHttpComponentConverter12.java
index aaa1d3176a7..5f2cf960c4c 100644
--- a/components-starter/camel-jetty-starter/src/main/java/org/apache/camel/component/jetty12/springboot/JettyHttpComponentConverter12.java
+++ b/components-starter/camel-jetty-starter/src/main/java/org/apache/camel/component/jetty12/springboot/JettyHttpComponentConverter12.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.jetty12.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -55,25 +56,6 @@ public class JettyHttpComponentConverter12 implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.eclipse.jetty.util.thread.ThreadPool": return applicationContext.getBean(ref, org.eclipse.jetty.util.thread.ThreadPool.class);
- case "org.eclipse.jetty.server.handler.ErrorHandler": return applicationContext.getBean(ref, org.eclipse.jetty.server.handler.ErrorHandler.class);
- case "org.apache.camel.http.common.HttpBinding": return applicationContext.getBean(ref, org.apache.camel.http.common.HttpBinding.class);
- case "org.apache.camel.http.common.HttpConfiguration": return applicationContext.getBean(ref, org.apache.camel.http.common.HttpConfiguration.class);
- case "org.eclipse.jetty.jmx.MBeanContainer": return applicationContext.getBean(ref, org.eclipse.jetty.jmx.MBeanContainer.class);
- case "org.eclipse.jetty.server.RequestLog": return applicationContext.getBean(ref, org.eclipse.jetty.server.RequestLog.class);
- case "org.eclipse.jetty.server.SecureRequestCustomizer": return applicationContext.getBean(ref, org.eclipse.jetty.server.SecureRequestCustomizer.class);
- case "org.apache.camel.spi.HeaderFilterStrategy": return applicationContext.getBean(ref, org.apache.camel.spi.HeaderFilterStrategy.class);
- case "org.apache.camel.support.jsse.SSLContextParameters": return applicationContext.getBean(ref, org.apache.camel.support.jsse.SSLContextParameters.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.jetty");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-jgroups-raft-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/JGroupsRaftComponentAutoConfiguration.java b/components-starter/camel-jgroups-raft-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/JGroupsRaftComponentAutoConfiguration.java
index 4187a95463a..5bcf015ee0f 100644
--- a/components-starter/camel-jgroups-raft-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/JGroupsRaftComponentAutoConfiguration.java
+++ b/components-starter/camel-jgroups-raft-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/JGroupsRaftComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class JGroupsRaftComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.jgroups-raft", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-jgroups-raft-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/JGroupsRaftComponentConverter.java b/components-starter/camel-jgroups-raft-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/JGroupsRaftComponentConverter.java
index a7b2bd84148..9581b1f99aa 100644
--- a/components-starter/camel-jgroups-raft-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/JGroupsRaftComponentConverter.java
+++ b/components-starter/camel-jgroups-raft-starter/src/main/java/org/apache/camel/component/jgroups/raft/springboot/JGroupsRaftComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.jgroups.raft.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class JGroupsRaftComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.jgroups.raft.RaftHandle": return applicationContext.getBean(ref, org.jgroups.raft.RaftHandle.class);
- case "org.jgroups.raft.StateMachine": return applicationContext.getBean(ref, org.jgroups.raft.StateMachine.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.jgroups-raft");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-jgroups-starter/src/main/java/org/apache/camel/component/jgroups/springboot/JGroupsComponentAutoConfiguration.java b/components-starter/camel-jgroups-starter/src/main/java/org/apache/camel/component/jgroups/springboot/JGroupsComponentAutoConfiguration.java
index 9d27b03883c..3cafa3968de 100644
--- a/components-starter/camel-jgroups-starter/src/main/java/org/apache/camel/component/jgroups/springboot/JGroupsComponentAutoConfiguration.java
+++ b/components-starter/camel-jgroups-starter/src/main/java/org/apache/camel/component/jgroups/springboot/JGroupsComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class JGroupsComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.jgroups", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-jgroups-starter/src/main/java/org/apache/camel/component/jgroups/springboot/JGroupsComponentConverter.java b/components-starter/camel-jgroups-starter/src/main/java/org/apache/camel/component/jgroups/springboot/JGroupsComponentConverter.java
index c2a75de098d..abc09c471e1 100644
--- a/components-starter/camel-jgroups-starter/src/main/java/org/apache/camel/component/jgroups/springboot/JGroupsComponentConverter.java
+++ b/components-starter/camel-jgroups-starter/src/main/java/org/apache/camel/component/jgroups/springboot/JGroupsComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.jgroups.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class JGroupsComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.jgroups.JChannel": return applicationContext.getBean(ref, org.jgroups.JChannel.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.jgroups");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-jira-starter/src/main/java/org/apache/camel/component/jira/springboot/JiraComponentAutoConfiguration.java b/components-starter/camel-jira-starter/src/main/java/org/apache/camel/component/jira/springboot/JiraComponentAutoConfiguration.java
index 8bc0725ee17..0f032efb067 100644
--- a/components-starter/camel-jira-starter/src/main/java/org/apache/camel/component/jira/springboot/JiraComponentAutoConfiguration.java
+++ b/components-starter/camel-jira-starter/src/main/java/org/apache/camel/component/jira/springboot/JiraComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class JiraComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.jira", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-jira-starter/src/main/java/org/apache/camel/component/jira/springboot/JiraComponentConverter.java b/components-starter/camel-jira-starter/src/main/java/org/apache/camel/component/jira/springboot/JiraComponentConverter.java
index fcc1b7cc403..35dc642e206 100644
--- a/components-starter/camel-jira-starter/src/main/java/org/apache/camel/component/jira/springboot/JiraComponentConverter.java
+++ b/components-starter/camel-jira-starter/src/main/java/org/apache/camel/component/jira/springboot/JiraComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.jira.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class JiraComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.jira.JiraConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.jira.JiraConfiguration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.jira");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentAutoConfiguration.java b/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentAutoConfiguration.java
index 12c0698ef67..3c046fe1967 100644
--- a/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentAutoConfiguration.java
+++ b/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class JmsComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.jms", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConverter.java b/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConverter.java
index f66074bbf25..4559e4635d5 100644
--- a/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConverter.java
+++ b/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.jms.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -59,29 +60,6 @@ public class JmsComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "jakarta.jms.ConnectionFactory": return applicationContext.getBean(ref, jakarta.jms.ConnectionFactory.class);
- case "org.springframework.core.task.TaskExecutor": return applicationContext.getBean(ref, org.springframework.core.task.TaskExecutor.class);
- case "org.apache.camel.component.jms.JmsConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.jms.JmsConfiguration.class);
- case "org.springframework.jms.support.destination.DestinationResolver": return applicationContext.getBean(ref, org.springframework.jms.support.destination.DestinationResolver.class);
- case "org.springframework.util.ErrorHandler": return applicationContext.getBean(ref, org.springframework.util.ErrorHandler.class);
- case "jakarta.jms.ExceptionListener": return applicationContext.getBean(ref, jakarta.jms.ExceptionListener.class);
- case "org.springframework.jms.support.converter.MessageConverter": return applicationContext.getBean(ref, org.springframework.jms.support.converter.MessageConverter.class);
- case "org.apache.camel.component.jms.MessageCreatedStrategy": return applicationContext.getBean(ref, org.apache.camel.component.jms.MessageCreatedStrategy.class);
- case "org.apache.camel.component.jms.MessageListenerContainerFactory": return applicationContext.getBean(ref, org.apache.camel.component.jms.MessageListenerContainerFactory.class);
- case "org.apache.camel.component.jms.QueueBrowseStrategy": return applicationContext.getBean(ref, org.apache.camel.component.jms.QueueBrowseStrategy.class);
- case "org.apache.camel.component.jms.TemporaryQueueResolver": return applicationContext.getBean(ref, org.apache.camel.component.jms.TemporaryQueueResolver.class);
- case "org.apache.camel.spi.HeaderFilterStrategy": return applicationContext.getBean(ref, org.apache.camel.spi.HeaderFilterStrategy.class);
- case "org.springframework.transaction.PlatformTransactionManager": return applicationContext.getBean(ref, org.springframework.transaction.PlatformTransactionManager.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.jms");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-jmx-starter/src/main/java/org/apache/camel/component/jmx/springboot/JMXComponentAutoConfiguration.java b/components-starter/camel-jmx-starter/src/main/java/org/apache/camel/component/jmx/springboot/JMXComponentAutoConfiguration.java
index 5f75ac25f7b..540e7bd4c74 100644
--- a/components-starter/camel-jmx-starter/src/main/java/org/apache/camel/component/jmx/springboot/JMXComponentAutoConfiguration.java
+++ b/components-starter/camel-jmx-starter/src/main/java/org/apache/camel/component/jmx/springboot/JMXComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class JMXComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.jmx", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-jolt-starter/src/main/java/org/apache/camel/component/jolt/springboot/JoltComponentAutoConfiguration.java b/components-starter/camel-jolt-starter/src/main/java/org/apache/camel/component/jolt/springboot/JoltComponentAutoConfiguration.java
index e3e28c338a9..2b0ee73b7ec 100644
--- a/components-starter/camel-jolt-starter/src/main/java/org/apache/camel/component/jolt/springboot/JoltComponentAutoConfiguration.java
+++ b/components-starter/camel-jolt-starter/src/main/java/org/apache/camel/component/jolt/springboot/JoltComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class JoltComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.jolt", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-jolt-starter/src/main/java/org/apache/camel/component/jolt/springboot/JoltComponentConverter.java b/components-starter/camel-jolt-starter/src/main/java/org/apache/camel/component/jolt/springboot/JoltComponentConverter.java
index b230814ab30..7b8ee88558b 100644
--- a/components-starter/camel-jolt-starter/src/main/java/org/apache/camel/component/jolt/springboot/JoltComponentConverter.java
+++ b/components-starter/camel-jolt-starter/src/main/java/org/apache/camel/component/jolt/springboot/JoltComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.jolt.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class JoltComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.bazaarvoice.jolt.Transform": return applicationContext.getBean(ref, com.bazaarvoice.jolt.Transform.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.jolt");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-jooq-starter/src/main/java/org/apache/camel/component/jooq/springboot/JooqComponentAutoConfiguration.java b/components-starter/camel-jooq-starter/src/main/java/org/apache/camel/component/jooq/springboot/JooqComponentAutoConfiguration.java
index f44bc085b01..6aac2b7214f 100644
--- a/components-starter/camel-jooq-starter/src/main/java/org/apache/camel/component/jooq/springboot/JooqComponentAutoConfiguration.java
+++ b/components-starter/camel-jooq-starter/src/main/java/org/apache/camel/component/jooq/springboot/JooqComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class JooqComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.jooq", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-jooq-starter/src/main/java/org/apache/camel/component/jooq/springboot/JooqComponentConverter.java b/components-starter/camel-jooq-starter/src/main/java/org/apache/camel/component/jooq/springboot/JooqComponentConverter.java
index 7f60f7249d0..f5ad7ccb243 100644
--- a/components-starter/camel-jooq-starter/src/main/java/org/apache/camel/component/jooq/springboot/JooqComponentConverter.java
+++ b/components-starter/camel-jooq-starter/src/main/java/org/apache/camel/component/jooq/springboot/JooqComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.jooq.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class JooqComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.jooq.JooqConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.jooq.JooqConfiguration.class);
- case "org.jooq.Configuration": return applicationContext.getBean(ref, org.jooq.Configuration.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.jooq");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-joor-starter/src/main/java/org/apache/camel/language/joor/springboot/JavaLanguageAutoConfiguration.java b/components-starter/camel-joor-starter/src/main/java/org/apache/camel/language/joor/springboot/JavaLanguageAutoConfiguration.java
index 2a3c3f05d65..b89d7cfe2d1 100644
--- a/components-starter/camel-joor-starter/src/main/java/org/apache/camel/language/joor/springboot/JavaLanguageAutoConfiguration.java
+++ b/components-starter/camel-joor-starter/src/main/java/org/apache/camel/language/joor/springboot/JavaLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class JavaLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.java", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-joor-starter/src/main/java/org/apache/camel/language/joor/springboot/JoorLanguageAutoConfiguration.java b/components-starter/camel-joor-starter/src/main/java/org/apache/camel/language/joor/springboot/JoorLanguageAutoConfiguration.java
index 68db4126a0e..62b0d036ce4 100644
--- a/components-starter/camel-joor-starter/src/main/java/org/apache/camel/language/joor/springboot/JoorLanguageAutoConfiguration.java
+++ b/components-starter/camel-joor-starter/src/main/java/org/apache/camel/language/joor/springboot/JoorLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class JoorLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.joor", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-jpa-starter/src/main/java/org/apache/camel/component/jpa/springboot/JpaComponentAutoConfiguration.java b/components-starter/camel-jpa-starter/src/main/java/org/apache/camel/component/jpa/springboot/JpaComponentAutoConfiguration.java
index 58fb4bab22b..0d521096535 100644
--- a/components-starter/camel-jpa-starter/src/main/java/org/apache/camel/component/jpa/springboot/JpaComponentAutoConfiguration.java
+++ b/components-starter/camel-jpa-starter/src/main/java/org/apache/camel/component/jpa/springboot/JpaComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class JpaComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.jpa", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-jpa-starter/src/main/java/org/apache/camel/component/jpa/springboot/JpaComponentConverter.java b/components-starter/camel-jpa-starter/src/main/java/org/apache/camel/component/jpa/springboot/JpaComponentConverter.java
index 66a2fc34e1e..546270c4384 100644
--- a/components-starter/camel-jpa-starter/src/main/java/org/apache/camel/component/jpa/springboot/JpaComponentConverter.java
+++ b/components-starter/camel-jpa-starter/src/main/java/org/apache/camel/component/jpa/springboot/JpaComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.jpa.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class JpaComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "jakarta.persistence.EntityManagerFactory": return applicationContext.getBean(ref, jakarta.persistence.EntityManagerFactory.class);
- case "org.apache.camel.component.jpa.TransactionStrategy": return applicationContext.getBean(ref, org.apache.camel.component.jpa.TransactionStrategy.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.jpa");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-jq-starter/src/main/java/org/apache/camel/language/jq/springboot/JqLanguageAutoConfiguration.java b/components-starter/camel-jq-starter/src/main/java/org/apache/camel/language/jq/springboot/JqLanguageAutoConfiguration.java
index c5962a7a3ab..65e60069603 100644
--- a/components-starter/camel-jq-starter/src/main/java/org/apache/camel/language/jq/springboot/JqLanguageAutoConfiguration.java
+++ b/components-starter/camel-jq-starter/src/main/java/org/apache/camel/language/jq/springboot/JqLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class JqLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.jq", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-jsch-starter/src/main/java/org/apache/camel/component/scp/springboot/ScpComponentAutoConfiguration.java b/components-starter/camel-jsch-starter/src/main/java/org/apache/camel/component/scp/springboot/ScpComponentAutoConfiguration.java
index f7b2602b627..9bf8ce1051b 100644
--- a/components-starter/camel-jsch-starter/src/main/java/org/apache/camel/component/scp/springboot/ScpComponentAutoConfiguration.java
+++ b/components-starter/camel-jsch-starter/src/main/java/org/apache/camel/component/scp/springboot/ScpComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class ScpComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.scp", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-jslt-starter/src/main/java/org/apache/camel/component/jslt/springboot/JsltComponentAutoConfiguration.java b/components-starter/camel-jslt-starter/src/main/java/org/apache/camel/component/jslt/springboot/JsltComponentAutoConfiguration.java
index 374d4663853..95c6de2988f 100644
--- a/components-starter/camel-jslt-starter/src/main/java/org/apache/camel/component/jslt/springboot/JsltComponentAutoConfiguration.java
+++ b/components-starter/camel-jslt-starter/src/main/java/org/apache/camel/component/jslt/springboot/JsltComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class JsltComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.jslt", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-jslt-starter/src/main/java/org/apache/camel/component/jslt/springboot/JsltComponentConverter.java b/components-starter/camel-jslt-starter/src/main/java/org/apache/camel/component/jslt/springboot/JsltComponentConverter.java
index 005539e3b8f..da31a681329 100644
--- a/components-starter/camel-jslt-starter/src/main/java/org/apache/camel/component/jslt/springboot/JsltComponentConverter.java
+++ b/components-starter/camel-jslt-starter/src/main/java/org/apache/camel/component/jslt/springboot/JsltComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.jslt.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class JsltComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.schibsted.spt.data.jslt.filters.JsonFilter": return applicationContext.getBean(ref, com.schibsted.spt.data.jslt.filters.JsonFilter.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.jslt");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-json-validator-starter/src/main/java/org/apache/camel/component/jsonvalidator/springboot/JsonValidatorComponentAutoConfiguration.java b/components-starter/camel-json-validator-starter/src/main/java/org/apache/camel/component/jsonvalidator/springboot/JsonValidatorComponentAutoConfiguration.java
index e7d5d69645c..ed58dffffe1 100644
--- a/components-starter/camel-json-validator-starter/src/main/java/org/apache/camel/component/jsonvalidator/springboot/JsonValidatorComponentAutoConfiguration.java
+++ b/components-starter/camel-json-validator-starter/src/main/java/org/apache/camel/component/jsonvalidator/springboot/JsonValidatorComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class JsonValidatorComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.json-validator", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-jsonapi-starter/src/main/java/org/apache/camel/component/jsonapi/springboot/JsonApiDataFormatAutoConfiguration.java b/components-starter/camel-jsonapi-starter/src/main/java/org/apache/camel/component/jsonapi/springboot/JsonApiDataFormatAutoConfiguration.java
index 8b0a0ed7d08..f684096acc2 100644
--- a/components-starter/camel-jsonapi-starter/src/main/java/org/apache/camel/component/jsonapi/springboot/JsonApiDataFormatAutoConfiguration.java
+++ b/components-starter/camel-jsonapi-starter/src/main/java/org/apache/camel/component/jsonapi/springboot/JsonApiDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class JsonApiDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.json-api", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-jsonata-starter/src/main/java/org/apache/camel/component/jsonata/springboot/JsonataComponentAutoConfiguration.java b/components-starter/camel-jsonata-starter/src/main/java/org/apache/camel/component/jsonata/springboot/JsonataComponentAutoConfiguration.java
index b5068f16486..e63a94f2cee 100644
--- a/components-starter/camel-jsonata-starter/src/main/java/org/apache/camel/component/jsonata/springboot/JsonataComponentAutoConfiguration.java
+++ b/components-starter/camel-jsonata-starter/src/main/java/org/apache/camel/component/jsonata/springboot/JsonataComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class JsonataComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.jsonata", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-jsonata-starter/src/main/java/org/apache/camel/component/jsonata/springboot/JsonataComponentConverter.java b/components-starter/camel-jsonata-starter/src/main/java/org/apache/camel/component/jsonata/springboot/JsonataComponentConverter.java
index 7c47e81177e..092e5f77c2d 100644
--- a/components-starter/camel-jsonata-starter/src/main/java/org/apache/camel/component/jsonata/springboot/JsonataComponentConverter.java
+++ b/components-starter/camel-jsonata-starter/src/main/java/org/apache/camel/component/jsonata/springboot/JsonataComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.jsonata.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class JsonataComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.jsonata.JsonataFrameBinding": return applicationContext.getBean(ref, org.apache.camel.component.jsonata.JsonataFrameBinding.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.jsonata");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-jsonb-starter/src/main/java/org/apache/camel/component/jsonb/springboot/JsonbDataFormatAutoConfiguration.java b/components-starter/camel-jsonb-starter/src/main/java/org/apache/camel/component/jsonb/springboot/JsonbDataFormatAutoConfiguration.java
index 622f997eecb..0b7d0636777 100644
--- a/components-starter/camel-jsonb-starter/src/main/java/org/apache/camel/component/jsonb/springboot/JsonbDataFormatAutoConfiguration.java
+++ b/components-starter/camel-jsonb-starter/src/main/java/org/apache/camel/component/jsonb/springboot/JsonbDataFormatAutoConfiguration.java
@@ -63,7 +63,8 @@ public class JsonbDataFormatAutoConfiguration {
return new DataFormatCustomizer() {
@Override
public void configure(String name, DataFormat target) {
- CamelPropertiesHelper.copyProperties(camelContextProvider.getObject(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(camelContextProvider.getObject(), applicationContext,
+ "camel.dataformat.jsonb", configuration, target);
}
@Override
public boolean isEnabled(String name, DataFormat target) {
diff --git a/components-starter/camel-jsonpath-starter/src/main/java/org/apache/camel/jsonpath/springboot/JsonPathLanguageAutoConfiguration.java b/components-starter/camel-jsonpath-starter/src/main/java/org/apache/camel/jsonpath/springboot/JsonPathLanguageAutoConfiguration.java
index cb52748add8..22eaa580dc0 100644
--- a/components-starter/camel-jsonpath-starter/src/main/java/org/apache/camel/jsonpath/springboot/JsonPathLanguageAutoConfiguration.java
+++ b/components-starter/camel-jsonpath-starter/src/main/java/org/apache/camel/jsonpath/springboot/JsonPathLanguageAutoConfiguration.java
@@ -61,7 +61,8 @@ public class JsonPathLanguageAutoConfiguration {
@Override
public void configure(String name, Language target) {
if (target instanceof CamelContextAware cca && cca.getCamelContext() != null) {
- CamelPropertiesHelper.copyProperties(cca.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(cca.getCamelContext(), applicationContext,
+ "camel.language.jsonpath", configuration, target);
} else {
org.slf4j.LoggerFactory.getLogger(getClass()).debug("Language {} does not implement CamelContextAware, skipping auto-configuration properties", name);
}
diff --git a/components-starter/camel-jt400-starter/src/main/java/org/apache/camel/component/jt400/springboot/Jt400ComponentAutoConfiguration.java b/components-starter/camel-jt400-starter/src/main/java/org/apache/camel/component/jt400/springboot/Jt400ComponentAutoConfiguration.java
index faf8f5d5a4c..00bf6989648 100644
--- a/components-starter/camel-jt400-starter/src/main/java/org/apache/camel/component/jt400/springboot/Jt400ComponentAutoConfiguration.java
+++ b/components-starter/camel-jt400-starter/src/main/java/org/apache/camel/component/jt400/springboot/Jt400ComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class Jt400ComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.jt400", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-jt400-starter/src/main/java/org/apache/camel/component/jt400/springboot/Jt400ComponentConverter.java b/components-starter/camel-jt400-starter/src/main/java/org/apache/camel/component/jt400/springboot/Jt400ComponentConverter.java
index aec1a6c6ff6..3fe3bcab415 100644
--- a/components-starter/camel-jt400-starter/src/main/java/org/apache/camel/component/jt400/springboot/Jt400ComponentConverter.java
+++ b/components-starter/camel-jt400-starter/src/main/java/org/apache/camel/component/jt400/springboot/Jt400ComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.jt400.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class Jt400ComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "com.ibm.as400.access.AS400ConnectionPool": return applicationContext.getBean(ref, com.ibm.as400.access.AS400ConnectionPool.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.jt400");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-jte-starter/src/main/java/org/apache/camel/component/jte/springboot/JteComponentAutoConfiguration.java b/components-starter/camel-jte-starter/src/main/java/org/apache/camel/component/jte/springboot/JteComponentAutoConfiguration.java
index da9c8fad22c..c2feb8586b5 100644
--- a/components-starter/camel-jte-starter/src/main/java/org/apache/camel/component/jte/springboot/JteComponentAutoConfiguration.java
+++ b/components-starter/camel-jte-starter/src/main/java/org/apache/camel/component/jte/springboot/JteComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class JteComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.jte", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-kafka-starter/src/main/java/org/apache/camel/component/kafka/springboot/KafkaComponentAutoConfiguration.java b/components-starter/camel-kafka-starter/src/main/java/org/apache/camel/component/kafka/springboot/KafkaComponentAutoConfiguration.java
index be97069f6f2..3cc0b17e2d1 100644
--- a/components-starter/camel-kafka-starter/src/main/java/org/apache/camel/component/kafka/springboot/KafkaComponentAutoConfiguration.java
+++ b/components-starter/camel-kafka-starter/src/main/java/org/apache/camel/component/kafka/springboot/KafkaComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class KafkaComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.kafka", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-kafka-starter/src/main/java/org/apache/camel/component/kafka/springboot/KafkaComponentConverter.java b/components-starter/camel-kafka-starter/src/main/java/org/apache/camel/component/kafka/springboot/KafkaComponentConverter.java
index 9184b75c75c..713a61a2046 100644
--- a/components-starter/camel-kafka-starter/src/main/java/org/apache/camel/component/kafka/springboot/KafkaComponentConverter.java
+++ b/components-starter/camel-kafka-starter/src/main/java/org/apache/camel/component/kafka/springboot/KafkaComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.kafka.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -56,26 +57,6 @@ public class KafkaComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.kafka.KafkaConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.kafka.KafkaConfiguration.class);
- case "org.apache.camel.spi.HeaderFilterStrategy": return applicationContext.getBean(ref, org.apache.camel.spi.HeaderFilterStrategy.class);
- case "org.apache.camel.component.kafka.serde.KafkaHeaderDeserializer": return applicationContext.getBean(ref, org.apache.camel.component.kafka.serde.KafkaHeaderDeserializer.class);
- case "org.apache.camel.spi.StateRepository": return applicationContext.getBean(ref, org.apache.camel.spi.StateRepository.class);
- case "org.apache.camel.component.kafka.consumer.KafkaManualCommitFactory": return applicationContext.getBean(ref, org.apache.camel.component.kafka.consumer.KafkaManualCommitFactory.class);
- case "org.apache.camel.component.kafka.PollExceptionStrategy": return applicationContext.getBean(ref, org.apache.camel.component.kafka.PollExceptionStrategy.class);
- case "org.apache.camel.component.kafka.serde.KafkaHeaderSerializer": return applicationContext.getBean(ref, org.apache.camel.component.kafka.serde.KafkaHeaderSerializer.class);
- case "java.util.concurrent.ExecutorService": return applicationContext.getBean(ref, java.util.concurrent.ExecutorService.class);
- case "org.apache.camel.component.kafka.KafkaClientFactory": return applicationContext.getBean(ref, org.apache.camel.component.kafka.KafkaClientFactory.class);
- case "org.apache.camel.support.jsse.SSLContextParameters": return applicationContext.getBean(ref, org.apache.camel.support.jsse.SSLContextParameters.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.kafka");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-kamelet-starter/src/main/java/org/apache/camel/component/kamelet/springboot/KameletComponentAutoConfiguration.java b/components-starter/camel-kamelet-starter/src/main/java/org/apache/camel/component/kamelet/springboot/KameletComponentAutoConfiguration.java
index 28162916e21..ef0060a082a 100644
--- a/components-starter/camel-kamelet-starter/src/main/java/org/apache/camel/component/kamelet/springboot/KameletComponentAutoConfiguration.java
+++ b/components-starter/camel-kamelet-starter/src/main/java/org/apache/camel/component/kamelet/springboot/KameletComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class KameletComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.kamelet", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-kamelet-starter/src/main/java/org/apache/camel/component/kamelet/springboot/KameletComponentConverter.java b/components-starter/camel-kamelet-starter/src/main/java/org/apache/camel/component/kamelet/springboot/KameletComponentConverter.java
index 134aa94739c..37c1bb41476 100644
--- a/components-starter/camel-kamelet-starter/src/main/java/org/apache/camel/component/kamelet/springboot/KameletComponentConverter.java
+++ b/components-starter/camel-kamelet-starter/src/main/java/org/apache/camel/component/kamelet/springboot/KameletComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.kamelet.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -47,17 +48,6 @@ public class KameletComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.spi.RouteTemplateLoaderListener": return applicationContext.getBean(ref, org.apache.camel.spi.RouteTemplateLoaderListener.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.kamelet");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-keycloak-starter/src/main/java/org/apache/camel/component/keycloak/springboot/KeycloakComponentAutoConfiguration.java b/components-starter/camel-keycloak-starter/src/main/java/org/apache/camel/component/keycloak/springboot/KeycloakComponentAutoConfiguration.java
index 2211d739cf8..5d426b5e416 100644
--- a/components-starter/camel-keycloak-starter/src/main/java/org/apache/camel/component/keycloak/springboot/KeycloakComponentAutoConfiguration.java
+++ b/components-starter/camel-keycloak-starter/src/main/java/org/apache/camel/component/keycloak/springboot/KeycloakComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class KeycloakComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.keycloak", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-keycloak-starter/src/main/java/org/apache/camel/component/keycloak/springboot/KeycloakComponentConverter.java b/components-starter/camel-keycloak-starter/src/main/java/org/apache/camel/component/keycloak/springboot/KeycloakComponentConverter.java
index 548498c4b4d..91d8b22e2b4 100644
--- a/components-starter/camel-keycloak-starter/src/main/java/org/apache/camel/component/keycloak/springboot/KeycloakComponentConverter.java
+++ b/components-starter/camel-keycloak-starter/src/main/java/org/apache/camel/component/keycloak/springboot/KeycloakComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.keycloak.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class KeycloakComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.keycloak.KeycloakConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.keycloak.KeycloakConfiguration.class);
- case "org.keycloak.admin.client.Keycloak": return applicationContext.getBean(ref, org.keycloak.admin.client.Keycloak.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.keycloak");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-knative-starter/src/main/java/org/apache/camel/component/knative/springboot/KnativeComponentAutoConfiguration.java b/components-starter/camel-knative-starter/src/main/java/org/apache/camel/component/knative/springboot/KnativeComponentAutoConfiguration.java
index 8cd72669ee9..61953751deb 100644
--- a/components-starter/camel-knative-starter/src/main/java/org/apache/camel/component/knative/springboot/KnativeComponentAutoConfiguration.java
+++ b/components-starter/camel-knative-starter/src/main/java/org/apache/camel/component/knative/springboot/KnativeComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class KnativeComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.knative", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-knative-starter/src/main/java/org/apache/camel/component/knative/springboot/KnativeComponentConverter.java b/components-starter/camel-knative-starter/src/main/java/org/apache/camel/component/knative/springboot/KnativeComponentConverter.java
index 268570ec104..d12c00b2333 100644
--- a/components-starter/camel-knative-starter/src/main/java/org/apache/camel/component/knative/springboot/KnativeComponentConverter.java
+++ b/components-starter/camel-knative-starter/src/main/java/org/apache/camel/component/knative/springboot/KnativeComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.knative.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -51,21 +52,6 @@ public class KnativeComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.knative.KnativeConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.knative.KnativeConfiguration.class);
- case "org.apache.camel.component.knative.spi.KnativeConsumerFactory": return applicationContext.getBean(ref, org.apache.camel.component.knative.spi.KnativeConsumerFactory.class);
- case "org.apache.camel.component.knative.spi.KnativeEnvironment": return applicationContext.getBean(ref, org.apache.camel.component.knative.spi.KnativeEnvironment.class);
- case "org.apache.camel.component.knative.spi.KnativeProducerFactory": return applicationContext.getBean(ref, org.apache.camel.component.knative.spi.KnativeProducerFactory.class);
- case "org.apache.camel.component.knative.spi.KnativeSinkBinding": return applicationContext.getBean(ref, org.apache.camel.component.knative.spi.KnativeSinkBinding.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.knative");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-kserve-starter/src/main/java/org/apache/camel/component/kserve/springboot/KServeComponentAutoConfiguration.java b/components-starter/camel-kserve-starter/src/main/java/org/apache/camel/component/kserve/springboot/KServeComponentAutoConfiguration.java
index 6414cf70274..074083504b1 100644
--- a/components-starter/camel-kserve-starter/src/main/java/org/apache/camel/component/kserve/springboot/KServeComponentAutoConfiguration.java
+++ b/components-starter/camel-kserve-starter/src/main/java/org/apache/camel/component/kserve/springboot/KServeComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class KServeComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.kserve", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-kserve-starter/src/main/java/org/apache/camel/component/kserve/springboot/KServeComponentConverter.java b/components-starter/camel-kserve-starter/src/main/java/org/apache/camel/component/kserve/springboot/KServeComponentConverter.java
index 2f3fc74235d..779dd2e910d 100644
--- a/components-starter/camel-kserve-starter/src/main/java/org/apache/camel/component/kserve/springboot/KServeComponentConverter.java
+++ b/components-starter/camel-kserve-starter/src/main/java/org/apache/camel/component/kserve/springboot/KServeComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.kserve.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -48,18 +49,6 @@ public class KServeComponentConverter implements GenericConverter {
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "org.apache.camel.component.kserve.KServeConfiguration": return applicationContext.getBean(ref, org.apache.camel.component.kserve.KServeConfiguration.class);
- case "io.grpc.ChannelCredentials": return applicationContext.getBean(ref, io.grpc.ChannelCredentials.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.kserve");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/config_maps/springboot/KubernetesConfigMapsComponentAutoConfiguration.java b/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/config_maps/springboot/KubernetesConfigMapsComponentAutoConfiguration.java
index dc1378ff73a..8187124fbf3 100644
--- a/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/config_maps/springboot/KubernetesConfigMapsComponentAutoConfiguration.java
+++ b/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/config_maps/springboot/KubernetesConfigMapsComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class KubernetesConfigMapsComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.kubernetes-config-maps", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
diff --git a/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/config_maps/springboot/KubernetesConfigMapsComponentConverter.java b/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/config_maps/springboot/KubernetesConfigMapsComponentConverter.java
index 62793d49b8f..33641afc947 100644
--- a/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/config_maps/springboot/KubernetesConfigMapsComponentConverter.java
+++ b/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/config_maps/springboot/KubernetesConfigMapsComponentConverter.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.kubernetes.config_maps.springboot;
import java.util.LinkedHashSet;
import java.util.Set;
+import org.apache.camel.spring.boot.util.BeanReferenceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationPropertiesBinding;
import org.springframework.context.ApplicationContext;
@@ -49,17 +50,6 @@ public class KubernetesConfigMapsComponentConverter
Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) {
- if (source == null) {
- return null;
- }
- String ref = source.toString();
- if (!ref.startsWith("#")) {
- return null;
- }
- ref = ref.startsWith("#bean:") ? ref.substring(6) : ref.substring(1);
- switch (targetType.getName()) {
- case "io.fabric8.kubernetes.client.KubernetesClient": return applicationContext.getBean(ref, io.fabric8.kubernetes.client.KubernetesClient.class);
- }
- return null;
+ return BeanReferenceHelper.resolveBeanReference(applicationContext, source, targetType, "camel.component.kubernetes-config-maps");
}
}
\ No newline at end of file
diff --git a/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/cronjob/springboot/KubernetesCronJobComponentAutoConfiguration.java b/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/cronjob/springboot/KubernetesCronJobComponentAutoConfiguration.java
index 029be59f0cf..20bcbea9ef1 100644
--- a/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/cronjob/springboot/KubernetesCronJobComponentAutoConfiguration.java
+++ b/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/cronjob/springboot/KubernetesCronJobComponentAutoConfiguration.java
@@ -58,7 +58,8 @@ public class KubernetesCronJobComponentAutoConfiguration {
return new ComponentCustomizer() {
@Override
public void configure(String name, Component target) {
- CamelPropertiesHelper.copyProperties(target.getCamelContext(), configuration, target);
+ CamelPropertiesHelper.copyConfigurationProperties(target.getCamelContext(), applicationContext,
+ "camel.component.kubernetes-cronjob", configuration, target);
}
@Override
public boolean isEnabled(String name, Component target) {
... 8155 lines suppressed ...