camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <jstrac...@apache.org>
Subject Re: svn commit: r655755 - /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/CamelConverter.java
Date Tue, 13 May 2008 07:10:30 GMT
Whoops wrong JIRA - this was the one I should have mentioned :
https://issues.apache.org/activemq/browse/CAMEL-267

2008/5/13  <jstrachan@apache.org>:
> Author: jstrachan
>  Date: Tue May 13 00:07:02 2008
>  New Revision: 655755
>
>  URL: http://svn.apache.org/viewvc?rev=655755&view=rev
>  Log:
>  an improvement for https://issues.apache.org/activemq/browse/CAMEL-507
>
>  Modified:
>     activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/CamelConverter.java
>
>  Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/CamelConverter.java
>  URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/CamelConverter.java?rev=655755&r1=655754&r2=655755&view=diff
>  ==============================================================================
>  --- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/CamelConverter.java
(original)
>  +++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/CamelConverter.java
Tue May 13 00:07:02 2008
>  @@ -22,9 +22,11 @@
>   import org.apache.camel.Predicate;
>   import org.apache.camel.Exchange;
>   import org.apache.camel.Message;
>  +import org.apache.camel.Expression;
>
>   /**
>  - * Some useful converters for Camel APIs
>  + * Some useful converters for Camel APIs such as to convert a {@link Predicate} or
{@link Expression}
>  + * to a {@link Processor}
>   *
>   * @version $Revision: 1.1 $
>   */
>  @@ -40,5 +42,18 @@
>                  out.setBody(answer);
>              }
>          };
>  +
>  +    }
>  +
>  +    @Converter
>  +    public Processor toProcessor(final Expression<Exchange> expresion) {
>  +        return new Processor() {
>  +            public void process(Exchange exchange) throws Exception {
>  +                Object answer = expresion.evaluate(exchange);
>  +                Message out = exchange.getOut();
>  +                out.copyFrom(exchange.getIn());
>  +                out.setBody(answer);
>  +            }
>  +        };
>      }
>   }
>
>
>



-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Mime
View raw message