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/05/31 14:39:50 UTC

[jira] Commented: (CAMEL-1660) A lite AOP feature in the DSL

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

Claus Ibsen commented on CAMEL-1660:
------------------------------------

This is a spring XML sample
{code:xml}
    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from uri="direct:start"/>
            <aop afterUri="mock:after">
                <transform><constant>Bye World</constant></transform>
                <to uri="mock:result"/>
            </aop>
        </route>
    </camelContext>
{code}

Any thoughts on the DSL? Could we do it better or more elegant?

> A lite AOP feature in the DSL
> -----------------------------
>
>                 Key: CAMEL-1660
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1660
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.0.0
>
>
> We could use a lite AOP in the DSL, allowing you to easy invoke an endpoint before/after the route.
> {code}
>                 from("direct:start")
>                     .aop().around("mock:before", "mock:after")
>                     .transform(constant("Bye World")).to("mock:result");
> {code}
> In the route above we have defined an AOP *around* where we invoke the before and after endpoints.
> This DSL only supports setting the *before* and *after* as a endpoint URI. 
> We have the following DSL operations
> - before
> - after
> - around
> - afterFinally
> - aroundFinally
> The finally version will invoke the after in a finally block to ensure its always executed even if an exception occurred.

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