001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.servicemix.validation.handler;
018    
019    /**
020     * @author gmcdonald
021     *
022     */
023    public class MessageAggregatingErrorHandlerFactory implements
024            MessageAwareErrorHandlerFactory {
025    
026        /**
027         * The root element name for the fault xml message
028         */
029        private String rootPath;
030        
031        /**
032         * The namespace for the fault xml message
033         */
034        private String namespace;
035        
036        /**
037         * Determines whether or not to include stacktraces in the fault xml message
038         */
039        private boolean includeStackTraces;
040        
041        /**
042         * @return Returns the includeStackTraces.
043         */
044        public boolean isIncludeStackTraces() {
045            return includeStackTraces;
046        }
047    
048        /**
049         * @param includeStackTraces The includeStackTraces to set.
050         */
051        public void setIncludeStackTraces(boolean includeStackTraces) {
052            this.includeStackTraces = includeStackTraces;
053        }
054    
055        /**
056         * @return Returns the namespace.
057         */
058        public String getNamespace() {
059            return namespace;
060        }
061    
062        /**
063         * @param namespace The namespace to set.
064         */
065        public void setNamespace(String namespace) {
066            this.namespace = namespace;
067        }
068    
069        /**
070         * @return Returns the rootPath.
071         */
072        public String getRootPath() {
073            return rootPath;
074        }
075    
076        /**
077         * @param rootPath The rootPath to set.
078         */
079        public void setRootPath(String rootPath) {
080            this.rootPath = rootPath;
081        }
082    
083        /* (non-Javadoc)
084         * @see org.apache.servicemix.components.validation.MessageAwareErrorHandlerFactory#createMessageAwareErrorHandler()
085         */
086        public MessageAwareErrorHandler createMessageAwareErrorHandler() {
087            return new MessageAggregatingErrorHandler(rootPath, namespace, includeStackTraces);
088        }
089    
090    }