Hi

Yeah thats a pain with Java Programming Language and how far you can
take it with a DSL.

I experimented with a generic end(type) method but of course the
compiler couldn't cope with that.
Fell free to create a JIRA ticket so we wont forget.



On Tue, May 10, 2011 at 9:27 AM, Alfred Hiebl <a.hi...@mic-cust.com> wrote:
> Hi,
>
> I saw that this topic has been discussed several times before and realize
> that the Java has its limitations there. We are facing the same problem with
> split() in combination with doTry/doCatch().
>
> Could you also add a method "endDoTry()" to the ProcessorDefinition? My use
> case is this:
>
>  @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();
>  }
>
> I tested this by adding endDoTry() to the ProcessorDefinition, and it works
> just fine.
>
>  public TryDefinition endDoTry() {
>       return (TryDefinition) this;
>  }
>
> 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?
>
> Best regards,
> Alfred
>
> PS: I added the same post to the camel-dev group, but had some issues with
> Nabble. See
> http://camel.465427.n5.nabble.com/DISCUSS-Java-DSL-caveat-with-the-Content-Based-Router-td3389083.html#a4342886
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Route-with-choice-and-split-tp4375184p4383863.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
CamelOne 2011: http://fusesource.com/camelone2011/
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to