You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2021/06/11 07:27:00 UTC

[jira] [Commented] (CAMEL-16706) camel-core - FactoryFinder create new instance of implementation class non reflective

    [ https://issues.apache.org/jira/browse/CAMEL-16706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17361487#comment-17361487 ] 

Claus Ibsen commented on CAMEL-16706:
-------------------------------------

Its not only factory finder, its also configurer, components, and whatnot. Basically anything that are in META-INF/services and has a metadata file that refers to a class name. That class is created with default no-arg constructor (reflection). 

We could make a maven plugin goal, that scans the classpath, and create a source code file for all those classes, and creates those via new XXX, and then put that in src/main/generated with a fixed classname, that CamelContext then can use.

However all this magic is also something that camel-quarkus may be better at by its build-time optimizations where some of such things is already done there

> camel-core - FactoryFinder create new instance of implementation class non reflective
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-16706
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16706
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Priority: Major
>             Fix For: 3.12.0
>
>
> We should look at for Camel's FactoryFinder which is used to plugin various things by classpath discovery. However the class is instantiated reflective via Injector.
> We could look at source code generate in src/main/generated java code that creates this class via Java code and new constructor.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)