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 (Created) (JIRA)" <ji...@apache.org> on 2012/04/14 10:29:30 UTC

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

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
            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

        

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

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-5171:
-------------------------------

    Fix Version/s: 2.9.3
    
> 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: 2.9.3, 2.10.0
>
>
> 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

        

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

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ 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

        

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

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-5171.
--------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: Future)
                   2.10.0
    
> 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: 2.10.0
>
>
> 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