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: */package org.apache.openejb.jee;
17:
18: import javax.xml.bind.annotation.XmlAccessType;
19: import javax.xml.bind.annotation.XmlAccessorType;
20: import javax.xml.bind.annotation.XmlAttribute;
21: import javax.xml.bind.annotation.XmlElement;
22: import javax.xml.bind.annotation.XmlID;
23: import javax.xml.bind.annotation.XmlType;
24: import javax.xml.bind.annotation.XmlList;
25: import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
26: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
27: import java.util.ArrayList;
28: import java.util.List;
29:
30: /**
31: * The handler-chain element defines the handlerchain.
32: * Handlerchain can be defined such that the handlers in the
33: * handlerchain operate,all ports of a service, on a specific
34: * port or on a list of protocol-bindings. The choice of elements
35: * service-name-pattern, port-name-pattern and protocol-bindings
36: * are used to specify whether the handlers in handler-chain are
37: * for a service, port or protocol binding. If none of these
38: * choices are specified with the handler-chain element then the
39: * handlers specified in the handler-chain will be applied on
40: * everything.
41: */
42: @XmlAccessorType(XmlAccessType.FIELD)
43: @XmlType(name="handler-chainType",propOrder={"serviceNamePattern","portNamePattern","protocolBindings","handler"})
44: public class HandlerChain {
45: @XmlElement(name="service-name-pattern")
46: protected String serviceNamePattern;
47: @XmlElement(name="port-name-pattern")
48: protected String portNamePattern;
49: @XmlList
50: @XmlElement(name="protocol-bindings")
51: protected List<String> protocolBindings;
52: @XmlElement(required=true)
53: protected List<Handler> handler;
54: @XmlAttribute
55: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
56: @XmlID
57: protected String id;
58:
59: public String getServiceNamePattern() {
60: return serviceNamePattern;
61: }
62:
63: public void setServiceNamePattern(String value) {
64: this .serviceNamePattern = value;
65: }
66:
67: public String getPortNamePattern() {
68: return portNamePattern;
69: }
70:
71: public void setPortNamePattern(String value) {
72: this .portNamePattern = value;
73: }
74:
75: public List<String> getProtocolBindings() {
76: if (protocolBindings == null) {
77: protocolBindings = new ArrayList<String>();
78: }
79: return this .protocolBindings;
80: }
81:
82: public List<Handler> getHandler() {
83: if (handler == null) {
84: handler = new ArrayList<Handler>();
85: }
86: return this .handler;
87: }
88:
89: public String getId() {
90: return id;
91: }
92:
93: public void setId(String value) {
94: this.id = value;
95: }
96: }
|