KickJava   Java API By Example, From Geeks To Geeks.

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


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  * @(#) EjbcContext.java
26  *
27  */

28 package com.sun.ejb.codegen;
29
30 import java.io.File JavaDoc;
31 import java.util.*;
32
33 import com.sun.enterprise.deployment.backend.DeploymentMode;
34 import com.sun.enterprise.deployment.backend.DeploymentRequest;
35 import com.sun.enterprise.deployment.Application;
36
37
38 /**
39  * Ejbc runtime environment created by deployment backend. This class
40  * contains all the information needed by ejbc for a particular deployment.
41  *
42  * @author Nazrul Islam
43  * @since JDK 1.4
44  */

45 public interface EjbcContext {
46
47     /**
48      * Returns the current directory where the archive has been exploded.
49      *
50      * @return the directory where the archive has been exploded
51      */

52     public File JavaDoc getSrcDir();
53
54     /**
55      * Returns the old directory where the ear file was exploded (in case
56      * of redeployment) or null.
57      *
58      * @return old directory where the ear file was exploded or null
59      */

60     public File JavaDoc getOldSrcDir();
61
62     /**
63      * Returns the (current stubs) directory where all the code is
64      * generated and being compiled for this archive.
65      *
66      * @return the current stubs directory for this archive
67      */

68     public File JavaDoc getStubsDir();
69
70     /**
71      * Returns the (old stubs) directory where generated code from
72      * previous deployment can be found in case of redeployment.
73      *
74      * @return in case of redeployment, the old stubs directory or null
75      */

76     public File JavaDoc getOldStubsDir();
77
78     /**
79      * Returns the object representation of the deployment descriptor
80      * for the current archive.
81      *
82      * @return the deployment descriptor for the current archive
83      */

84     public Application getDescriptor();
85
86     /**
87      * Returns true when the archive is being redeployed.
88      *
89      * @return true when the archive is being redeployed
90      */

91     public boolean isRedeploy();
92
93     /**
94      * Return a class loader capable of loading classes from the old
95      * repository for this app. This will only include the application
96      * classes, not the generated(e.g. stub) classes.
97      */

98     public ClassLoader JavaDoc getOldClassLoader();
99
100     /**
101      * Returns the class paths need by this archive to compile the
102      * generated src.
103      *
104      * @return the class paths used by javac & rmic for this archive
105      */

106     public String JavaDoc[] getClasspathUrls();
107
108     /**
109      * Returns the ejb class paths of this archive.
110      *
111      * @return the ejb class paths for this archive
112      */

113     public String JavaDoc[] getEjbClasspathUrls();
114
115     /**
116      * Returns the RMIC options as defined in the instance's server
117      * configuration.
118      *
119      * @return the RMIC options
120      */

121     public List getRmicOptions();
122
123     /**
124      * Returns the JAVAC options as defined in the instance's server
125      * configuration.
126      *
127      * @return the JAVAC options
128      */

129     public List getJavacOptions();
130
131     /**
132      * Returns the timing information for the sub-tasks of ejbc.
133      *
134      * @return timing information for the sub-tasks of ejbc
135      */

136     public IASEJBCTimes getTiming();
137
138     /**
139      * Returns the deployment mode, i.e., archive layout.
140      *
141      * @return deployment mode
142      */

143     public DeploymentMode getDeploymentMode();
144     /**
145      * Returns the optional arguments - which currently consists of
146      * CMP-specific deployment arguments
147      *
148      * @return optional attributes
149      */

150     public Properties getOptionalArguments();
151     /**
152      * Returns the original DeploymentRequest object for the current deployment
153      *
154      * @return Deployment Request object
155      */

156     public DeploymentRequest getDeploymentRequest();
157     
158     /**
159      * Release any resources that are no longer needed, e.g.
160      * the class loader for the old repository during a redeployment.
161      */

162     public void cleanup();
163 }
164
Popular Tags