KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > ejb > codegen > CMPGenerator


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 package com.sun.ejb.codegen;
25
26 import java.io.File JavaDoc;
27 import java.util.Collection JavaDoc;
28
29 import com.sun.enterprise.deployment.*;
30
31 /**
32  * This interface must be implemented by all CMP code generators.
33  */

34
35 public interface CMPGenerator {
36
37     /**
38      * This method is called once for each ejb module in the application
39      * that contains CMP beans.
40      * Only one #init() method can be called.
41      * @deprecated
42      * This method is not used by the deployment back end, and should be removed
43      * as soon as the TestFramework is fixed.
44      * @param ejbBundleDescriptor the EjbBundleDescriptor associated with this
45      * ejb module.
46      * @param cl the ClassLoader that loaded user defined classes.
47      * @param bundlePathName full path to the directory where this bundle's
48      * files are located.
49      * @throws GeneratorException if there is a problem initializing bean
50      * processing.
51      */

52     void init(EjbBundleDescriptor ejbBundleDescriptor, ClassLoader JavaDoc cl,
53         String JavaDoc bundlePathName) throws GeneratorException;
54
55     /**
56      * This method is called once for each ejb module in the application
57      * that contains CMP beans.
58      * Only one #init() method can be called.
59      * @param ejbBundleDescriptor the EjbBundleDescriptor associated with this
60      * ejb module.
61      * @param ctx the EjbcContext associated with the deployment request.
62      * @param bundlePathName full path to the directory where this bundle's
63      * files are located.
64      * @param generatedXmlsPathName full path to the directory where the
65      * generated files are located.
66      * @throws GeneratorException if there is a problem initializing bean
67      * processing.
68      */

69     void init(EjbBundleDescriptor ejbBundleDescriptor, EjbcContext ctx,
70         String JavaDoc bundlePathName, String JavaDoc generatedXmlsPathName)
71             throws GeneratorException;
72
73     /**
74      * This method is called once for each CMP bean of the corresponding ejb module.
75      * @param descr the IASEjbCMPEntityDescriptor associated with this CMP bean.
76      * @param srcout the location of the source files to be generated.
77      * @param classout the location of the class files to be generated.
78      * @throws GeneratorException if there is a problem processing the bean.
79      */

80     void generate(IASEjbCMPEntityDescriptor descr, File JavaDoc srcout, File JavaDoc classout)
81         throws GeneratorException;
82
83     /**
84      * This method is called once for each ejb module in the application
85      * that contains CMP beans. It is called at the end of the module processing.
86      * @return a Collection of files to be compiled by the deployment process.
87      * @throws GeneratorException if there is any problem.
88      */

89     Collection JavaDoc cleanup() throws GeneratorException;
90
91     /**
92      * This method may be called once for each CMP bean of the corresponding
93      * ejb module to perform the validation.
94      * @param descr the IASEjbCMPEntityDescriptor associated with this CMP bean.
95      * @return a Collection of Exceptions if there are any problems processing the bean.
96      * Returns an empty Collection if validation succeeds.
97      */

98     Collection JavaDoc validate(IASEjbCMPEntityDescriptor descr);
99
100 }
101
Popular Tags