KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > web > JWebContainerService


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: JWebContainerService.java,v 1.10 2005/05/05 16:09:14 benoitf Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.web;
27
28 import java.net.URL JavaDoc;
29 import java.net.URLClassLoader JavaDoc;
30 import java.rmi.RemoteException JavaDoc;
31
32 import javax.naming.Context JavaDoc;
33
34 import org.objectweb.jonas.service.Service;
35
36
37 /**
38  * JOnAS WEB Container Service interface.
39  * This interface provides a description of a web container service.
40  * @author Ludovic Bert
41  * @author Florent Benoit
42  */

43 public interface JWebContainerService extends Service {
44
45     /**
46      * Deploy the given wars of an ear file with the specified parent
47      * classloader (ejb classloader or ear classloader). (This method
48      * is only used for the ear applications, not for the
49      * web applications).
50      * @param ctx the context containing the configuration
51      * to deploy the wars.<BR>
52      * This context contains the following parameters :<BR>
53      * - urls the list of the urls of the wars to deploy.<BR>
54      * - earURL the URL of the ear application file.<BR>
55      * - parentClassLoader the parent classLoader of the wars.<BR>
56      * - earClassLoader the ear classLoader of the j2ee app.<BR>
57      * - altDDs the optional URI of deployment descriptor.<BR>
58      * - contextRoots the optional context root of the wars.<BR>
59      * @throws JWebContainerServiceException if an error occurs during
60      * the deployment.
61      */

62     void deployWars(Context JavaDoc ctx) throws JWebContainerServiceException;
63
64     /**
65      * Undeploy the given wars of an ear file with the specified parent
66      * classloader (ejb classloader or ear classloader). (This method
67      * is only used for the ear applications, not for the
68      * war applications).
69      * @param urls the list of the urls of the wars to undeploy.
70      */

71     void unDeployWars(URL JavaDoc[] urls);
72
73     /**
74      * Make a cleanup of the cache of deployment descriptor. This method must
75      * be invoked after the ear deployment by the EAR service.
76      * the deployment of an ear by .
77      * @param earClassLoader the ClassLoader of the ear application to
78      * remove from the cache.
79      */

80     void removeCache(ClassLoader JavaDoc earClassLoader);
81
82     /**
83      * Return the Default host name of the web container.
84      * @return the Default host name of the web container.
85      * @throws JWebContainerServiceException when it is impossible to get the Default Host.
86      */

87     String JavaDoc getDefaultHost() throws JWebContainerServiceException;
88
89     /**
90      * Return the Default HTTP port number of the web container (can
91      * be null if multiple HTTP connector has been set).
92      * @return the Default HTTP port number of the web container.
93      * @throws JWebContainerServiceException when it is impossible to get the Default Http port.
94      */

95     String JavaDoc getDefaultHttpPort() throws JWebContainerServiceException;
96
97     /**
98      * Return the Default HTTPS port number of the web container (can
99      * be null if multiple HTTPS connector has been set).
100      * @return the Default HTTPS port number of the web container.
101      * @throws JWebContainerServiceException when it is impossible to get the Default Https port.
102      */

103     String JavaDoc getDefaultHttpsPort() throws JWebContainerServiceException;
104
105     /**
106      * Return the class loader of the given warURL. Unpack the associated war
107      * and build the loader if it's not in the cache.
108      * @param warURL the url of the war we want to get the loader
109      * @param earAppName the name of the ear application containing
110      * the war. May be null in non ear case.
111      * @param ejbClassLoader the ejb class loader of the ear.
112      * May be null in non ear case.
113      * @return the class loader of the given warURL.
114      * @throws JWebContainerServiceException if the process failed.
115      */

116     URLClassLoader JavaDoc getClassLoader(URL JavaDoc warURL, String JavaDoc earAppName, ClassLoader JavaDoc ejbClassLoader) throws JWebContainerServiceException;
117
118     /**
119      * @param warURL the URL of the webapp
120      * @return Returns the ClassLoader used to link a JNDI environnment to a webapp
121      */

122     ClassLoader JavaDoc getContextLinkedClassLoader(URL JavaDoc warURL);
123
124     /**
125      * Get the war identified by its URL (.war).
126      * @param url the URL of the war to get.
127      * @return the war indentified by its URL, or null if the war is not found.
128      */

129     War getWar(URL JavaDoc url);
130
131     /**
132      * Return the WebApps directory.
133      * @return The WebApps directory
134      */

135     String JavaDoc getWebappsDirectory();
136
137     /**
138      * Register a WAR by delegating the operation to the registerWar() method.
139      * This is used for JMX management.
140      * @param fileName the name of the war to deploy.
141      * @throws RemoteException if rmi call failed.
142      * @throws JWebContainerServiceException if the registration failed.
143      */

144     void registerWarMBean(String JavaDoc fileName) throws RemoteException JavaDoc, JWebContainerServiceException;
145
146
147     /**
148      * Test if the specified filename is already deployed or not
149      * @param fileName the name of the war file.
150      * @return true if the war is deployed, else false.
151      */

152     boolean isWarLoaded(String JavaDoc fileName);
153
154     /**
155      * Unregister a WAR by delegating the operation to the unRegisterWar()
156      * method. This is used for JMX management.
157      * @param fileName the name of the war to undeploy.
158      * @throws RemoteException if rmi call failed.
159      * @throws JWebContainerServiceException if the unregistration failed.
160      */

161     void unRegisterWarMBean(String JavaDoc fileName) throws RemoteException JavaDoc, JWebContainerServiceException;
162
163 }
164
Popular Tags