KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > api > ejbjar > EnterpriseReferenceContainer


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.j2ee.api.ejbjar;
21
22 import java.io.IOException JavaDoc;
23 import org.netbeans.api.project.ant.AntArtifact;
24 import org.netbeans.modules.j2ee.dd.api.common.EjbLocalRef;
25 import org.netbeans.modules.j2ee.dd.api.common.EjbRef;
26 import org.netbeans.modules.j2ee.dd.api.common.MessageDestinationRef;
27 import org.netbeans.modules.j2ee.dd.api.common.ResourceRef;
28 import org.openide.filesystems.FileObject;
29
30 /**
31  * Instances of this class should be supplied by projects to indicate that
32  * enterprise resources (J2EE declarative resources such as DataSources,
33  * Enterprise JavaBeans, and JMS queues and topics) can be used. This
34  * class will be invoked to incorporate this resource into the J2EE project.
35  * This api is current experimental and subject to change.
36  * @author Chris Webster
37  */

38 public interface EnterpriseReferenceContainer {
39     
40     /**
41      * Add given ejb reference into deployment descriptor. This method should
42      * also ensure that the supplied target is added to the class path (as the
43      * ejb interfaces will be referenced from this class) as well as the
44      * deployed manifest. The deployed manifest is the generic J2EE compliant
45      * strategy, application server specific behavior such as delegating to the
46      * parent class loader could also be used. The main point is not to
47      * include the target in the deployed archive but instead reference the
48      * interface jar (or standard ejb module) included in the J2EE application.
49      * @param ref -- ejb reference this will include the ejb link which assumes
50      * root packaging in the containing application. The name of this ref should
51      * be considered a hint and made unique within the deployment descriptor.
52      * @param referencedClassName -- name of referenced class, this can be used
53      * to determine where to add the deployment descriptor entry. This class
54      * will be modified with a method or other strategy to obtain the ejb.
55      * @param target to include in the build
56      * @return actual jndi name used in deployment descriptor
57      */

58     String JavaDoc addEjbReference(EjbRef ref, FileObject referencingFile, String JavaDoc referencingClass, AntArtifact target) throws IOException JavaDoc;
59     
60     /**
61      * @see #addEjbReference(EjbRef, FileObject, String, AntArtifact)
62      */

63     String JavaDoc addEjbLocalReference(EjbLocalRef localRef, FileObject referencingFile, String JavaDoc referencingClass, AntArtifact target) throws IOException JavaDoc;
64     
65     /**
66      * @return name of the service locator defined for this project or null
67      * if service locator is not being used
68      */

69     String JavaDoc getServiceLocatorName();
70     
71     /**
72      * set name of service locator fo this project.
73      * @param serviceLocator used in this project
74      */

75     void setServiceLocatorName(String JavaDoc serviceLocator) throws IOException JavaDoc;
76     
77     /**
78      * Add given message destination reference into the deployment descriptor
79      * @param ref to destination
80      * @param referencingClass class using the destination
81      * @return unique jndi name used in the deployment descriptor
82      */

83     String JavaDoc addDestinationRef(MessageDestinationRef ref, FileObject referencingFile, String JavaDoc referencingClass) throws IOException JavaDoc;
84
85     MessageDestinationRef createDestinationRef(String JavaDoc className) throws IOException JavaDoc;
86     
87     /**
88      * Add given resource reference into the deployment descriptor.
89      * @param ref reference to resource used
90      * @param referencingClass class which will use the resource
91      * @return unique jndi name used in deployment descriptor
92      */

93     String JavaDoc addResourceRef(ResourceRef ref, FileObject referencingFile, String JavaDoc referencingClass) throws IOException JavaDoc;
94     
95     /**
96      * Create resource ref instance based on current project type.
97      * @param className to determine context from
98      */

99     ResourceRef createResourceRef(String JavaDoc className) throws IOException JavaDoc;
100 }
101
Popular Tags