001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */package org.apache.openejb.jee.sun;
017:
018: import javax.xml.bind.annotation.XmlAccessType;
019: import javax.xml.bind.annotation.XmlAccessorType;
020: import javax.xml.bind.annotation.XmlAttribute;
021: import javax.xml.bind.annotation.XmlElement;
022: import javax.xml.bind.annotation.XmlType;
023: import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
024: import javax.xml.bind.annotation.adapters.NormalizedStringAdapter;
025: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
026: import java.util.ArrayList;
027: import java.util.List;
028:
029: @XmlAccessorType(XmlAccessType.FIELD)
030: @XmlType(name="",propOrder={"cacheHelper","defaultHelper","property","cacheMapping"})
031: public class Cache {
032: @XmlAttribute(name="max-entries")
033: @XmlJavaTypeAdapter(NormalizedStringAdapter.class)
034: protected String maxEntries;
035: @XmlAttribute(name="timeout-in-seconds")
036: @XmlJavaTypeAdapter(NormalizedStringAdapter.class)
037: protected String timeoutInSeconds;
038: @XmlAttribute
039: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
040: protected String enabled;
041: @XmlElement(name="cache-helper")
042: protected List<CacheHelper> cacheHelper;
043: @XmlElement(name="default-helper")
044: protected DefaultHelper defaultHelper;
045: protected List<Property> property;
046: @XmlElement(name="cache-mapping")
047: protected List<CacheMapping> cacheMapping;
048:
049: public String getMaxEntries() {
050: if (maxEntries == null) {
051: return "4096";
052: } else {
053: return maxEntries;
054: }
055: }
056:
057: public void setMaxEntries(String value) {
058: this .maxEntries = value;
059: }
060:
061: public String getTimeoutInSeconds() {
062: if (timeoutInSeconds == null) {
063: return "30";
064: } else {
065: return timeoutInSeconds;
066: }
067: }
068:
069: public void setTimeoutInSeconds(String value) {
070: this .timeoutInSeconds = value;
071: }
072:
073: public String getEnabled() {
074: if (enabled == null) {
075: return "true";
076: } else {
077: return enabled;
078: }
079: }
080:
081: public void setEnabled(String value) {
082: this .enabled = value;
083: }
084:
085: public List<CacheHelper> getCacheHelper() {
086: if (cacheHelper == null) {
087: cacheHelper = new ArrayList<CacheHelper>();
088: }
089: return this .cacheHelper;
090: }
091:
092: public DefaultHelper getDefaultHelper() {
093: return defaultHelper;
094: }
095:
096: public void setDefaultHelper(DefaultHelper value) {
097: this .defaultHelper = value;
098: }
099:
100: public List<Property> getProperty() {
101: if (property == null) {
102: property = new ArrayList<Property>();
103: }
104: return this .property;
105: }
106:
107: public List<CacheMapping> getCacheMapping() {
108: if (cacheMapping == null) {
109: cacheMapping = new ArrayList<CacheMapping>();
110: }
111: return this.cacheMapping;
112: }
113: }
|