You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2009/04/15 07:24:31 UTC

[jira] Created: (CAMEL-1533) Exchange interface - only one method to easier impl as anonymous or in languages with closures such as Groovy

Exchange interface - only one method to easier impl as anonymous or in languages with closures such as Groovy
-------------------------------------------------------------------------------------------------------------

                 Key: CAMEL-1533
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1533
             Project: Apache Camel
          Issue Type: Improvement
          Components: camel-core
    Affects Versions: 2.0-M1
            Reporter: Claus Ibsen


We should consider refactor the Exchange interface to only include one method.

Currently it has the following two methods
{code}
    /**
     * Returns the value of the expression on the given exchange
     *
     * @param exchange the message exchange on which to evaluate the expression
     * @return the value of the expression
     */
    Object evaluate(Exchange exchange);

    /**
     * Returns the value of the expression on the given exchange
     *
     * @param exchange the message exchange on which to evaluate the expression
     * @param type the expected type of the evaluation result
     * @return the value of the expression
     */
    <T> T evaluate(Exchange exchange, Class<T> type);
{code}

I suggest to keep only the last method, the one with the type parameter. You can always pass in Object.class if you dont care/know the type.

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


[jira] Resolved: (CAMEL-1533) Exchange interface - only one method to easier impl as anonymous or in languages with closures such as Groovy

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

Claus Ibsen resolved CAMEL-1533.
--------------------------------

    Resolution: Fixed

trunk: 766032

> Exchange interface - only one method to easier impl as anonymous or in languages with closures such as Groovy
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1533
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1533
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0-M1
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.0.0
>
>
> We should consider refactor the Exchange interface to only include one method.
> Currently it has the following two methods
> {code}
>     /**
>      * Returns the value of the expression on the given exchange
>      *
>      * @param exchange the message exchange on which to evaluate the expression
>      * @return the value of the expression
>      */
>     Object evaluate(Exchange exchange);
>     /**
>      * Returns the value of the expression on the given exchange
>      *
>      * @param exchange the message exchange on which to evaluate the expression
>      * @param type the expected type of the evaluation result
>      * @return the value of the expression
>      */
>     <T> T evaluate(Exchange exchange, Class<T> type);
> {code}
> I suggest to keep only the last method, the one with the type parameter. You can always pass in Object.class if you dont care/know the type.

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


[jira] Updated: (CAMEL-1533) Exchange interface - only one method to easier impl as anonymous or in languages with closures such as Groovy

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

Claus Ibsen updated CAMEL-1533:
-------------------------------

    Fix Version/s: 2.0.0

[11:38]  <jstrachan> yeah - lets go with the latter
[11:38]  <jstrachan> an impl can always ignore the type
[11:38]  <cibsen> yeah and you can pass in Object.class if you dont know/care
[11:38]  <jstrachan> yeah
[11:38]  <cibsen> finno



> Exchange interface - only one method to easier impl as anonymous or in languages with closures such as Groovy
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1533
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1533
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0-M1
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.0.0
>
>
> We should consider refactor the Exchange interface to only include one method.
> Currently it has the following two methods
> {code}
>     /**
>      * Returns the value of the expression on the given exchange
>      *
>      * @param exchange the message exchange on which to evaluate the expression
>      * @return the value of the expression
>      */
>     Object evaluate(Exchange exchange);
>     /**
>      * Returns the value of the expression on the given exchange
>      *
>      * @param exchange the message exchange on which to evaluate the expression
>      * @param type the expected type of the evaluation result
>      * @return the value of the expression
>      */
>     <T> T evaluate(Exchange exchange, Class<T> type);
> {code}
> I suggest to keep only the last method, the one with the type parameter. You can always pass in Object.class if you dont care/know the type.

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


[jira] Assigned: (CAMEL-1533) Exchange interface - only one method to easier impl as anonymous or in languages with closures such as Groovy

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

Claus Ibsen reassigned CAMEL-1533:
----------------------------------

    Assignee: Claus Ibsen

> Exchange interface - only one method to easier impl as anonymous or in languages with closures such as Groovy
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1533
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1533
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0-M1
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.0.0
>
>
> We should consider refactor the Exchange interface to only include one method.
> Currently it has the following two methods
> {code}
>     /**
>      * Returns the value of the expression on the given exchange
>      *
>      * @param exchange the message exchange on which to evaluate the expression
>      * @return the value of the expression
>      */
>     Object evaluate(Exchange exchange);
>     /**
>      * Returns the value of the expression on the given exchange
>      *
>      * @param exchange the message exchange on which to evaluate the expression
>      * @param type the expected type of the evaluation result
>      * @return the value of the expression
>      */
>     <T> T evaluate(Exchange exchange, Class<T> type);
> {code}
> I suggest to keep only the last method, the one with the type parameter. You can always pass in Object.class if you dont care/know the type.

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