KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > container > EJBService


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999-2005 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: EJBService.java,v 1.20 2005/07/28 13:35:38 durieuxp Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.container;
27
28 import java.net.URL JavaDoc;
29
30 import javax.naming.Context JavaDoc;
31
32 import org.objectweb.jonas_ejb.container.Container;
33 import org.objectweb.jonas_lib.JWorkManager;
34
35 import org.objectweb.jonas.service.Service;
36 import org.objectweb.jonas.service.ServiceException;
37
38 /**
39  * EJB Service interface.
40  */

41 public interface EJBService extends Service {
42
43     /**
44      * Create a JOnAS Container for all the beans that are described in a .xml file,
45      * or belong to .jar file.
46      * @param ctx JNDI context in which is found the container configuration.
47      * @return The ObjectName of the MBean associated to the container (i.e. to the deployed module)
48      */

49     String JavaDoc createContainer(Context JavaDoc ctx) throws Exception JavaDoc;
50
51     String JavaDoc createContainer(String JavaDoc fileName) throws Exception JavaDoc;
52
53     /**
54      * Test if the specified file is already deployed (if a container
55      * is created for this jar).
56      * @param fileName the name of the jar file
57      * @return true if the jar was deployed, false otherwise
58      */

59     Boolean JavaDoc isJarDeployed(String JavaDoc fileName);
60
61     /**
62      * Test if the specified jar identified with its work name is already deployed
63      * (if a container is created for this jar).
64      * @param workFileName the internal name of the jar file (working copy)
65      * @return true if the jar was deployed, false otherwise
66      */

67     boolean isJarDeployedByWorkName(String JavaDoc workFileName);
68
69     /**
70      * @return the Container by its file name (.xml or .jar)
71      */

72     Container getContainer(String JavaDoc fileName);
73
74     /**
75      * Remove a JOnAS Container.
76      * @param cont JOnAS container to remove.
77      */

78     void removeContainer(Container cont);
79
80     void removeContainer(String JavaDoc fileName) throws Exception JavaDoc;
81
82     /**
83      * List of all JOnAS Containers
84      * @return an array of Container objects
85      */

86     Container[] listContainers();
87
88     /**
89      * Synchronized all entity bean containers
90      * @param passivate passivate instances after synchronization.
91      */

92     void syncAllEntities(boolean passivate);
93
94     /**
95      * Deploy the given ejb-jars of an ear file with the specified parent
96      * classloader (ear classloader). (This method is only used for
97      * the ear applications, not for the ejb-jar applications).
98      * @param ctx the context containing the configuration
99      * to deploy the ejbjars.<BR>
100      * This context contains the following parameters :<BR>
101      * - earRootUrl the root of the ear application.<BR>
102      * - earClassLoader the ear classLoader of the ear application.<BR>
103      * - ejbClassLoader the ejb classLoader for the ejbjars.<BR>
104      * - jarURLs the list of the urls of the ejb-jars to deploy.<BR>
105      * - roleNames the role names of the security-role.<BR>
106      * @return ClassLoader the ejbClassLoader created.
107      * @throws ServiceException if an error occurs during the deployment.
108      */

109     void deployJars(Context JavaDoc ctx)throws ServiceException;
110
111     /**
112      * Undeploy the given ejb-jars of an ear file with the specified parent
113      * classloader (ear classloader). (This method is only used for
114      * the ear applications, not for the ejb-jar applications).
115      * @param urls the list of the urls of the ejb-jars to deploy.
116      */

117     void unDeployJars(URL JavaDoc[] urls);
118
119     /**
120      * Make a cleanup of the cache of deployment descriptor. This method must
121      * be invoked after the ear deployment by the EAR service.
122      * the deployment of an ear by .
123      * @param earClassLoader the ClassLoader of the ear application to
124      * remove from the cache.
125      */

126     void removeCache(ClassLoader JavaDoc earClassLoader);
127
128     /**
129      * Return the Ejbjars directory.
130      * @return The Ejbjars directory
131      */

132     String JavaDoc getEjbjarsDirectory();
133
134
135     /**
136      * Check that GenIC have been applied on the given ejb-jar file
137      * If it was not done, it run GenIC against the file.
138      * @param fileName given EJB-JAR file.
139      */

140     void checkGenIC(String JavaDoc fileName);
141     
142     /**
143      * Get the workManager
144      */

145     JWorkManager getWorkManager();
146 }
147
148
Popular Tags