01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.servicemix.components.validation;
18:
19: /**
20: * @author gmcdonald
21: *
22: */
23: public class MessageAggregatingErrorHandlerFactory implements
24: MessageAwareErrorHandlerFactory {
25:
26: /**
27: * The root element name for the fault xml message
28: */
29: private String rootPath;
30:
31: /**
32: * The namespace for the fault xml message
33: */
34: private String namespace;
35:
36: /**
37: * Determines whether or not to include stacktraces in the fault xml message
38: */
39: private boolean includeStackTraces;
40:
41: /**
42: * @return Returns the includeStackTraces.
43: */
44: public boolean isIncludeStackTraces() {
45: return includeStackTraces;
46: }
47:
48: /**
49: * @param includeStackTraces The includeStackTraces to set.
50: */
51: public void setIncludeStackTraces(boolean includeStackTraces) {
52: this .includeStackTraces = includeStackTraces;
53: }
54:
55: /**
56: * @return Returns the namespace.
57: */
58: public String getNamespace() {
59: return namespace;
60: }
61:
62: /**
63: * @param namespace The namespace to set.
64: */
65: public void setNamespace(String namespace) {
66: this .namespace = namespace;
67: }
68:
69: /**
70: * @return Returns the rootPath.
71: */
72: public String getRootPath() {
73: return rootPath;
74: }
75:
76: /**
77: * @param rootPath The rootPath to set.
78: */
79: public void setRootPath(String rootPath) {
80: this .rootPath = rootPath;
81: }
82:
83: /* (non-Javadoc)
84: * @see org.apache.servicemix.components.validation.MessageAwareErrorHandlerFactory#createMessageAwareErrorHandler()
85: */
86: public MessageAwareErrorHandler createMessageAwareErrorHandler() {
87: return new MessageAggregatingErrorHandler(rootPath, namespace,
88: includeStackTraces);
89: }
90:
91: }
|