KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openejb > DeploymentInfo


1 /**
2  * Redistribution and use of this software and associated documentation
3  * ("Software"), with or without modification, are permitted provided
4  * that the following conditions are met:
5  *
6  * 1. Redistributions of source code must retain copyright
7  * statements and notices. Redistributions must also contain a
8  * copy of this document.
9  *
10  * 2. Redistributions in binary form must reproduce the
11  * above copyright notice, this list of conditions and the
12  * following disclaimer in the documentation and/or other
13  * materials provided with the distribution.
14  *
15  * 3. The name "Exolab" must not be used to endorse or promote
16  * products derived from this Software without prior written
17  * permission of Exoffice Technologies. For written permission,
18  * please contact info@exolab.org.
19  *
20  * 4. Products derived from this Software may not be called "Exolab"
21  * nor may "Exolab" appear in their names without prior written
22  * permission of Exoffice Technologies. Exolab is a registered
23  * trademark of Exoffice Technologies.
24  *
25  * 5. Due credit should be given to the Exolab Project
26  * (http://www.exolab.org/).
27  *
28  * THIS SOFTWARE IS PROVIDED BY EXOFFICE TECHNOLOGIES AND CONTRIBUTORS
29  * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
30  * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
31  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
32  * EXOFFICE TECHNOLOGIES OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
33  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
37  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
39  * OF THE POSSIBILITY OF SUCH DAMAGE.
40  *
41  * Copyright 1999 (C) Exoffice Technologies Inc. All Rights Reserved.
42  *
43  * $Id: DeploymentInfo.java 1921 2005-06-19 22:40:34Z jlaskowski $
44  */

45
46
47 package org.openejb;
48
49
50 import java.lang.reflect.Method JavaDoc;
51
52 /**
53  * The DeploymentInfo object represents all the data needed by other parts of
54  * the container system for a bean that is deployed in the container system.
55  * Bean's that are deployed in the container system are refered to as bean
56  * deployments or deployments. Each bean deployment will have its own DeploymentInfo
57  * object to represent much of the information that was provided to the container by
58  * the bean's EJB XML deployment descriptor or by the Deployer at the time of deployment.
59  *
60  * @see org.openejb.core.DeploymentInfo
61  */

62 public interface DeploymentInfo {
63     
64     /**
65      * The constant that will be returned from the <code>getTransactionAttribute</code>
66      * method if the bean's method has the transaction attribute of Never.
67      * @see #getTransactionAttribute(Method)
68      * @see "See section <i>11.6.2.6 Never</i> of the EJB 1.1 specification"
69      */

70     final public static byte TX_NEVER = (byte)0;
71     
72     /**
73      * The constant that will be returned from the <code>getTransactionAttribute</code>
74      * method if the bean's method has the transaction attribute of NotSupported.
75      * @see #getTransactionAttribute(Method)
76      * @see "See section <i>11.6.2.1 NotSupported</i> of the EJB 1.1 specification"
77      */

78     final public static byte TX_NOT_SUPPORTED = (byte)1;
79     
80     /**
81      * The constant that will be returned from the <code>getTransactionAttribute</code>
82      * method if the bean's method has the transaction attribute of Supports.
83      * @see #getTransactionAttribute(Method)
84      * @see "See section <i>11.6.2.3 Supports</i> of the EJB 1.1 specification"
85      */

86     final public static byte TX_SUPPORTS = (byte)2;
87     
88     /**
89      * The constant that will be returned from the <code>getTransactionAttribute</code>
90      * method if the bean's method has the transaction attribute of Manditory.
91      * @see #getTransactionAttribute(Method)
92      * @see "See section <i>11.6.2.5 Manditory</i> of the EJB 1.1 specification"
93      */

94     final public static byte TX_MANDITORY = (byte)3;
95     
96     /**
97      * The constant that will be returned from the <code>getTransactionAttribute</code>
98      * method if the bean's method has the transaction attribute of Required.
99      * @see #getTransactionAttribute(Method)
100      * @see "See section <i>11.6.2.2 Required</i> of the EJB 1.1 specification"
101      */

102     final public static byte TX_REQUIRED = (byte)4;
103     
104     /**
105      * The constant that will be returned from the <code>getTransactionAttribute</code>
106      * method if the bean's method has the transaction attribute of RequiresNew.
107      * @see #getTransactionAttribute(Method)
108      * @see "See section <i>11.6.2.4 RequiresNew</i> of the EJB 1.1 specification"
109      */

110     final public static byte TX_REQUIRES_NEW = (byte)5;
111     
112     /**
113      * The constant that will be returned from the <code>getComponentType</code>
114      * method if this bean is a stateful session bean.
115      * @see #getComponentType
116      */

117     final public static byte STATEFUL = (byte)6;
118
119     /**
120      * The constant that will be returned from the <code>getComponentType</code>
121      * method if this bean is a stateless session bean.
122      * @see #getComponentType
123      */

124     final public static byte STATELESS = (byte)7;
125
126     /**
127      * The constant that will be returned from the <code>getComponentType</code>
128      * method if this bean is an enitity bean with bean-managed persistence.
129      * @see #getComponentType
130      */

131     final public static byte BMP_ENTITY = (byte)8;
132
133     /**
134      * The constant that will be returned from the <code>getComponentType</code>
135      * method if this bean is a enitity bean with container-managed persistence.
136      * @see #getComponentType
137      */

138     final public static byte CMP_ENTITY = (byte)9;
139     
140     /**
141      * The constant that will be returned from the <code>getComponentType</code>
142      * method if this bean is a message-driven bean.
143      * @see #getComponentType
144      */

145     final public static byte MESSAGE_DRIVEN = (byte)10;
146     
147     final public static String JavaDoc AC_CREATE_EJBHOME = "create.ejbhome";
148
149     /**
150      * Gets the type of this bean component.
151      * Will return a <code>STATEFUL</code>, <code>STATELESS</code>, <code>BMP_ENTITY</code> or <code>CMP_ENTITY</code>.
152      *
153      * @return Returns <code>STATEFUL</code>, <code>STATELESS</code>, <code>BMP_ENTITY</code> or <code>CMP_ENTITY</code>.
154      * @see #STATEFUL
155      * @see #STATELESS
156      * @see #BMP_ENTITY
157      * @see #CMP_ENTITY
158      */

159     public byte getComponentType( );
160     
161     
162     /**
163      * Gets the transaction attribute that must be applied to this method when executing.
164      *
165      * The type can be anyone of <code>TX_NEVER</code>, <code>TX_NOT_SUPPORTED</code>, <code>TX_SUPPORTS</code>, <code>TX_MANDITORY</code>, <code>TX_REQUIRED</code>, <code>TX_REQUIRES_NEW</code>,
166      *
167      * @param method the bean's method for which transaction attribute information is needed
168      * @return the transaction constant that states the method's transaction attribute
169      * @see #TX_NEVER
170      * @see #TX_NOT_SUPPORTED
171      * @see #TX_SUPPORTS
172      * @see #TX_MANDITORY
173      * @see #TX_REQUIRED
174      * @see #TX_REQUIRES_NEW
175      */

176     public byte getTransactionAttribute(Method JavaDoc method);
177
178     /**
179      * Gets the roles that are authorised to execute this method.
180      *
181      * Used primarily by the container to check the caller's rights to
182      * access and execute the specifed method.
183      *
184      * @param method the bean's method for which security information is needed
185      * @return a String array of the roles that are authorised to execute this method
186      * @see org.openejb.spi.SecurityService#isCallerAuthorized
187      */

188     public String JavaDoc [] getAuthorizedRoles(Method JavaDoc method);
189
190     public String JavaDoc [] getAuthorizedRoles(String JavaDoc action);
191
192     /**
193      * Gets the id of the container this deployed bean is in.
194      *
195      * @return the id of the deployment's container.
196      * @see Container#getContainerID() Container.getContainerID()
197      */

198     public Container getContainer( );
199     
200
201     /**
202      * Gets the id of this bean deployment.
203      *
204      * @return the id of of this bean deployment
205      */

206     public Object JavaDoc getDeploymentID( );
207
208     /**
209      * Returns true if this bean deployment has chosen bean-managed transaction demarcation.
210      * Returns false if the continer will be managing the bean's transactions.
211      *
212      * @return Returns true if this bean deployment is managing its own transactions.
213      */

214     public boolean isBeanManagedTransaction();
215     
216     /**
217      * Gets the home interface for the bean deployment.
218      *
219      * Used primarily by Servers integrating OpenEJB into their platform. Aids in implementing
220      * the bean's home interface.
221      *
222      * @return a Class object of the bean's home interface
223      * @see javax.ejb.EJBHome
224      */

225     public Class JavaDoc getHomeInterface( );
226     public Class JavaDoc getLocalHomeInterface( );
227     public Class JavaDoc getLocalInterface( );
228     
229     /**
230      * Gets the remote interface for the bean deployment.
231      *
232      * Used primarily by Servers integrating OpenEJB into their platform. Aids in implementing
233      * the bean's remote interface.
234      *
235      * @return a Class object of the bean's remote interface
236      * @see javax.ejb.EJBObject
237      */

238     public Class JavaDoc getRemoteInterface( );
239
240     /**
241      * Gets the bean's class definition.
242      *
243      * Used primarily by containers to instantiate new instances of a bean.
244      *
245      * @return a Class object of the bean's class definition
246      * @see javax.ejb.EnterpriseBean
247      */

248     public Class JavaDoc getBeanClass( );
249
250     /**
251      * Gets the Class type of the primary key for this bean deployment.
252      * Returns null if the bean is a type that does not need a primary key.
253      *
254      * @return the Class type of the bean's primary key or null if the bean doesn't need a primary key
255      */

256     public Class JavaDoc getPrimaryKeyClass( );
257     
258     /**
259     * Useful for Container-Managed Persistence (CMP) Entity beans with Simple Primary Keys.
260     * Gets the Field of the CMP entity bean class which corresponds to the simple
261     * primary key. Entity beans that have complex primary keys (keys with several fields)
262     * will not have a primkey-field.
263     *
264     * @return the EntityBean field that corresponds to the simple primary key.
265     * return null if the bean is not a CMP Entity bean with a simple Primary key
266     *
267     */

268     public java.lang.reflect.Field JavaDoc getPrimaryKeyField( );
269     
270     
271     /**
272     * Useful for Container-Managed Persistence (CMP) Entity beans. Returns true
273     * if entity allows reentrant. Session bean types will always return false;
274     *
275     * @return true if entity bean allows reentrant access
276     *
277     */

278     public boolean isReentrant();
279     
280     
281 }
282
Popular Tags