KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jdo > api > persistence > mapping > ejb > EJBInfoHelper


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * EJBInfoHelper.java
26  *
27  * Created on October 15, 2004, 12:51 PM
28  */

29
30 package com.sun.jdo.api.persistence.mapping.ejb;
31
32 import java.util.Collection JavaDoc;
33
34 import org.netbeans.modules.dbschema.SchemaElement;
35
36 import com.sun.jdo.api.persistence.model.Model;
37
38 /** This is an interface which represents information found in the
39  * ejb-jar.xml descriptor and provides a variety of other information
40  * and helper objects needed to do mapping and generating of ejb related
41  * things in persistence.
42  *
43  * @author Rochelle Raccah
44  */

45 public interface EJBInfoHelper
46 {
47     /** Gets the name of the ejb jar.
48      * @return the name of the ejb jar
49      */

50     public String JavaDoc getEjbJarDisplayName ();
51
52     /** Gets a collection of names of schemas defined in this
53      * ejb jar.
54      * @return a collection schema names
55      */

56     public Collection JavaDoc getAvailableSchemaNames ();
57
58     /** Gets the name to use for schema generation. An example might be
59      * a combo of app name, module name, etc.
60      * @return the name to use for schema generation
61      */

62     public String JavaDoc getSchemaNameToGenerate ();
63
64     /** Gets the schema with the specified name, loading it if necessary.
65      * @param schemaName the name of the schema to be loaded
66      * @return the schema object
67      */

68     public SchemaElement getSchema (String JavaDoc schemaName);
69
70     /** Gets a collection of names of cmp entity beans defined in this
71      * ejb jar.
72      * @return a collection cmp ejb names
73      */

74     public Collection JavaDoc getEjbNames ();
75
76     /** Gets a collection of names of cmp fields and cmr fields defined in
77      * this ejb jar for the specified ejb.
78      * @param ejbName the name of the ejb for which a list of fields
79      * will be created
80      * @return a collection cmp and cmr field names
81      */

82     public Collection JavaDoc getFieldsForEjb (String JavaDoc ejbName);
83
84     /** Gets a collection of names of cmr fields defined in
85      * this ejb jar for the specified ejb.
86      * @param ejbName the name of the ejb for which a list of cmr fields
87      * will be created
88      * @return a collection cmr field names
89      */

90     public Collection JavaDoc getRelationshipsForEjb (String JavaDoc ejbName);
91
92     /** Gets the class loader which corresponds to this ejb jar.
93      * Implementations can return <code>null</code> if this is not
94      * relevant.
95      * @return the class loader which corresponds to this ejb jar
96      */

97     public ClassLoader JavaDoc getClassLoader ();
98
99     /** Gets the AbstractNameMapper object to use for this helper.
100      * @return the name mapper object
101      */

102     public AbstractNameMapper getNameMapper ();
103
104     /** Creates and returns an instance of the AbstractNameMapper object to
105      * use for generation of unique names with this helper. Unique names
106      * usually means that the mapper doesn't use the same jdo and ejb names.
107      * Note that this method is a factory-like method which creates a new
108      * instance so the caller can make modifications to it as necessary.
109      * @return the name mapper object
110      */

111     public AbstractNameMapper createUniqueNameMapper ();
112
113     /** Creates and returns an instance of the ConversionHelper object to
114      * use for this helper. Note that this method is a factory-like method
115      * which creates a new instance so the caller can make modifications to
116      * it as necessary.
117      * @return the conversion helper object
118      */

119     public ConversionHelper createConversionHelper ();
120
121     /** Gets the Model object to use for this helper.
122      * @return the model object
123      */

124     public Model getModel ();
125 }
126
Popular Tags