camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAMEL-3515) Add documentation for the new type option on bean component
Date Sun, 09 Jan 2011 11:27:45 GMT

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

Claus Ibsen commented on CAMEL-3515:
------------------------------------

Wonder if the new option should be named {{parameterType}} or {{methodType}} or something
like that to make it more clear what it does.

We also have a {{beanType}} option which is used to just refer to the type of the bean to
invoked, so you dont have to refer to a particular instance of the bean.
So we may have a confusing / clash if we have 2 type options.

> Add documentation for the new type option on bean component
> -----------------------------------------------------------
>
>                 Key: CAMEL-3515
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3515
>             Project: Camel
>          Issue Type: Sub-task
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Christian Müller
>            Priority: Minor
>             Fix For: 2.6.0
>
>
> We need this new feature documented
> http://camel.apache.org/bean
> And we need this option on the these
> - MethodCallExpression
> - BeanExpression
> And we need unit tests which uses the method call expression in
> - camel-core
> - camel-spring
> Also the String -> Class converter should use the ClassResolver API from CamelContext.
This ensure it runs in OSGi, JBoss, J2EE etc.
> What you do is just add Exchange as the 2nd parameter and Camel provides it to you
> {code}
>     /**
>      * Returns the converted value, or null if the value is null
>      */
>     @SuppressWarnings("rawtypes")
>     @Converter
>     public static Class toClass(Object value, Exchange exchange) {
>         if (value instanceof Class) {
>             return (Class) value;
>         } else if (value instanceof String) {
>             // prefer to use class resolver API
>             if (exchange != null) {
>                 return exchange.getContext().getClassResolver().resolveClass((String)
value);
>             } else {
>                 return ObjectHelper.loadClass((String) value);
>             }
>         } else {
>             return null;
>         }
>     }
> {code}

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


Mime
View raw message