Package org.apache.camel.builder

Examples of org.apache.camel.builder.DefaultErrorHandlerBuilder


    @Override
    public ErrorHandlerBuilder getObject() throws Exception {
        ErrorHandlerBuilder errorHandler = getObjectType().newInstance();
        if (errorHandler instanceof DefaultErrorHandlerBuilder) {
            DefaultErrorHandlerBuilder handler = (DefaultErrorHandlerBuilder) errorHandler;
            if (deadLetterUri != null) {
                handler.setDeadLetterUri(deadLetterUri);
            }
            if (useOriginalMessage != null) {
                handler.setUseOriginalMessage(useOriginalMessage);
            }
            if (redeliveryPolicy != null) {
                handler.setRedeliveryPolicy(redeliveryPolicy.createRedeliveryPolicy(getCamelContext(), null));
            }
            if (redeliveryPolicyRef != null) {
                handler.setRedeliveryPolicy(lookup(redeliveryPolicyRef, RedeliveryPolicy.class));
            }
            if (onRedeliveryRef != null) {
                handler.setOnRedelivery(lookup(onRedeliveryRef, Processor.class));
            }
            if (retryWhileRef != null) {
                handler.setRetryWhileRef(retryWhileRef);
            }
            if (executorServiceRef != null) {
                handler.setExecutorServiceRef(executorServiceRef);
            }
        } else if (errorHandler instanceof LoggingErrorHandlerBuilder) {
            LoggingErrorHandlerBuilder handler = (LoggingErrorHandlerBuilder) errorHandler;
            if (level != null) {
                handler.setLevel(level);
            }
            if (logName != null) {
                handler.setLogName(logName);
            }
        }
        return errorHandler;
    }
View Full Code Here


        assertNotNull(errorHandler);
        assertEquals("The loglevel should be INFO", LoggingLevel.INFO, errorHandler.getLevel());
    }
   
    public void testDefaultErrorHandler() {
        DefaultErrorHandlerBuilder errorHandler = (DefaultErrorHandlerBuilder) ctx.getBean("defaultErrorHandler");
        assertNotNull(errorHandler);
        RedeliveryPolicy policy = errorHandler.getRedeliveryPolicy();
        assertNotNull(policy);
        assertEquals("Wrong maximumRedeliveries", 2, policy.getMaximumRedeliveries());
        assertEquals("Wrong redeliveryDelay", 0, policy.getRedeliveryDelay());
        assertEquals("Wrong logStackTrace", false, policy.isLogStackTrace());
       
View Full Code Here

    @Override
    public ErrorHandlerBuilder getObject() throws Exception {
        ErrorHandlerBuilder errorHandler = getObjectType().newInstance();
        if (errorHandler instanceof DefaultErrorHandlerBuilder) {
            DefaultErrorHandlerBuilder handler = (DefaultErrorHandlerBuilder) errorHandler;
            if (deadLetterUri != null) {
                handler.setDeadLetterUri(deadLetterUri);
            }
            if (useOriginalMessage != null) {
                handler.setUseOriginalMessage(useOriginalMessage);
            }
            if (redeliveryPolicy != null) {
                handler.setRedeliveryPolicy(redeliveryPolicy.createRedeliveryPolicy(getCamelContext(), null));
            }
            if (redeliveryPolicyRef != null) {
                // lookup redelivery
                RedeliveryPolicy policy = CamelContextHelper.mandatoryLookup(getCamelContext(), redeliveryPolicyRef, RedeliveryPolicy.class);
                handler.setRedeliveryPolicy(policy);
            }
            if (onRedeliveryRef != null) {
                handler.setOnRedelivery(lookup(onRedeliveryRef, Processor.class));
            }
            if (retryWhileRef != null) {
                handler.setRetryWhileRef(retryWhileRef);
            }
        } else if (errorHandler instanceof LoggingErrorHandlerBuilder) {
            LoggingErrorHandlerBuilder handler = (LoggingErrorHandlerBuilder) errorHandler;
            if (level != null) {
                handler.setLevel(level);
            }
            if (logName != null) {
                handler.setLogName(logName);
            }
        }
        return errorHandler;
    }
View Full Code Here

        assertNotNull(errorHandler);
        assertEquals("The loglevel should be INFO", LoggingLevel.INFO, errorHandler.getLevel());
    }
   
    public void testDefaultErrorHandler() {
        DefaultErrorHandlerBuilder errorHandler = (DefaultErrorHandlerBuilder) ctx.getBean("defaultErrorHandler");
        assertNotNull(errorHandler);
        RedeliveryPolicy policy = errorHandler.getRedeliveryPolicy();
        assertNotNull(policy);
        assertEquals("Wrong maximumRedeliveries", 2, policy.getMaximumRedeliveries());
        assertEquals("Wrong redeliveryDelay", 0, policy.getRedeliveryDelay());
        assertEquals("Wrong logStackTrace", false, policy.isLogStackTrace());
       
View Full Code Here

    @Override
    public ErrorHandlerBuilder getObject() throws Exception {
        ErrorHandlerBuilder errorHandler = getObjectType().newInstance();
        if (errorHandler instanceof DefaultErrorHandlerBuilder) {
            DefaultErrorHandlerBuilder handler = (DefaultErrorHandlerBuilder) errorHandler;
            if (deadLetterUri != null) {
                handler.setDeadLetterUri(deadLetterUri);
            }
            if (useOriginalMessage != null) {
                handler.setUseOriginalMessage(useOriginalMessage);
            }
            if (redeliveryPolicy != null) {
                handler.setRedeliveryPolicy(redeliveryPolicy.createRedeliveryPolicy(getCamelContext(), null));
            }
            if (redeliveryPolicyRef != null) {
                handler.setRedeliveryPolicy(lookup(redeliveryPolicyRef, RedeliveryPolicy.class));
            }
            if (onRedeliveryRef != null) {
                handler.setOnRedelivery(lookup(onRedeliveryRef, Processor.class));
            }
            if (retryWhileRef != null) {
                handler.setRetryWhileRef(retryWhileRef);
            }
            if (executorServiceRef != null) {
                handler.setExecutorServiceRef(executorServiceRef);
            }
        } else if (errorHandler instanceof LoggingErrorHandlerBuilder) {
            LoggingErrorHandlerBuilder handler = (LoggingErrorHandlerBuilder) errorHandler;
            if (level != null) {
                handler.setLevel(level);
            }
            if (logName != null) {
                handler.setLogName(logName);
            }
        }
        return errorHandler;
    }
View Full Code Here

    @Override
    public ErrorHandlerBuilder getObject() throws Exception {
        ErrorHandlerBuilder errorHandler = getObjectType().newInstance();
        if (errorHandler instanceof DefaultErrorHandlerBuilder) {
            DefaultErrorHandlerBuilder handler = (DefaultErrorHandlerBuilder) errorHandler;
            if (deadLetterUri != null) {
                handler.setDeadLetterUri(deadLetterUri);
            }
            if (useOriginalMessage != null) {
                handler.setUseOriginalMessage(useOriginalMessage);
            }
            if (redeliveryPolicy != null) {
                handler.setRedeliveryPolicy(redeliveryPolicy.createRedeliveryPolicy(getCamelContext(), null));
            }
            if (redeliveryPolicyRef != null) {
                handler.setRedeliveryPolicy(lookup(redeliveryPolicyRef, RedeliveryPolicy.class));
            }
            if (onRedeliveryRef != null) {
                handler.setOnRedelivery(lookup(onRedeliveryRef, Processor.class));
            }
            if (retryWhileRef != null) {
                handler.setRetryWhileRef(retryWhileRef);
            }
            if (executorServiceRef != null) {
                handler.setExecutorServiceRef(executorServiceRef);
            }
        } else if (errorHandler instanceof LoggingErrorHandlerBuilder) {
            LoggingErrorHandlerBuilder handler = (LoggingErrorHandlerBuilder) errorHandler;
            if (level != null) {
                handler.setLevel(level);
            }
            if (logName != null) {
                handler.setLogName(logName);
            }
        }
        return errorHandler;
    }
View Full Code Here

        assertEquals("The log level should be INFO", LoggingLevel.INFO, errorHandler.getLevel());
        assertEquals("The log name should be foo", "foo", errorHandler.getLogName());
    }
   
    public void testDefaultErrorHandler() {
        DefaultErrorHandlerBuilder errorHandler = ctx.getBean("defaultErrorHandler", DefaultErrorHandlerBuilder.class);
        assertNotNull(errorHandler);
        RedeliveryPolicy policy = errorHandler.getRedeliveryPolicy();
        assertNotNull(policy);
        assertEquals("Wrong maximumRedeliveries", 2, policy.getMaximumRedeliveries());
        assertEquals("Wrong redeliveryDelay", 0, policy.getRedeliveryDelay());
        assertEquals("Wrong logStackTrace", false, policy.isLogStackTrace());
       
View Full Code Here

        assertEquals("The log level should be INFO", LoggingLevel.INFO, errorHandler.getLevel());
        assertEquals("The log name should be foo", "foo", errorHandler.getLogName());
    }
   
    public void testDefaultErrorHandler() {
        DefaultErrorHandlerBuilder errorHandler = (DefaultErrorHandlerBuilder) ctx.getBean("defaultErrorHandler");
        assertNotNull(errorHandler);
        RedeliveryPolicy policy = errorHandler.getRedeliveryPolicy();
        assertNotNull(policy);
        assertEquals("Wrong maximumRedeliveries", 2, policy.getMaximumRedeliveries());
        assertEquals("Wrong redeliveryDelay", 0, policy.getRedeliveryDelay());
        assertEquals("Wrong logStackTrace", false, policy.isLogStackTrace());
       
View Full Code Here

    @Override
    public ErrorHandlerBuilder getObject() throws Exception {
        ErrorHandlerBuilder errorHandler = getObjectType().newInstance();
        if (errorHandler instanceof DefaultErrorHandlerBuilder) {
            DefaultErrorHandlerBuilder handler = (DefaultErrorHandlerBuilder) errorHandler;
            if (deadLetterUri != null) {
                handler.setDeadLetterUri(deadLetterUri);
            }
            if (useOriginalMessage != null) {
                handler.setUseOriginalMessage(useOriginalMessage);
            }
            if (redeliveryPolicy != null) {
                handler.setRedeliveryPolicy(redeliveryPolicy.createRedeliveryPolicy(getCamelContext(), null));
            }
            if (redeliveryPolicyRef != null) {
                // lookup redelivery
                RedeliveryPolicy policy = CamelContextHelper.mandatoryLookup(getCamelContext(), redeliveryPolicyRef, RedeliveryPolicy.class);
                handler.setRedeliveryPolicy(policy);
            }
            if (onRedeliveryRef != null) {
                handler.setOnRedelivery(lookup(onRedeliveryRef, Processor.class));
            }
            if (retryWhileRef != null) {
                handler.setRetryWhileRef(retryWhileRef);
            }
            if (executorServiceRef != null) {
                handler.setExecutorServiceRef(executorServiceRef);
            }
        } else if (errorHandler instanceof LoggingErrorHandlerBuilder) {
            LoggingErrorHandlerBuilder handler = (LoggingErrorHandlerBuilder) errorHandler;
            if (level != null) {
                handler.setLevel(level);
            }
            if (logName != null) {
                handler.setLogName(logName);
            }
        }
        return errorHandler;
    }
View Full Code Here

    @Override
    public ErrorHandlerBuilder getObject() throws Exception {
        ErrorHandlerBuilder errorHandler = getObjectType().newInstance();
        if (errorHandler instanceof DefaultErrorHandlerBuilder) {
            DefaultErrorHandlerBuilder handler = (DefaultErrorHandlerBuilder) errorHandler;
            if (deadLetterUri != null) {
                handler.setDeadLetterUri(deadLetterUri);
            }
            if (useOriginalMessage != null) {
                handler.setUseOriginalMessage(useOriginalMessage);
            }
            if (redeliveryPolicy != null) {
                handler.setRedeliveryPolicy(redeliveryPolicy.createRedeliveryPolicy(getCamelContext(), null));
            }
            if (redeliveryPolicyRef != null) {
                handler.setRedeliveryPolicy(lookup(redeliveryPolicyRef, RedeliveryPolicy.class));
            }
            if (onRedeliveryRef != null) {
                handler.setOnRedelivery(lookup(onRedeliveryRef, Processor.class));
            }
            if (retryWhileRef != null) {
                handler.setRetryWhileRef(retryWhileRef);
            }
            if (executorServiceRef != null) {
                handler.setExecutorServiceRef(executorServiceRef);
            }
        } else if (errorHandler instanceof LoggingErrorHandlerBuilder) {
            LoggingErrorHandlerBuilder handler = (LoggingErrorHandlerBuilder) errorHandler;
            if (level != null) {
                handler.setLevel(level);
            }
            if (logName != null) {
                handler.setLogName(logName);
            }
        }
        return errorHandler;
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.builder.DefaultErrorHandlerBuilder

Copyright © 2018 www.massapicom. 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.