Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||||
OutputType |
|
| 0.0;0 |
1 | /** |
|
2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
|
3 | * contributor license agreements. See the NOTICE file distributed with |
|
4 | * this work for additional information regarding copyright ownership. |
|
5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
|
6 | * (the "License"); you may not use this file except in compliance with |
|
7 | * the License. You may obtain a copy of the License at |
|
8 | * |
|
9 | * 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.camel.model; |
|
18 | ||
19 | import java.util.ArrayList; |
|
20 | import java.util.List; |
|
21 | ||
22 | import javax.xml.bind.annotation.XmlElement; |
|
23 | import javax.xml.bind.annotation.XmlElementRef; |
|
24 | import javax.xml.bind.annotation.XmlType; |
|
25 | import javax.xml.bind.annotation.XmlAccessorType; |
|
26 | import javax.xml.bind.annotation.XmlAccessType; |
|
27 | ||
28 | import org.apache.commons.logging.Log; |
|
29 | import org.apache.commons.logging.LogFactory; |
|
30 | ||
31 | /** |
|
32 | * A useful base class for output types |
|
33 | * |
|
34 | * @version $Revision: 1.1 $ |
|
35 | */ |
|
36 | @XmlType(name = "outputType") |
|
37 | @XmlAccessorType(XmlAccessType.FIELD) |
|
38 | 159 | public class OutputType extends ProcessorType { |
39 | 3 | private static final transient Log LOG = LogFactory.getLog(OutputType.class); |
40 | ||
41 | @XmlElementRef |
|
42 | 159 | protected List<ProcessorType> outputs = new ArrayList<ProcessorType>(); |
43 | @XmlElementRef |
|
44 | 159 | private List<InterceptorType> interceptors = new ArrayList<InterceptorType>(); |
45 | ||
46 | public List<ProcessorType> getOutputs() { |
|
47 | 168 | return outputs; |
48 | } |
|
49 | ||
50 | public void setOutputs(List<ProcessorType> outputs) { |
|
51 | 0 | this.outputs = outputs; |
52 | 0 | if (outputs != null) { |
53 | 0 | for (ProcessorType output : outputs) { |
54 | 0 | configureChild(output); |
55 | 0 | } |
56 | } |
|
57 | 0 | } |
58 | ||
59 | public List<InterceptorType> getInterceptors() { |
|
60 | 150 | return interceptors; |
61 | } |
|
62 | ||
63 | public void setInterceptors(List<InterceptorType> interceptors) { |
|
64 | 0 | this.interceptors = interceptors; |
65 | 0 | } |
66 | ||
67 | @Override |
|
68 | protected void configureChild(ProcessorType output) { |
|
69 | 72 | if (isInheritErrorHandler()) { |
70 | 72 | output.setErrorHandlerBuilder(getErrorHandlerBuilder()); |
71 | } |
|
72 | // don't inherit interceptors by default |
|
73 | /* |
|
74 | List<InterceptorType> list = output.getInterceptors(); |
|
75 | if (list == null) { |
|
76 | log.warn("No interceptor collection: " + output); |
|
77 | } |
|
78 | else { |
|
79 | list.addAll(getInterceptors()); |
|
80 | } |
|
81 | */ |
|
82 | 72 | } |
83 | } |