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.geronimo.j2ee.deployment.annotation;
017:
018: import java.util.List;
019:
020: import org.apache.geronimo.xbeans.javaee.EjbLocalRefType;
021: import org.apache.geronimo.xbeans.javaee.EjbRefType;
022: import org.apache.geronimo.xbeans.javaee.EnvEntryType;
023: import org.apache.geronimo.xbeans.javaee.LifecycleCallbackType;
024: import org.apache.geronimo.xbeans.javaee.MessageDestinationRefType;
025: import org.apache.geronimo.xbeans.javaee.PersistenceContextRefType;
026: import org.apache.geronimo.xbeans.javaee.PersistenceUnitRefType;
027: import org.apache.geronimo.xbeans.javaee.ResourceEnvRefType;
028: import org.apache.geronimo.xbeans.javaee.ResourceRefType;
029: import org.apache.geronimo.xbeans.javaee.ServiceRefType;
030:
031: /**
032: * Many of the classes generated from the JEE schemas have methods with identical signatures (see
033: * examples below). This interface can be used to encapsulate those methods so that the various
034: * AnnotationHelper classes can use the same code for multiple application types (e.g. WebAppType,
035: * ApplicationClientType, etc).
036: * <p/>
037: * <p><strong>Example(s):</strong>
038: * <pre>
039: * public interface ApplicationClientType extends org.apache.xmlbeans.XmlObject {
040: * org.apache.geronimo.xbeans.javaee.EnvEntryType[] getEnvEntryArray();
041: * org.apache.geronimo.xbeans.javaee.ResourceRefType[] getResourceRefArray();
042: * }
043: * <p/>
044: * public interface WebAppType extends org.apache.xmlbeans.XmlObject {
045: * org.apache.geronimo.xbeans.javaee.EnvEntryType[] getEnvEntryArray();
046: * org.apache.geronimo.xbeans.javaee.ResourceRefType[] getResourceRefArray();
047: * }
048: * </pre>
049: * <p/>
050: * <p><strong>Remaining ToDo(s):</strong>
051: * <ul>
052: * <li>None
053: * </ul>
054: *
055: * @version $Rev $Date
056: * @since Geronimo 2.0
057: */
058: public interface AnnotatedApp {
059:
060: /**
061: * XmlBeans methods used for the @EJB, @EJBs annotations
062: */
063: EjbLocalRefType[] getEjbLocalRefArray();
064:
065: EjbLocalRefType addNewEjbLocalRef();
066:
067: EjbRefType[] getEjbRefArray();
068:
069: EjbRefType addNewEjbRef();
070:
071: /**
072: * XmlBeans methods used for the @Resource, @Resources annotations
073: */
074: EnvEntryType[] getEnvEntryArray();
075:
076: EnvEntryType addNewEnvEntry();
077:
078: ServiceRefType[] getServiceRefArray();
079:
080: ServiceRefType addNewServiceRef();
081:
082: ResourceRefType[] getResourceRefArray();
083:
084: ResourceRefType addNewResourceRef();
085:
086: MessageDestinationRefType[] getMessageDestinationRefArray();
087:
088: MessageDestinationRefType addNewMessageDestinationRef();
089:
090: ResourceEnvRefType[] getResourceEnvRefArray();
091:
092: ResourceEnvRefType addNewResourceEnvRef();
093:
094: /**
095: * ApplicationType getter in string format
096: *
097: * @return String representation of ApplicationType
098: */
099: String toString();
100:
101: /**
102: * ambiguousRefs getter
103: * <p/>
104: * <p>There is no corresponding setter method. To add a new item to the list do this:
105: * <p/>
106: * <pre>
107: * getAmbiguousEjbRefs().add(ejbRef);
108: * </pre>
109: *
110: * @return ambiguousRefs list
111: */
112: List<EjbRefType> getAmbiguousEjbRefs();
113:
114: LifecycleCallbackType[] getPostConstructArray();
115:
116: LifecycleCallbackType addPostConstruct();
117:
118: LifecycleCallbackType[] getPreDestroyArray();
119:
120: LifecycleCallbackType addPreDestroy();
121:
122: PersistenceContextRefType[] getPersistenceContextRefArray();
123:
124: PersistenceContextRefType addNewPersistenceContextRef();
125:
126: PersistenceUnitRefType[] getPersistenceUnitRefArray();
127:
128: PersistenceUnitRefType addNewPersistenceUnitRef();
129:
130: String getComponentType();
131: }
|