Save This Page
Home » openejb-3.1.2-src » org.apache » openejb » jee » [javadoc | source]
    1   /**
    2    *
    3    * Licensed to the Apache Software Foundation (ASF) under one or more
    4    * contributor license agreements.  See the NOTICE file distributed with
    5    * this work for additional information regarding copyright ownership.
    6    * The ASF licenses this file to You under the Apache License, Version 2.0
    7    * (the "License"); you may not use this file except in compliance with
    8    * the License.  You may obtain a copy of the License at
    9    *
   10    *     http://www.apache.org/licenses/LICENSE-2.0
   11    *
   12    *  Unless required by applicable law or agreed to in writing, software
   13    *  distributed under the License is distributed on an "AS IS" BASIS,
   14    *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   15    *  See the License for the specific language governing permissions and
   16    *  limitations under the License.
   17    */
   18   package org.apache.openejb.jee;
   19   
   20   import javax.xml.bind.annotation.XmlAccessType;
   21   import javax.xml.bind.annotation.XmlAccessorType;
   22   import javax.xml.bind.annotation.XmlAttribute;
   23   import javax.xml.bind.annotation.XmlElement;
   24   import javax.xml.bind.annotation.XmlID;
   25   import javax.xml.bind.annotation.XmlRootElement;
   26   import javax.xml.bind.annotation.XmlTransient;
   27   import javax.xml.bind.annotation.XmlType;
   28   import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
   29   import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
   30   import java.util.ArrayList;
   31   import java.util.List;
   32   import java.util.Collection;
   33   import java.util.Map;
   34   
   35   @XmlRootElement(name = "web-app")
   36   @XmlAccessorType(XmlAccessType.FIELD)
   37   @XmlType(name = "web-appType", propOrder = {
   38           "descriptions",
   39           "displayNames",
   40           "icon",
   41           "distributable",
   42           "contextParam",
   43           "filter",
   44           "filterMapping",
   45           "listener",
   46           "servlet",
   47           "servletMapping",
   48           "sessionConfig",
   49           "mimeMapping",
   50           "welcomeFileList",
   51           "errorPage",
   52           "jspConfig",
   53           "securityConstraint",
   54           "loginConfig",
   55           "securityRole",
   56           "localeEncodingMappingList",
   57           "envEntry",
   58           "ejbRef",
   59           "ejbLocalRef",
   60           "serviceRef",
   61           "resourceRef",
   62           "resourceEnvRef",
   63           "messageDestinationRef",
   64           "persistenceContextRef",
   65           "persistenceUnitRef",
   66           "postConstruct",
   67           "preDestroy",
   68           "messageDestination"
   69   })
   70   public class WebApp implements JndiConsumer {
   71       @XmlTransient
   72       private String contextRoot;
   73   
   74       @XmlTransient
   75       protected TextMap description = new TextMap();
   76       @XmlTransient
   77       protected TextMap displayName = new TextMap();
   78       @XmlElement(name = "icon", required = true)
   79       protected LocalCollection<Icon> icon = new LocalCollection<Icon>();
   80   
   81       protected List<EmptyType> distributable;
   82       @XmlElement(name = "context-param")
   83       protected List<ParamValue> contextParam;
   84       protected List<Filter> filter;
   85       @XmlElement(name = "filter-mapping")
   86       protected List<FilterMapping> filterMapping;
   87       protected List<Listener> listener;
   88       protected List<Servlet> servlet;
   89       @XmlElement(name = "servlet-mapping")
   90       protected List<ServletMapping> servletMapping;
   91       @XmlElement(name = "session-config")
   92       protected List<SessionConfig> sessionConfig;
   93       @XmlElement(name = "mime-mapping")
   94       protected List<MimeMapping> mimeMapping;
   95       @XmlElement(name = "welcome-file-list")
   96       protected List<WelcomeFileList> welcomeFileList;
   97       @XmlElement(name = "error-page")
   98       protected List<ErrorPage> errorPage;
   99       @XmlElement(name = "jsp-config")
  100       protected List<JspConfig> jspConfig;
  101       @XmlElement(name = "security-constraint")
  102       protected List<SecurityConstraint> securityConstraint;
  103       @XmlElement(name = "login-config")
  104       protected List<LoginConfigType> loginConfig;
  105       @XmlElement(name = "security-role")
  106       protected List<SecurityRole> securityRole;
  107       @XmlElement(name = "locale-encoding-mapping-list")
  108       protected List<LocaleEncodingMappingList> localeEncodingMappingList;
  109   
  110       @XmlElement(name = "env-entry", required = true)
  111       protected KeyedCollection<String,EnvEntry> envEntry;
  112       @XmlElement(name = "ejb-ref", required = true)
  113       protected KeyedCollection<String,EjbRef> ejbRef;
  114       @XmlElement(name = "ejb-local-ref", required = true)
  115       protected KeyedCollection<String,EjbLocalRef> ejbLocalRef;
  116       @XmlElement(name = "service-ref", required = true)
  117       protected KeyedCollection<String,ServiceRef> serviceRef;
  118       @XmlElement(name = "resource-ref", required = true)
  119       protected KeyedCollection<String,ResourceRef> resourceRef;
  120       @XmlElement(name = "resource-env-ref", required = true)
  121       protected KeyedCollection<String,ResourceEnvRef> resourceEnvRef;
  122       @XmlElement(name = "message-destination-ref", required = true)
  123       protected KeyedCollection<String,MessageDestinationRef> messageDestinationRef;
  124       @XmlElement(name = "persistence-context-ref", required = true)
  125       protected KeyedCollection<String,PersistenceContextRef> persistenceContextRef;
  126       @XmlElement(name = "persistence-unit-ref", required = true)
  127       protected KeyedCollection<String,PersistenceUnitRef> persistenceUnitRef;
  128       @XmlElement(name = "post-construct", required = true)
  129       protected List<LifecycleCallback> postConstruct;
  130       @XmlElement(name = "pre-destroy", required = true)
  131       protected List<LifecycleCallback> preDestroy;
  132   
  133       @XmlElement(name = "message-destination", required = true)
  134       protected List<MessageDestination> messageDestination;
  135   
  136   
  137       @XmlAttribute
  138       @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
  139       @XmlID
  140       protected String id;
  141       @XmlAttribute(name = "metadata-complete")
  142       protected Boolean metadataComplete;
  143       @XmlAttribute(required = true)
  144       @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
  145       protected String version;
  146   
  147   
  148   
  149   
  150       public String getJndiConsumerName() {
  151           return contextRoot;
  152       }
  153   
  154       public String getContextRoot() {
  155           return contextRoot;
  156       }
  157   
  158       public void setContextRoot(String contextRoot) {
  159           this.contextRoot = contextRoot;
  160       }
  161   
  162       @XmlElement(name = "description", required = true)
  163       public Text[] getDescriptions() {
  164           return description.toArray();
  165       }
  166   
  167       public void setDescriptions(Text[] text) {
  168           description.set(text);
  169       }
  170   
  171       public String getDescription() {
  172           return description.get();
  173       }
  174   
  175       @XmlElement(name = "display-name", required = true)
  176       public Text[] getDisplayNames() {
  177           return displayName.toArray();
  178       }
  179   
  180       public void setDisplayNames(Text[] text) {
  181           displayName.set(text);
  182       }
  183   
  184       public String getDisplayName() {
  185           return displayName.get();
  186       }
  187   
  188       public Collection<Icon> getIcons() {
  189           if (icon == null) {
  190               icon = new LocalCollection<Icon>();
  191           }
  192           return icon;
  193       }
  194   
  195       public Map<String,Icon> getIconMap() {
  196           if (icon == null) {
  197               icon = new LocalCollection<Icon>();
  198           }
  199           return icon.toMap();
  200       }
  201   
  202       public Icon getIcon() {
  203           return icon.getLocal();
  204       }
  205   
  206       public List<EmptyType> getDistributable() {
  207           if (distributable == null) {
  208               distributable = new ArrayList<EmptyType>();
  209           }
  210           return this.distributable;
  211       }
  212   
  213       public List<ParamValue> getContextParam() {
  214           if (contextParam == null) {
  215               contextParam = new ArrayList<ParamValue>();
  216           }
  217           return this.contextParam;
  218       }
  219   
  220       public List<Filter> getFilter() {
  221           if (filter == null) {
  222               filter = new ArrayList<Filter>();
  223           }
  224           return this.filter;
  225       }
  226   
  227       public List<FilterMapping> getFilterMapping() {
  228           if (filterMapping == null) {
  229               filterMapping = new ArrayList<FilterMapping>();
  230           }
  231           return this.filterMapping;
  232       }
  233   
  234       public List<Listener> getListener() {
  235           if (listener == null) {
  236               listener = new ArrayList<Listener>();
  237           }
  238           return this.listener;
  239       }
  240   
  241       public List<Servlet> getServlet() {
  242           if (servlet == null) {
  243               servlet = new ArrayList<Servlet>();
  244           }
  245           return this.servlet;
  246       }
  247   
  248       public List<ServletMapping> getServletMapping() {
  249           if (servletMapping == null) {
  250               servletMapping = new ArrayList<ServletMapping>();
  251           }
  252           return this.servletMapping;
  253       }
  254   
  255       public List<SessionConfig> getSessionConfig() {
  256           if (sessionConfig == null) {
  257               sessionConfig = new ArrayList<SessionConfig>();
  258           }
  259           return this.sessionConfig;
  260       }
  261   
  262       public List<MimeMapping> getMimeMapping() {
  263           if (mimeMapping == null) {
  264               mimeMapping = new ArrayList<MimeMapping>();
  265           }
  266           return this.mimeMapping;
  267       }
  268   
  269       public List<WelcomeFileList> getWelcomeFileList() {
  270           if (welcomeFileList == null) {
  271               welcomeFileList = new ArrayList<WelcomeFileList>();
  272           }
  273           return this.welcomeFileList;
  274       }
  275   
  276       public List<ErrorPage> getErrorPage() {
  277           if (errorPage == null) {
  278               errorPage = new ArrayList<ErrorPage>();
  279           }
  280           return this.errorPage;
  281       }
  282   
  283       public List<JspConfig> getJspConfig() {
  284           if (jspConfig == null) {
  285               jspConfig = new ArrayList<JspConfig>();
  286           }
  287           return this.jspConfig;
  288       }
  289   
  290       public List<SecurityConstraint> getSecurityConstraint() {
  291           if (securityConstraint == null) {
  292               securityConstraint = new ArrayList<SecurityConstraint>();
  293           }
  294           return this.securityConstraint;
  295       }
  296   
  297       public List<LoginConfigType> getLoginConfig() {
  298           if (loginConfig == null) {
  299               loginConfig = new ArrayList<LoginConfigType>();
  300           }
  301           return this.loginConfig;
  302       }
  303   
  304       public List<SecurityRole> getSecurityRole() {
  305           if (securityRole == null) {
  306               securityRole = new ArrayList<SecurityRole>();
  307           }
  308           return this.securityRole;
  309       }
  310   
  311       public List<LocaleEncodingMappingList> getLocaleEncodingMappingList() {
  312           if (localeEncodingMappingList == null) {
  313               localeEncodingMappingList = new ArrayList<LocaleEncodingMappingList>();
  314           }
  315           return this.localeEncodingMappingList;
  316       }
  317   
  318       public Collection<EnvEntry> getEnvEntry() {
  319           if (envEntry == null) {
  320               envEntry = new KeyedCollection<String,EnvEntry>();
  321           }
  322           return this.envEntry;
  323       }
  324   
  325       public Map<String,EnvEntry> getEnvEntryMap() {
  326           if (envEntry == null) {
  327               envEntry = new KeyedCollection<String,EnvEntry>();
  328           }
  329           return this.envEntry.toMap();
  330       }
  331   
  332       public Collection<EjbRef> getEjbRef() {
  333           if (ejbRef == null) {
  334               ejbRef = new KeyedCollection<String,EjbRef>();
  335           }
  336           return this.ejbRef;
  337       }
  338   
  339       public Map<String,EjbRef> getEjbRefMap() {
  340           if (ejbRef == null) {
  341               ejbRef = new KeyedCollection<String,EjbRef>();
  342           }
  343           return this.ejbRef.toMap();
  344       }
  345   
  346       public Collection<EjbLocalRef> getEjbLocalRef() {
  347           if (ejbLocalRef == null) {
  348               ejbLocalRef = new KeyedCollection<String,EjbLocalRef>();
  349           }
  350           return this.ejbLocalRef;
  351       }
  352   
  353       public Map<String,EjbLocalRef> getEjbLocalRefMap() {
  354           if (ejbLocalRef == null) {
  355               ejbLocalRef = new KeyedCollection<String,EjbLocalRef>();
  356           }
  357           return this.ejbLocalRef.toMap();
  358       }
  359   
  360       public Collection<ServiceRef> getServiceRef() {
  361           if (serviceRef == null) {
  362               serviceRef = new KeyedCollection<String,ServiceRef>();
  363           }
  364           return this.serviceRef;
  365       }
  366   
  367       public Map<String,ServiceRef> getServiceRefMap() {
  368           if (serviceRef == null) {
  369               serviceRef = new KeyedCollection<String,ServiceRef>();
  370           }
  371           return this.serviceRef.toMap();
  372       }
  373   
  374       public Collection<ResourceRef> getResourceRef() {
  375           if (resourceRef == null) {
  376               resourceRef = new KeyedCollection<String,ResourceRef>();
  377           }
  378           return this.resourceRef;
  379       }
  380   
  381       public Map<String,ResourceRef> getResourceRefMap() {
  382           if (resourceRef == null) {
  383               resourceRef = new KeyedCollection<String,ResourceRef>();
  384           }
  385           return this.resourceRef.toMap();
  386       }
  387   
  388       public Collection<ResourceEnvRef> getResourceEnvRef() {
  389           if (resourceEnvRef == null) {
  390               resourceEnvRef = new KeyedCollection<String,ResourceEnvRef>();
  391           }
  392           return this.resourceEnvRef;
  393       }
  394   
  395       public Map<String,ResourceEnvRef> getResourceEnvRefMap() {
  396           if (resourceEnvRef == null) {
  397               resourceEnvRef = new KeyedCollection<String,ResourceEnvRef>();
  398           }
  399           return this.resourceEnvRef.toMap();
  400       }
  401   
  402       public Collection<MessageDestinationRef> getMessageDestinationRef() {
  403           if (messageDestinationRef == null) {
  404               messageDestinationRef = new KeyedCollection<String,MessageDestinationRef>();
  405           }
  406           return this.messageDestinationRef;
  407       }
  408   
  409       public Map<String,MessageDestinationRef> getMessageDestinationRefMap() {
  410           if (messageDestinationRef == null) {
  411               messageDestinationRef = new KeyedCollection<String,MessageDestinationRef>();
  412           }
  413           return this.messageDestinationRef.toMap();
  414       }
  415   
  416       public Collection<PersistenceContextRef> getPersistenceContextRef() {
  417           if (persistenceContextRef == null) {
  418               persistenceContextRef = new KeyedCollection<String,PersistenceContextRef>();
  419           }
  420           return this.persistenceContextRef;
  421       }
  422   
  423       public Map<String,PersistenceContextRef> getPersistenceContextRefMap() {
  424           if (persistenceContextRef == null) {
  425               persistenceContextRef = new KeyedCollection<String,PersistenceContextRef>();
  426           }
  427           return this.persistenceContextRef.toMap();
  428       }
  429   
  430       public Collection<PersistenceUnitRef> getPersistenceUnitRef() {
  431           if (persistenceUnitRef == null) {
  432               persistenceUnitRef = new KeyedCollection<String,PersistenceUnitRef>();
  433           }
  434           return this.persistenceUnitRef;
  435       }
  436   
  437       public Map<String,PersistenceUnitRef> getPersistenceUnitRefMap() {
  438           if (persistenceUnitRef == null) {
  439               persistenceUnitRef = new KeyedCollection<String,PersistenceUnitRef>();
  440           }
  441           return this.persistenceUnitRef.toMap();
  442       }
  443   
  444       public List<LifecycleCallback> getPostConstruct() {
  445           if (postConstruct == null) {
  446               postConstruct = new ArrayList<LifecycleCallback>();
  447           }
  448           return this.postConstruct;
  449       }
  450   
  451       public List<LifecycleCallback> getPreDestroy() {
  452           if (preDestroy == null) {
  453               preDestroy = new ArrayList<LifecycleCallback>();
  454           }
  455           return this.preDestroy;
  456       }
  457   
  458       public List<MessageDestination> getMessageDestination() {
  459           if (messageDestination == null) {
  460               messageDestination = new ArrayList<MessageDestination>();
  461           }
  462           return this.messageDestination;
  463       }
  464   
  465       public String getId() {
  466           return id;
  467       }
  468   
  469       public void setId(String value) {
  470           this.id = value;
  471       }
  472   
  473       public Boolean isMetadataComplete() {
  474           return metadataComplete != null && metadataComplete;
  475       }
  476   
  477       public void setMetadataComplete(Boolean value) {
  478           this.metadataComplete = value;
  479       }
  480   
  481       public String getVersion() {
  482           return version;
  483       }
  484   
  485       public void setVersion(String value) {
  486           this.version = value;
  487       }
  488   
  489   }

Save This Page
Home » openejb-3.1.2-src » org.apache » openejb » jee » [javadoc | source]