No you would need to create a base class, and have the onException in
that base class.
And then extend your base class and call super.configure(). (i.e. OO
inheritence) then you can have it for all your routes.

On Mon, May 13, 2013 at 8:00 PM, kalyan <register.kal...@gmail.com> wrote:
> When a RouteBuilder defines onException in the following way, is it available
> for all RouteBuilders of the same CamelContext ?
>
> RouteBuilder routeBuilder = new RouteBuilder()
> {
>         @Override
>         public void configure()
>         {
>
> onException(HttpOperationFailedException.class).handled(true)
>         .process(new Processor()
>         {
>             @Override
>             public void process(Exchange exchange)
>                 throws Exception
>             {
>                 //blah
>             }
>         }).transform().constant("There was an exception");
>
>                 from("servlet:///test?matchOnUriPrefix=true")
>         .to("http://localhost:8080/mywar/sample?bridgeEndpoint=true";);
>         }
> };
>
> However, I would like to know if:
> - There is a way to handle 404 error on CamelHttpTransportServlet where the
> url pattern is matched but no "servlet:///" is found.
> - When there are multiple camel contexts; camelcontext1's router calls
> camelcontext2's route and camelcontext2's route had an exception. Can
> camelcontext1 see this as an exception (even though it did not happen in its
> context) ? What is the best way to handle these scenarios (where there could
> be exception propagation between camelcontexts)
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/onException-Global-declaration-at-CamelHttpTransportServlet-tp5732428.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to