Package com.confluex.modules.error.config

Source Code of com.confluex.modules.error.config.RunWithErrorHandlerFactoryBean

package com.confluex.modules.error.config;

import com.confluex.modules.error.RunWithErrorHandlerMessageProcessor;
import org.mule.api.exception.MessagingExceptionHandler;
import org.mule.api.processor.MessageProcessor;
import org.springframework.beans.factory.FactoryBean;

import java.util.List;

public class RunWithErrorHandlerFactoryBean implements FactoryBean {

    protected List<MessageProcessor> processors;
    protected String name;

    protected MessagingExceptionHandler exceptionStrategy;

    public void setCatch(MessagingExceptionHandler exceptionStrategy) {
       this.exceptionStrategy = exceptionStrategy;
    }

    public void setMessageProcessors(List<MessageProcessor> processors) {
        this.processors = processors;
    }

    public Class getObjectType() {
        return RunWithErrorHandlerMessageProcessor.class;
    }

    public Object getObject() throws Exception {
        RunWithErrorHandlerMessageProcessor processor = new RunWithErrorHandlerMessageProcessor(processors);
        processor.setExceptionHandler(exceptionStrategy);
        return processor;
    }

    public boolean isSingleton() {
        return false;
    }

}
TOP

Related Classes of com.confluex.modules.error.config.RunWithErrorHandlerFactoryBean

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.