[jira] Created: (CAMEL-990) TypeConverter support with @Converter meta-annotation and not only @Converter

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (CAMEL-990) TypeConverter support with @Converter meta-annotation and not only @Converter

JIRA jira@apache.org
TypeConverter support with @Converter meta-annotation and not only @Converter
-----------------------------------------------------------------------------

                 Key: CAMEL-990
                 URL: https://issues.apache.org/activemq/browse/CAMEL-990
             Project: Apache Camel
          Issue Type: Improvement
          Components: camel-core
    Affects Versions: 1.4.0
            Reporter: Seb Auvray
             Fix For: 1.5.0, 2.0.0, Future
         Attachments: typeconverter-meta-annotation-support.patch

Today TypeConverter detection is based on org.apache.camel.@Converter annotation.
Allow user to override this by using meta-annotation. This can be useful to hide camel dependencies, when extending the framework.

ie, this can be done:

package some.package.of.mine;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD })
@org.apache.camel.Converter
public @interface OwnConverterAnnotation {
}

import some.package.of.mine.OwnConverterAnnotation;

@OwnConverterAnnotation
public class FileToXXXConverter {

    @OwnConverterAnnotation
    public static XXX toWorkflowEntry(File file) throws IOException {
        return new XXX();            
    }

}

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-990) TypeConverter support with @Converter meta-annotation and not only @Converter

JIRA jira@apache.org

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

Seb Auvray updated CAMEL-990:
-----------------------------

    Attachment: typeconverter-meta-annotation-support.patch

Patch With License

> TypeConverter support with @Converter meta-annotation and not only @Converter
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-990
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-990
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Seb Auvray
>             Fix For: 1.5.0, 2.0.0, Future
>
>         Attachments: typeconverter-meta-annotation-support.patch
>
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> Today TypeConverter detection is based on org.apache.camel.@Converter annotation.
> Allow user to override this by using meta-annotation. This can be useful to hide camel dependencies, when extending the framework.
> ie, this can be done:
> package some.package.of.mine;
> @Retention(RetentionPolicy.RUNTIME)
> @Target({ElementType.TYPE, ElementType.METHOD })
> @org.apache.camel.Converter
> public @interface OwnConverterAnnotation {
> }
> import some.package.of.mine.OwnConverterAnnotation;
> @OwnConverterAnnotation
> public class FileToXXXConverter {
>     @OwnConverterAnnotation
>     public static XXX toWorkflowEntry(File file) throws IOException {
>         return new XXX();            
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-990) TypeConverter support with @Converter meta-annotation and not only @Converter

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Seb Auvray updated CAMEL-990:
-----------------------------

    Attachment:     (was: typeconverter-meta-annotation-support.patch)

> TypeConverter support with @Converter meta-annotation and not only @Converter
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-990
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-990
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Seb Auvray
>             Fix For: 1.5.0, 2.0.0, Future
>
>         Attachments: typeconverter-meta-annotation-support.patch
>
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> Today TypeConverter detection is based on org.apache.camel.@Converter annotation.
> Allow user to override this by using meta-annotation. This can be useful to hide camel dependencies, when extending the framework.
> ie, this can be done:
> package some.package.of.mine;
> @Retention(RetentionPolicy.RUNTIME)
> @Target({ElementType.TYPE, ElementType.METHOD })
> @org.apache.camel.Converter
> public @interface OwnConverterAnnotation {
> }
> import some.package.of.mine.OwnConverterAnnotation;
> @OwnConverterAnnotation
> public class FileToXXXConverter {
>     @OwnConverterAnnotation
>     public static XXX toWorkflowEntry(File file) throws IOException {
>         return new XXX();            
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-990) TypeConverter support with @Converter meta-annotation and not only @Converter

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Claus Ibsen commented on CAMEL-990:
-----------------------------------

We must remember to update the wiki with this new feature (if patch is committed)
http://activemq.apache.org/camel/type-converter.html

Do you mind writing a snippet what such documentation should be? As accepting a patch is only really useable if we also updates and improves the related documentation as well.

However I feel your idea is great. Maybe there should be a camel-annotation.jar that just contains the few annotations needed and with your strategy end-users can use their own annotations and thus imports.

> TypeConverter support with @Converter meta-annotation and not only @Converter
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-990
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-990
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Seb Auvray
>             Fix For: 1.5.0, 2.0.0, Future
>
>         Attachments: typeconverter-meta-annotation-support.patch
>
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> Today TypeConverter detection is based on org.apache.camel.@Converter annotation.
> Allow user to override this by using meta-annotation. This can be useful to hide camel dependencies, when extending the framework.
> ie, this can be done:
> package some.package.of.mine;
> @Retention(RetentionPolicy.RUNTIME)
> @Target({ElementType.TYPE, ElementType.METHOD })
> @org.apache.camel.Converter
> public @interface OwnConverterAnnotation {
> }
> import some.package.of.mine.OwnConverterAnnotation;
> @OwnConverterAnnotation
> public class FileToXXXConverter {
>     @OwnConverterAnnotation
>     public static XXX toWorkflowEntry(File file) throws IOException {
>         return new XXX();            
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-990) TypeConverter support with @Converter meta-annotation and not only @Converter

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Seb Auvray commented on CAMEL-990:
----------------------------------

Claus,
I'll try to write a snippet, and will think about the camel-annotation.jar mechanism you suggest.
Will come back when done.

> TypeConverter support with @Converter meta-annotation and not only @Converter
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-990
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-990
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Seb Auvray
>             Fix For: 1.5.0, 2.0.0, Future
>
>         Attachments: typeconverter-meta-annotation-support.patch
>
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> Today TypeConverter detection is based on org.apache.camel.@Converter annotation.
> Allow user to override this by using meta-annotation. This can be useful to hide camel dependencies, when extending the framework.
> ie, this can be done:
> package some.package.of.mine;
> @Retention(RetentionPolicy.RUNTIME)
> @Target({ElementType.TYPE, ElementType.METHOD })
> @org.apache.camel.Converter
> public @interface OwnConverterAnnotation {
> }
> import some.package.of.mine.OwnConverterAnnotation;
> @OwnConverterAnnotation
> public class FileToXXXConverter {
>     @OwnConverterAnnotation
>     public static XXX toWorkflowEntry(File file) throws IOException {
>         return new XXX();            
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-990) TypeConverter support with @Converter meta-annotation and not only @Converter

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

James Strachan commented on CAMEL-990:
--------------------------------------

BTW - its not really a big deal to use annotations from any particular framework in your code as annotations are a soft dependency.

e.g. adding Camel annotations to your code doesn't add any direct dependency on camel. You can then use your code totally fine without any camel jars on the classpath.

So there's not a huge need to 'hide' dependencies on Camel annotations - as you only need them to compile your source code.

But using indirect annotations can be useful; e.g. you can have a foo.jar which defines a @Foo annotation which builds itself with camel - then folks can just add foo.jar to their classpath to get camel goodness without adding camel jars to the build. So you could introduce a kinda macro annotation that includes various framework annotations on it (say spring and camel and guice annotations :)

> TypeConverter support with @Converter meta-annotation and not only @Converter
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-990
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-990
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Seb Auvray
>             Fix For: 1.5.0, 2.0.0, Future
>
>         Attachments: typeconverter-meta-annotation-support.patch
>
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> Today TypeConverter detection is based on org.apache.camel.@Converter annotation.
> Allow user to override this by using meta-annotation. This can be useful to hide camel dependencies, when extending the framework.
> ie, this can be done:
> package some.package.of.mine;
> @Retention(RetentionPolicy.RUNTIME)
> @Target({ElementType.TYPE, ElementType.METHOD })
> @org.apache.camel.Converter
> public @interface OwnConverterAnnotation {
> }
> import some.package.of.mine.OwnConverterAnnotation;
> @OwnConverterAnnotation
> public class FileToXXXConverter {
>     @OwnConverterAnnotation
>     public static XXX toWorkflowEntry(File file) throws IOException {
>         return new XXX();            
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-990) TypeConverter support with @Converter meta-annotation and not only @Converter

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Seb Auvray commented on CAMEL-990:
----------------------------------

The original need is the following:
Let's say I build a Routing System based on Camel. Of course my System will depend on Camel. But I don't want the end user of my System (who will be responsible for adding routes, converters...) to depend on any camel jar.
Your solution is better (and also more time consuming than my simple metaannotation match :)), will think about it.

> TypeConverter support with @Converter meta-annotation and not only @Converter
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-990
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-990
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Seb Auvray
>             Fix For: 1.5.0, 2.0.0, Future
>
>         Attachments: typeconverter-meta-annotation-support.patch
>
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> Today TypeConverter detection is based on org.apache.camel.@Converter annotation.
> Allow user to override this by using meta-annotation. This can be useful to hide camel dependencies, when extending the framework.
> ie, this can be done:
> package some.package.of.mine;
> @Retention(RetentionPolicy.RUNTIME)
> @Target({ElementType.TYPE, ElementType.METHOD })
> @org.apache.camel.Converter
> public @interface OwnConverterAnnotation {
> }
> import some.package.of.mine.OwnConverterAnnotation;
> @OwnConverterAnnotation
> public class FileToXXXConverter {
>     @OwnConverterAnnotation
>     public static XXX toWorkflowEntry(File file) throws IOException {
>         return new XXX();            
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (CAMEL-990) TypeConverter support with @Converter meta-annotation and not only @Converter

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

sauvray edited comment on CAMEL-990 at 10/21/08 8:40 AM:
------------------------------------------------------------

The original need is the following:
Let's say I build a Routing System based on Camel. Of course my System will depend on Camel. But I don't want the end user of my System (who will be responsible for adding routes, converters...) to depend on any camel jar.
Your solution is better (and also more time consuming than my simple metaannotation patch :)), will think about it.

      was (Author: sauvray):
    The original need is the following:
Let's say I build a Routing System based on Camel. Of course my System will depend on Camel. But I don't want the end user of my System (who will be responsible for adding routes, converters...) to depend on any camel jar.
Your solution is better (and also more time consuming than my simple metaannotation match :)), will think about it.
 

> TypeConverter support with @Converter meta-annotation and not only @Converter
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-990
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-990
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Seb Auvray
>             Fix For: 1.5.0, 2.0.0, Future
>
>         Attachments: typeconverter-meta-annotation-support.patch
>
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> Today TypeConverter detection is based on org.apache.camel.@Converter annotation.
> Allow user to override this by using meta-annotation. This can be useful to hide camel dependencies, when extending the framework.
> ie, this can be done:
> package some.package.of.mine;
> @Retention(RetentionPolicy.RUNTIME)
> @Target({ElementType.TYPE, ElementType.METHOD })
> @org.apache.camel.Converter
> public @interface OwnConverterAnnotation {
> }
> import some.package.of.mine.OwnConverterAnnotation;
> @OwnConverterAnnotation
> public class FileToXXXConverter {
>     @OwnConverterAnnotation
>     public static XXX toWorkflowEntry(File file) throws IOException {
>         return new XXX();            
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-990) TypeConverter support with @Converter meta-annotation and not only @Converter

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Seb Auvray commented on CAMEL-990:
----------------------------------

James, can you give more details on how your solution would work exactly ?

> TypeConverter support with @Converter meta-annotation and not only @Converter
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-990
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-990
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Seb Auvray
>             Fix For: 1.5.0, 2.0.0, Future
>
>         Attachments: typeconverter-meta-annotation-support.patch
>
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> Today TypeConverter detection is based on org.apache.camel.@Converter annotation.
> Allow user to override this by using meta-annotation. This can be useful to hide camel dependencies, when extending the framework.
> ie, this can be done:
> package some.package.of.mine;
> @Retention(RetentionPolicy.RUNTIME)
> @Target({ElementType.TYPE, ElementType.METHOD })
> @org.apache.camel.Converter
> public @interface OwnConverterAnnotation {
> }
> import some.package.of.mine.OwnConverterAnnotation;
> @OwnConverterAnnotation
> public class FileToXXXConverter {
>     @OwnConverterAnnotation
>     public static XXX toWorkflowEntry(File file) throws IOException {
>         return new XXX();            
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-990) TypeConverter support with @Converter meta-annotation and not only @Converter

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Hadrian Zbarcea updated CAMEL-990:
----------------------------------

         Assignee: Hadrian Zbarcea
    Fix Version/s:     (was: 2.0.0)
                       (was: Future)

> TypeConverter support with @Converter meta-annotation and not only @Converter
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-990
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-990
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Seb Auvray
>            Assignee: Hadrian Zbarcea
>             Fix For: 1.5.0
>
>         Attachments: typeconverter-meta-annotation-support.patch
>
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> Today TypeConverter detection is based on org.apache.camel.@Converter annotation.
> Allow user to override this by using meta-annotation. This can be useful to hide camel dependencies, when extending the framework.
> ie, this can be done:
> package some.package.of.mine;
> @Retention(RetentionPolicy.RUNTIME)
> @Target({ElementType.TYPE, ElementType.METHOD })
> @org.apache.camel.Converter
> public @interface OwnConverterAnnotation {
> }
> import some.package.of.mine.OwnConverterAnnotation;
> @OwnConverterAnnotation
> public class FileToXXXConverter {
>     @OwnConverterAnnotation
>     public static XXX toWorkflowEntry(File file) throws IOException {
>         return new XXX();            
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (CAMEL-990) TypeConverter support with @Converter meta-annotation and not only @Converter

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Hadrian Zbarcea resolved CAMEL-990.
-----------------------------------

    Resolution: Fixed

Patch applied with many thanks.  I made a few manual modifications, because the code changed a bit from the version the patch was created against.

> TypeConverter support with @Converter meta-annotation and not only @Converter
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-990
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-990
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Seb Auvray
>            Assignee: Hadrian Zbarcea
>             Fix For: 1.5.0
>
>         Attachments: typeconverter-meta-annotation-support.patch
>
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> Today TypeConverter detection is based on org.apache.camel.@Converter annotation.
> Allow user to override this by using meta-annotation. This can be useful to hide camel dependencies, when extending the framework.
> ie, this can be done:
> package some.package.of.mine;
> @Retention(RetentionPolicy.RUNTIME)
> @Target({ElementType.TYPE, ElementType.METHOD })
> @org.apache.camel.Converter
> public @interface OwnConverterAnnotation {
> }
> import some.package.of.mine.OwnConverterAnnotation;
> @OwnConverterAnnotation
> public class FileToXXXConverter {
>     @OwnConverterAnnotation
>     public static XXX toWorkflowEntry(File file) throws IOException {
>         return new XXX();            
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.