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 2012/04/22 12:12:43 UTC

[jira] [Assigned] (CAMEL-5171) Favor static methods for type converters provided by Camel components

     [ https://issues.apache.org/jira/browse/CAMEL-5171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-5171:
----------------------------------

    Assignee: Claus Ibsen
    
> Favor static methods for type converters provided by Camel components
> ---------------------------------------------------------------------
>
>                 Key: CAMEL-5171
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5171
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: Future
>
>
> We should favor static classes if possible for Camel type converters when discovered and using @Converter. This allow to use a static method call, instead of having to create a new instance of the class, to invoke the converter method, for *every* type converstion.
> In most cases a type conversion class do not need to store state, and thus it can be static method calls.
> An alternative is to allow a new attribute on @Converter at the class level, where you can define if its thread safe or not.
> {code}
> @Converter(threadSafe = true)
> public class MyComponentConverters
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira