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 org.apache.openejb.config.Service;
020:
021: import javax.xml.bind.annotation.XmlAccessType;
022: import javax.xml.bind.annotation.XmlAccessorType;
023: import javax.xml.bind.annotation.XmlAttribute;
024: import javax.xml.bind.annotation.XmlType;
025: import javax.xml.bind.annotation.XmlValue;
026: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
027: import java.util.Properties;
028:
029: /**
030: * <p>Java class for Service complex type.
031: * <p/>
032: * <p>The following schema fragment specifies the expected content contained within this class.
033: * <p/>
034: * <pre>
035: * <complexType name="Service">
036: * <simpleContent>
037: * <extension base="<http://www.w3.org/2001/XMLSchema>string">
038: * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
039: * <attribute name="jar" type="{http://www.openejb.org/System/Configuration}JarFileLocation" />
040: * <attribute name="provider" type="{http://www.w3.org/2001/XMLSchema}string" />
041: * </extension>
042: * </simpleContent>
043: * </complexType>
044: * </pre>
045: */
046: @XmlAccessorType(XmlAccessType.FIELD)
047: @XmlType(name="Service")
048: public abstract class AbstractService implements Service {
049: @XmlValue
050: @XmlJavaTypeAdapter(PropertiesAdapter.class)
051: protected Properties properties;
052: @XmlAttribute(required=true)
053: protected String id;
054: @XmlAttribute
055: protected String jar;
056: @XmlAttribute
057: protected String provider;
058: @XmlAttribute
059: protected String type;
060:
061: protected AbstractService(String id) {
062: this (id, null, null);
063: }
064:
065: protected AbstractService(String id, String type) {
066: this .id = id;
067: this .type = type;
068: }
069:
070: protected AbstractService(String id, String type, String provider) {
071: this .id = id;
072: this .provider = provider;
073: this .type = type;
074: }
075:
076: protected AbstractService() {
077: }
078:
079: /**
080: * Gets the value of the properties property.
081: * <p/>
082: * <p/>
083: * This accessor method returns a reference to the live Properties Object,
084: * not a snapshot. Therefore any modification you make to the
085: * returned Properties will be present inside the JAXB object.
086: * This is why there is not a <CODE>set</CODE> method for the properties property.
087: * <p/>
088: * <p/>
089: * For example, to add a new value, do as follows:
090: * <pre>
091: * getProperties().setProperty(key, value);
092: * </pre>
093: * <p/>
094: * <p/>
095: * <p/>
096: */
097: public Properties getProperties() {
098: if (properties == null) {
099: properties = new Properties();
100: }
101: return properties;
102: }
103:
104: /**
105: * Gets the value of the id property.
106: *
107: * @return possible object is
108: * {@link String }
109: */
110: public String getId() {
111: return id;
112: }
113:
114: /**
115: * Sets the value of the id property.
116: *
117: * @param value allowed object is
118: * {@link String }
119: */
120: public void setId(String value) {
121: this .id = value;
122: }
123:
124: /**
125: * Gets the value of the jar property.
126: *
127: * @return possible object is
128: * {@link String }
129: */
130: public String getJar() {
131: return jar;
132: }
133:
134: /**
135: * Sets the value of the jar property.
136: *
137: * @param value allowed object is
138: * {@link String }
139: */
140: public void setJar(String value) {
141: this .jar = value;
142: }
143:
144: /**
145: * Gets the value of the provider property.
146: *
147: * @return possible object is
148: * {@link String }
149: */
150: public String getProvider() {
151: return provider;
152: }
153:
154: /**
155: * Sets the value of the provider property.
156: *
157: * @param value allowed object is
158: * {@link String }
159: */
160: public void setProvider(String value) {
161: this .provider = value;
162: }
163:
164: public String getType() {
165: return type;
166: }
167:
168: public void setType(String type) {
169: this.type = type;
170: }
171: }
|