blob: 178d2928e91763389a80de693662627c8aa97289 [file] [log] [blame]
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.openejb.jee;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.ArrayList;
import java.util.List;
import java.util.Collection;
import java.util.Map;
@XmlRootElement(name = "web-app")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "web-appType", propOrder = {
"descriptions",
"displayNames",
"icon",
"distributable",
"contextParam",
"filter",
"filterMapping",
"listener",
"servlet",
"servletMapping",
"sessionConfig",
"mimeMapping",
"welcomeFileList",
"errorPage",
"taglib",
"jspConfig",
"securityConstraint",
"loginConfig",
"securityRole",
"localeEncodingMappingList",
"envEntry",
"ejbRef",
"ejbLocalRef",
"serviceRef",
"resourceRef",
"resourceEnvRef",
"messageDestinationRef",
"persistenceContextRef",
"persistenceUnitRef",
"postConstruct",
"preDestroy",
"messageDestination"
})
public class WebApp implements JndiConsumer {
@XmlTransient
private String contextRoot;
@XmlTransient
protected TextMap description = new TextMap();
@XmlTransient
protected TextMap displayName = new TextMap();
@XmlElement(name = "icon", required = true)
protected LocalCollection<Icon> icon = new LocalCollection<Icon>();
protected List<EmptyType> distributable;
@XmlElement(name = "context-param")
protected List<ParamValue> contextParam;
protected List<Filter> filter;
@XmlElement(name = "filter-mapping")
protected List<FilterMapping> filterMapping;
protected List<Listener> listener;
protected List<Servlet> servlet;
@XmlElement(name = "servlet-mapping")
protected List<ServletMapping> servletMapping;
@XmlElement(name = "session-config")
protected List<SessionConfig> sessionConfig;
@XmlElement(name = "mime-mapping")
protected List<MimeMapping> mimeMapping;
@XmlElement(name = "welcome-file-list")
protected List<WelcomeFileList> welcomeFileList;
@XmlElement(name = "taglib")
protected List<Taglib> taglib;
@XmlElement(name = "error-page")
protected List<ErrorPage> errorPage;
@XmlElement(name = "jsp-config")
protected List<JspConfig> jspConfig;
@XmlElement(name = "security-constraint")
protected List<SecurityConstraint> securityConstraint;
@XmlElement(name = "login-config")
protected List<LoginConfigType> loginConfig;
@XmlElement(name = "security-role")
protected List<SecurityRole> securityRole;
@XmlElement(name = "locale-encoding-mapping-list")
protected List<LocaleEncodingMappingList> localeEncodingMappingList;
@XmlElement(name = "env-entry", required = true)
protected KeyedCollection<String,EnvEntry> envEntry;
@XmlElement(name = "ejb-ref", required = true)
protected KeyedCollection<String,EjbRef> ejbRef;
@XmlElement(name = "ejb-local-ref", required = true)
protected KeyedCollection<String,EjbLocalRef> ejbLocalRef;
@XmlElement(name = "service-ref", required = true)
protected KeyedCollection<String,ServiceRef> serviceRef;
@XmlElement(name = "resource-ref", required = true)
protected KeyedCollection<String,ResourceRef> resourceRef;
@XmlElement(name = "resource-env-ref", required = true)
protected KeyedCollection<String,ResourceEnvRef> resourceEnvRef;
@XmlElement(name = "message-destination-ref", required = true)
protected KeyedCollection<String,MessageDestinationRef> messageDestinationRef;
@XmlElement(name = "persistence-context-ref", required = true)
protected KeyedCollection<String,PersistenceContextRef> persistenceContextRef;
@XmlElement(name = "persistence-unit-ref", required = true)
protected KeyedCollection<String,PersistenceUnitRef> persistenceUnitRef;
@XmlElement(name = "post-construct", required = true)
protected List<LifecycleCallback> postConstruct;
@XmlElement(name = "pre-destroy", required = true)
protected List<LifecycleCallback> preDestroy;
@XmlElement(name = "message-destination", required = true)
protected List<MessageDestination> messageDestination;
@XmlAttribute
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
protected String id;
@XmlAttribute(name = "metadata-complete")
protected Boolean metadataComplete;
@XmlAttribute(required = true)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String version;
public String getJndiConsumerName() {
return contextRoot;
}
public String getContextRoot() {
return contextRoot;
}
public void setContextRoot(String contextRoot) {
this.contextRoot = contextRoot;
}
@XmlElement(name = "description", required = true)
public Text[] getDescriptions() {
return description.toArray();
}
public void setDescriptions(Text[] text) {
description.set(text);
}
public String getDescription() {
return description.get();
}
@XmlElement(name = "display-name", required = true)
public Text[] getDisplayNames() {
return displayName.toArray();
}
public void setDisplayNames(Text[] text) {
displayName.set(text);
}
public String getDisplayName() {
return displayName.get();
}
public Collection<Icon> getIcons() {
if (icon == null) {
icon = new LocalCollection<Icon>();
}
return icon;
}
public Map<String,Icon> getIconMap() {
if (icon == null) {
icon = new LocalCollection<Icon>();
}
return icon.toMap();
}
public Icon getIcon() {
return icon.getLocal();
}
public List<EmptyType> getDistributable() {
if (distributable == null) {
distributable = new ArrayList<EmptyType>();
}
return this.distributable;
}
public List<ParamValue> getContextParam() {
if (contextParam == null) {
contextParam = new ArrayList<ParamValue>();
}
return this.contextParam;
}
public List<Filter> getFilter() {
if (filter == null) {
filter = new ArrayList<Filter>();
}
return this.filter;
}
public List<FilterMapping> getFilterMapping() {
if (filterMapping == null) {
filterMapping = new ArrayList<FilterMapping>();
}
return this.filterMapping;
}
public List<Listener> getListener() {
if (listener == null) {
listener = new ArrayList<Listener>();
}
return this.listener;
}
public List<Servlet> getServlet() {
if (servlet == null) {
servlet = new ArrayList<Servlet>();
}
return this.servlet;
}
public List<ServletMapping> getServletMapping() {
if (servletMapping == null) {
servletMapping = new ArrayList<ServletMapping>();
}
return this.servletMapping;
}
public List<SessionConfig> getSessionConfig() {
if (sessionConfig == null) {
sessionConfig = new ArrayList<SessionConfig>();
}
return this.sessionConfig;
}
public List<MimeMapping> getMimeMapping() {
if (mimeMapping == null) {
mimeMapping = new ArrayList<MimeMapping>();
}
return this.mimeMapping;
}
public List<WelcomeFileList> getWelcomeFileList() {
if (welcomeFileList == null) {
welcomeFileList = new ArrayList<WelcomeFileList>();
}
return this.welcomeFileList;
}
public List<ErrorPage> getErrorPage() {
if (errorPage == null) {
errorPage = new ArrayList<ErrorPage>();
}
return this.errorPage;
}
public List<JspConfig> getJspConfig() {
if (jspConfig == null) {
jspConfig = new ArrayList<JspConfig>();
}
return this.jspConfig;
}
public List<SecurityConstraint> getSecurityConstraint() {
if (securityConstraint == null) {
securityConstraint = new ArrayList<SecurityConstraint>();
}
return this.securityConstraint;
}
public List<LoginConfigType> getLoginConfig() {
if (loginConfig == null) {
loginConfig = new ArrayList<LoginConfigType>();
}
return this.loginConfig;
}
public List<SecurityRole> getSecurityRole() {
if (securityRole == null) {
securityRole = new ArrayList<SecurityRole>();
}
return this.securityRole;
}
public List<LocaleEncodingMappingList> getLocaleEncodingMappingList() {
if (localeEncodingMappingList == null) {
localeEncodingMappingList = new ArrayList<LocaleEncodingMappingList>();
}
return this.localeEncodingMappingList;
}
public Collection<EnvEntry> getEnvEntry() {
if (envEntry == null) {
envEntry = new KeyedCollection<String,EnvEntry>();
}
return this.envEntry;
}
public Map<String,EnvEntry> getEnvEntryMap() {
if (envEntry == null) {
envEntry = new KeyedCollection<String,EnvEntry>();
}
return this.envEntry.toMap();
}
public Collection<EjbRef> getEjbRef() {
if (ejbRef == null) {
ejbRef = new KeyedCollection<String,EjbRef>();
}
return this.ejbRef;
}
public Map<String,EjbRef> getEjbRefMap() {
if (ejbRef == null) {
ejbRef = new KeyedCollection<String,EjbRef>();
}
return this.ejbRef.toMap();
}
public Collection<EjbLocalRef> getEjbLocalRef() {
if (ejbLocalRef == null) {
ejbLocalRef = new KeyedCollection<String,EjbLocalRef>();
}
return this.ejbLocalRef;
}
public Map<String,EjbLocalRef> getEjbLocalRefMap() {
if (ejbLocalRef == null) {
ejbLocalRef = new KeyedCollection<String,EjbLocalRef>();
}
return this.ejbLocalRef.toMap();
}
public Collection<ServiceRef> getServiceRef() {
if (serviceRef == null) {
serviceRef = new KeyedCollection<String,ServiceRef>();
}
return this.serviceRef;
}
public Map<String,ServiceRef> getServiceRefMap() {
if (serviceRef == null) {
serviceRef = new KeyedCollection<String,ServiceRef>();
}
return this.serviceRef.toMap();
}
public Collection<ResourceRef> getResourceRef() {
if (resourceRef == null) {
resourceRef = new KeyedCollection<String,ResourceRef>();
}
return this.resourceRef;
}
public Map<String,ResourceRef> getResourceRefMap() {
if (resourceRef == null) {
resourceRef = new KeyedCollection<String,ResourceRef>();
}
return this.resourceRef.toMap();
}
public Collection<ResourceEnvRef> getResourceEnvRef() {
if (resourceEnvRef == null) {
resourceEnvRef = new KeyedCollection<String,ResourceEnvRef>();
}
return this.resourceEnvRef;
}
public Map<String,ResourceEnvRef> getResourceEnvRefMap() {
if (resourceEnvRef == null) {
resourceEnvRef = new KeyedCollection<String,ResourceEnvRef>();
}
return this.resourceEnvRef.toMap();
}
public Collection<MessageDestinationRef> getMessageDestinationRef() {
if (messageDestinationRef == null) {
messageDestinationRef = new KeyedCollection<String,MessageDestinationRef>();
}
return this.messageDestinationRef;
}
public Map<String,MessageDestinationRef> getMessageDestinationRefMap() {
if (messageDestinationRef == null) {
messageDestinationRef = new KeyedCollection<String,MessageDestinationRef>();
}
return this.messageDestinationRef.toMap();
}
public Collection<PersistenceContextRef> getPersistenceContextRef() {
if (persistenceContextRef == null) {
persistenceContextRef = new KeyedCollection<String,PersistenceContextRef>();
}
return this.persistenceContextRef;
}
public Map<String,PersistenceContextRef> getPersistenceContextRefMap() {
if (persistenceContextRef == null) {
persistenceContextRef = new KeyedCollection<String,PersistenceContextRef>();
}
return this.persistenceContextRef.toMap();
}
public Collection<PersistenceUnitRef> getPersistenceUnitRef() {
if (persistenceUnitRef == null) {
persistenceUnitRef = new KeyedCollection<String,PersistenceUnitRef>();
}
return this.persistenceUnitRef;
}
public Map<String,PersistenceUnitRef> getPersistenceUnitRefMap() {
if (persistenceUnitRef == null) {
persistenceUnitRef = new KeyedCollection<String,PersistenceUnitRef>();
}
return this.persistenceUnitRef.toMap();
}
public List<LifecycleCallback> getPostConstruct() {
if (postConstruct == null) {
postConstruct = new ArrayList<LifecycleCallback>();
}
return this.postConstruct;
}
public List<LifecycleCallback> getPreDestroy() {
if (preDestroy == null) {
preDestroy = new ArrayList<LifecycleCallback>();
}
return this.preDestroy;
}
public List<MessageDestination> getMessageDestination() {
if (messageDestination == null) {
messageDestination = new ArrayList<MessageDestination>();
}
return this.messageDestination;
}
public String getId() {
return id;
}
public void setId(String value) {
this.id = value;
}
public Boolean isMetadataComplete() {
return metadataComplete != null && metadataComplete;
}
public void setMetadataComplete(Boolean value) {
this.metadataComplete = value;
}
public String getVersion() {
return version;
}
public void setVersion(String value) {
this.version = value;
}
}