001: /**
002: *
003: * Licensed to the Apache Software Foundation (ASF) under one or more
004: * contributor license agreements. See the NOTICE file distributed with
005: * this work for additional information regarding copyright ownership.
006: * The ASF licenses this file to You under the Apache License, Version 2.0
007: * (the "License"); you may not use this file except in compliance with
008: * the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing, software
013: * distributed under the License is distributed on an "AS IS" BASIS,
014: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: * See the License for the specific language governing permissions and
016: * limitations under the License.
017: */package org.apache.openejb.config.sys;
018:
019: import java.util.ArrayList;
020: import java.util.List;
021: import java.util.Properties;
022: import javax.xml.bind.annotation.XmlAccessType;
023: import javax.xml.bind.annotation.XmlAccessorType;
024: import javax.xml.bind.annotation.XmlAttribute;
025: import javax.xml.bind.annotation.XmlRootElement;
026: import javax.xml.bind.annotation.XmlType;
027: import javax.xml.bind.annotation.XmlValue;
028: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
029:
030: import org.apache.openejb.util.SuperProperties;
031:
032: /**
033: * <p>Java class for anonymous complex type.
034: * <p/>
035: * <p>The following schema fragment specifies the expected content contained within this class.
036: * <p/>
037: * <pre>
038: * <complexType>
039: * <simpleContent>
040: * <extension base="<http://www.w3.org/2001/XMLSchema>string">
041: * <attribute name="class-name" type="{http://www.openejb.org/Service/Configuration}ClassName" />
042: * <attribute name="description" type="{http://www.w3.org/2001/XMLSchema}string" />
043: * <attribute name="display-name" type="{http://www.w3.org/2001/XMLSchema}string" />
044: * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
045: * <attribute name="provider-type" use="required" type="{http://www.openejb.org/Service/Configuration}ProviderTypes" />
046: * <attribute name="constructor" type="{http://www.w3.org/2001/XMLSchema}string" />
047: * <attribute name="factory-name" type="{http://www.w3.org/2001/XMLSchema}string" />
048: * </extension>
049: * </simpleContent>
050: * </complexType>
051: * </pre>
052: */
053: @XmlAccessorType(XmlAccessType.FIELD)
054: @XmlType(name="")
055: @XmlRootElement(name="ServiceProvider")
056: public class ServiceProvider {
057:
058: @XmlValue
059: @XmlJavaTypeAdapter(PropertiesAdapter.class)
060: protected Properties properties;
061: @XmlAttribute(name="class-name")
062: protected String className;
063: @XmlAttribute(name="constructor")
064: protected String constructor;
065: @XmlAttribute
066: protected String description;
067: @XmlAttribute(name="display-name")
068: protected String displayName;
069: @XmlAttribute(name="factory-name")
070: protected String factoryName;
071: @XmlAttribute(required=true)
072: protected String id;
073: @XmlAttribute(name="service",required=true)
074: protected String service;
075: @XmlAttribute(name="types",required=false)
076: @XmlJavaTypeAdapter(ListAdapter.class)
077: // for some reason when this field is type List JaxB gives us a List<List<String>>
078: protected Object types;
079:
080: /**
081: * Gets the value of the properties property.
082: * <p/>
083: * <p/>
084: * This accessor method returns a reference to the live Properties Object,
085: * not a snapshot. Therefore any modification you make to the
086: * returned Properties will be present inside the JAXB object.
087: * This is why there is not a <CODE>set</CODE> method for the properties property.
088: * <p/>
089: * <p/>
090: * For example, to add a new value, do as follows:
091: * <pre>
092: * getProperties().setProperty(key, value);
093: * </pre>
094: * <p/>
095: * <p/>
096: * <p/>
097: */
098: public Properties getProperties() {
099: if (properties == null) {
100: properties = new SuperProperties();
101: }
102: return properties;
103: }
104:
105: /**
106: * Gets the value of the className property.
107: *
108: * @return possible object is
109: * {@link String }
110: */
111: public String getClassName() {
112: return className;
113: }
114:
115: /**
116: * Sets the value of the className property.
117: *
118: * @param value allowed object is
119: * {@link String }
120: */
121: public void setClassName(String value) {
122: this .className = value;
123: }
124:
125: /**
126: * Gets the value of the constructor property.
127: *
128: * @return possible object is
129: * {@link String }
130: */
131: public String getConstructor() {
132: return constructor;
133: }
134:
135: /**
136: * Sets the value of the constructor property.
137: *
138: * @param value allowed object is
139: * {@link String }
140: */
141: public void setConstructor(String value) {
142: this .constructor = value;
143: }
144:
145: /**
146: * Gets the value of the description property.
147: *
148: * @return possible object is
149: * {@link String }
150: */
151: public String getDescription() {
152: return description;
153: }
154:
155: /**
156: * Sets the value of the description property.
157: *
158: * @param value allowed object is
159: * {@link String }
160: */
161: public void setDescription(String value) {
162: this .description = value;
163: }
164:
165: /**
166: * Gets the value of the displayName property.
167: *
168: * @return possible object is
169: * {@link String }
170: */
171: public String getDisplayName() {
172: return displayName;
173: }
174:
175: /**
176: * Sets the value of the displayName property.
177: *
178: * @param value allowed object is
179: * {@link String }
180: */
181: public void setDisplayName(String value) {
182: this .displayName = value;
183: }
184:
185: /**
186: * Gets the value of the factoryName property.
187: *
188: * @return possible object is
189: * {@link String }
190: */
191: public String getFactoryName() {
192: return factoryName;
193: }
194:
195: /**
196: * Sets the value of the factoryName property.
197: *
198: * @param value allowed object is
199: * {@link String }
200: */
201: public void setFactoryName(String value) {
202: this .factoryName = value;
203: }
204:
205: /**
206: * Gets the value of the id property.
207: *
208: * @return possible object is
209: * {@link String }
210: */
211: public String getId() {
212: return id;
213: }
214:
215: /**
216: * Sets the value of the id property.
217: *
218: * @param value allowed object is
219: * {@link String }
220: */
221: public void setId(String value) {
222: this .id = value;
223: }
224:
225: /**
226: * Gets the value of the providerType property.
227: *
228: * @return possible object is
229: * {@link String }
230: */
231: public String getService() {
232: return service;
233: }
234:
235: /**
236: * Sets the value of the providerType property.
237: *
238: * @param value allowed object is
239: * {@link String }
240: */
241: public void setService(String value) {
242: this .service = value;
243: }
244:
245: @SuppressWarnings({"unchecked"})
246: public List<String> getTypes() {
247: if (types == null) {
248: types = new ArrayList<String>();
249: }
250: return (List<String>) types;
251: }
252: }
|