camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] [Commented] (CAMEL-4233) avoid runtime package scanning to discover TypeConverters
Date Fri, 15 Jul 2011 15:53:02 GMT


Claus Ibsen commented on CAMEL-4233:

Got it all up and running. Will do a full test before committing.

> avoid runtime package scanning to discover TypeConverters
> ---------------------------------------------------------
>                 Key: CAMEL-4233
>                 URL:
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.7.0
>            Reporter: james strachan
>            Assignee: Claus Ibsen
>             Fix For: 2.8.0
> Package scanning to discover classes annotated with @Converter is slow. Plus on many
containers (especially commercial JEE containers) its not even possible; since ClassLoader.getResource()
doesn't often return file system based URIs you can easily convert to a so you
can list files in a directory.
> Finding known resources/classes in class loaders generally works; scanning packages is
generally more problematic - as well as being slow.
> So it would be better if Camel could use a text file per jar containing all the fully
qualified class names of the converters to use. Then no package scanning is required. Or rather
we only need to use package scanning if a text file contains packages (rather than fully qualified
classes). i.e. do the package scanning at build time (when you have full access to the file
system :) rather than at runtime when you generally don't have access to the files - and expanding
jars to look inside them is awfully slow.
> In addition it'd be great if we added a maven plugin - or Java compiler AnnotationProcessor
we can use with the compile step - to generate the META-INF/services/org/apache/camel/TypeConverter
file automatically as part of the build. Then users don't even have to think about it; they
just add @Converter to a class and the plugin generates the text file as part of the build.,
using fully qualified class names - so no package scanning required at runtime - and much
faster startup times too

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message