[
https://issues.apache.org/jira/browse/CAMEL-12608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16529814#comment-16529814
]
Roland Huss commented on CAMEL-12608:
-------------------------------------
[~zregvart] do you have a specific use case in mind ? I can see that
RouteBuilder.checkInitialized() a potential error handler is copied over from
the camel context before `configure()` is called. This part may be missing when
building up the routes via object initialization. But otherwise I don't think
it make any difference whether the routes are build up in the inializer or in
{{configure()}}.
Not sure what you meant with _but it would lock us out of proscribing that
lifecycle_ though.
> Add default no-op implementation of RouteBuilder
> ------------------------------------------------
>
> Key: CAMEL-12608
> URL: https://issues.apache.org/jira/browse/CAMEL-12608
> Project: Camel
> Issue Type: New Feature
> Components: camel-core
> Reporter: Roland Huss
> Priority: Major
>
> Inspired by JMockit which use object initializers for introducing their Java
> DSL, I think it would be a good idea to add a no-op default implementation of
> RouteBuilder, with a short name like 'Routes'.
> {code:java}
> ctx.add(new Routes {{
> from("file:data/inbox?noop=true")
> .to("file:data/outbox");
> }});
> {code}
> That way one can avoid the creation of anonymous inner classes, which is not
> only shorted and less boilerplate but also creates less classes and saves
> non-heap memory.
>
> A simple POC as submitted as PR at
> [https://github.com/apache/camel/pull/2401] which could be extended to
> include better unit testing and documentation.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)