Examples of ErrorHandlerBuilderRef


Examples of org.apache.camel.builder.ErrorHandlerBuilderRef

                onException(IllegalArgumentException.class)
                    .handled(false)
                    .to("mock:handled")
                    .end();

                errorHandler(new ErrorHandlerBuilderRef("myDLC"));

                from("direct:start")
                    .to("mock:a")
                    .throwException(new IllegalArgumentException("Damn"));
            }
View Full Code Here

Examples of org.apache.camel.builder.ErrorHandlerBuilderRef

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:foo")
                    .errorHandler(new ErrorHandlerBuilderRef("myDLC"))
                    .to("mock:foo")
                    .throwException(new IllegalArgumentException("Damn Foo"));

                from("direct:start")
                    .errorHandler(new ErrorHandlerBuilderRef("myDLC"))
                    .onException(IllegalArgumentException.class)
                        .handled(false)
                        .to("mock:handled")
                    .end()
                    .to("mock:a")
View Full Code Here

Examples of org.apache.camel.builder.ErrorHandlerBuilderRef

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                errorHandler(new ErrorHandlerBuilderRef("myDLC"));

                from("direct:foo")
                    .to("mock:foo")
                    .throwException(new IllegalArgumentException("Damn Foo"));
View Full Code Here

Examples of org.apache.camel.builder.ErrorHandlerBuilderRef

        // we want to only register one instance of the various error handler types and thus do some lookup
        // if its a ErrorHandlerBuildRef. We need a bit of work to do that as there are potential indirection.
        String ref = null;
        if (builder instanceof ErrorHandlerBuilderRef) {
            ErrorHandlerBuilderRef builderRef = (ErrorHandlerBuilderRef) builder;

            // it has not then its an indirection and we should do some work to lookup the real builder
            ref = builderRef.getRef();
            builder = ErrorHandlerBuilderRef.lookupErrorHandlerBuilder(routeContext, builderRef.getRef());

            // must do a 2nd lookup in case this is also a reference
            // (this happens with spring DSL using errorHandlerRef on <route> as it gets a bit
            // complex with indirections for error handler references
            if (builder instanceof ErrorHandlerBuilderRef) {
                builderRef = (ErrorHandlerBuilderRef) builder;
                // does it refer to a non default error handler then do a 2nd lookup
                if (!builderRef.getRef().equals(ErrorHandlerBuilderRef.DEFAULT_ERROR_HANDLER_BUILDER)) {
                    builder = ErrorHandlerBuilderRef.lookupErrorHandlerBuilder(routeContext, builderRef.getRef());
                    ref = builderRef.getRef();
                }
            }
        }

        if (ref != null) {
View Full Code Here

Examples of org.apache.camel.builder.ErrorHandlerBuilderRef

        return wrapProcessor(routeContext, processor);
    }

    protected ErrorHandlerBuilder createErrorHandlerBuilder() {
        if (errorHandlerRef != null) {
            return new ErrorHandlerBuilderRef(errorHandlerRef);
        }

        // return a reference to the default error handler
        return new ErrorHandlerBuilderRef(ErrorHandlerBuilderRef.DEFAULT_ERROR_HANDLER_BUILDER);
    }
View Full Code Here

Examples of org.apache.camel.builder.ErrorHandlerBuilderRef

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start")
                    .errorHandler(new ErrorHandlerBuilderRef("myDLC"))
                    .onException(IllegalArgumentException.class)
                        .handled(false)
                        .to("mock:handled")
                    .end()
                    .to("mock:a")
View Full Code Here

Examples of org.apache.camel.builder.ErrorHandlerBuilderRef

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                errorHandler(new ErrorHandlerBuilderRef("myDLC"));

                onException(IllegalArgumentException.class)
                    .handled(false)
                    .to("mock:handled")
                    .end();
View Full Code Here

Examples of org.apache.camel.builder.ErrorHandlerBuilderRef

                    .handled(true)
                    .to("mock:handled")
                    .end();

                from("direct:start")
                    .errorHandler(new ErrorHandlerBuilderRef("myDLC"))
                    .to("mock:a")
                    .throwException(new IllegalArgumentException("Damn"));
            }
        };
    }
View Full Code Here

Examples of org.apache.camel.builder.ErrorHandlerBuilderRef

        }
        if (handleFault != null) {
            ctx.setHandleFault(handleFault);
        }
        if (errorHandlerRef != null) {
            ctx.setErrorHandlerBuilder(new ErrorHandlerBuilderRef(errorHandlerRef));
        }

        if (shouldStartContext != null) {
            ctx.setShouldStartContext(shouldStartContext);
        }
View Full Code Here

Examples of org.apache.camel.builder.ErrorHandlerBuilderRef

        }
        if (handleFault != null) {
            ctx.setHandleFault(handleFault);
        }
        if (errorHandlerRef != null) {
            ctx.setErrorHandlerBuilder(new ErrorHandlerBuilderRef(errorHandlerRef));
        }
        if (autoStartup != null) {
            ctx.setAutoStartup(autoStartup);
        }
        return ctx;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.