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] [Resolved] (CAMEL-3994) Java DSL - New means to explicitly end try/catch blocks
Date Mon, 06 Jun 2011 17:22:59 GMT

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

Claus Ibsen resolved CAMEL-3994.
--------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 2.9.0)

Added endDoTry to Java DSL.

We hit the limit how far we can take a DSL with fluent builders and generic in pure Java,
so we have those corner cases where we gotta help the compiler with the endXXX methods.

> Java DSL - New means to explicitly end try/catch blocks
> -------------------------------------------------------
>
>                 Key: CAMEL-3994
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3994
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.6.0
>            Reporter: Alfred Hiebl
>            Assignee: Claus Ibsen
>             Fix For: 2.8.0
>
>
> We are facing a problem with split() in combination with doTry/doCatch().
> Could you add a method "endDoTry()" to the ProcessorDefinition? My use case is this:
> {code}
>   @Override
>   public void configure() throws Exception {
>         from("timer://myTimer?period=10000)
>                 .log("begin")
>                 .setBody(constant("x,y,z"))
>                 .doTry()
>                         .log("processing")
>                         .split(body())
>                                 .log("split")
>                         .end()
>                 .endDoTry()  // would need some way like this to get back to the TryDefinition
>                 .doCatch(Exception.class)
>                         .log("Exception")
>                 .end();
>   }
> {code}
> I tested this by adding endDoTry() to the ProcessorDefinition, and it works just fine.
> {code}
>   public TryDefinition endDoTry() {
>        return (TryDefinition) this;
>   }
> {code}
> An endDoCatch in the TryDefinition would be great too. Is it possible that these endXXX()
methods get added to 2.6.0, not just 2.7.0 or trunk?
> See also: http://camel.465427.n5.nabble.com/Route-with-choice-and-split-td4375184.html


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message