001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999-2005 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: JWebContainerService.java 6702 2005-05-05 16:09:14Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.objectweb.jonas.web;
025:
026: import java.net.URL;
027: import java.net.URLClassLoader;
028: import java.rmi.RemoteException;
029:
030: import javax.naming.Context;
031:
032: import org.objectweb.jonas.service.Service;
033:
034: /**
035: * JOnAS WEB Container Service interface.
036: * This interface provides a description of a web container service.
037: * @author Ludovic Bert
038: * @author Florent Benoit
039: */
040: public interface JWebContainerService extends Service {
041:
042: /**
043: * Deploy the given wars of an ear file with the specified parent
044: * classloader (ejb classloader or ear classloader). (This method
045: * is only used for the ear applications, not for the
046: * web applications).
047: * @param ctx the context containing the configuration
048: * to deploy the wars.<BR>
049: * This context contains the following parameters :<BR>
050: * - urls the list of the urls of the wars to deploy.<BR>
051: * - earURL the URL of the ear application file.<BR>
052: * - parentClassLoader the parent classLoader of the wars.<BR>
053: * - earClassLoader the ear classLoader of the j2ee app.<BR>
054: * - altDDs the optional URI of deployment descriptor.<BR>
055: * - contextRoots the optional context root of the wars.<BR>
056: * @throws JWebContainerServiceException if an error occurs during
057: * the deployment.
058: */
059: void deployWars(Context ctx) throws JWebContainerServiceException;
060:
061: /**
062: * Undeploy the given wars of an ear file with the specified parent
063: * classloader (ejb classloader or ear classloader). (This method
064: * is only used for the ear applications, not for the
065: * war applications).
066: * @param urls the list of the urls of the wars to undeploy.
067: */
068: void unDeployWars(URL[] urls);
069:
070: /**
071: * Make a cleanup of the cache of deployment descriptor. This method must
072: * be invoked after the ear deployment by the EAR service.
073: * the deployment of an ear by .
074: * @param earClassLoader the ClassLoader of the ear application to
075: * remove from the cache.
076: */
077: void removeCache(ClassLoader earClassLoader);
078:
079: /**
080: * Return the Default host name of the web container.
081: * @return the Default host name of the web container.
082: * @throws JWebContainerServiceException when it is impossible to get the Default Host.
083: */
084: String getDefaultHost() throws JWebContainerServiceException;
085:
086: /**
087: * Return the Default HTTP port number of the web container (can
088: * be null if multiple HTTP connector has been set).
089: * @return the Default HTTP port number of the web container.
090: * @throws JWebContainerServiceException when it is impossible to get the Default Http port.
091: */
092: String getDefaultHttpPort() throws JWebContainerServiceException;
093:
094: /**
095: * Return the Default HTTPS port number of the web container (can
096: * be null if multiple HTTPS connector has been set).
097: * @return the Default HTTPS port number of the web container.
098: * @throws JWebContainerServiceException when it is impossible to get the Default Https port.
099: */
100: String getDefaultHttpsPort() throws JWebContainerServiceException;
101:
102: /**
103: * Return the class loader of the given warURL. Unpack the associated war
104: * and build the loader if it's not in the cache.
105: * @param warURL the url of the war we want to get the loader
106: * @param earAppName the name of the ear application containing
107: * the war. May be null in non ear case.
108: * @param ejbClassLoader the ejb class loader of the ear.
109: * May be null in non ear case.
110: * @return the class loader of the given warURL.
111: * @throws JWebContainerServiceException if the process failed.
112: */
113: URLClassLoader getClassLoader(URL warURL, String earAppName,
114: ClassLoader ejbClassLoader)
115: throws JWebContainerServiceException;
116:
117: /**
118: * @param warURL the URL of the webapp
119: * @return Returns the ClassLoader used to link a JNDI environnment to a webapp
120: */
121: ClassLoader getContextLinkedClassLoader(URL warURL);
122:
123: /**
124: * Get the war identified by its URL (.war).
125: * @param url the URL of the war to get.
126: * @return the war indentified by its URL, or null if the war is not found.
127: */
128: War getWar(URL url);
129:
130: /**
131: * Return the WebApps directory.
132: * @return The WebApps directory
133: */
134: String getWebappsDirectory();
135:
136: /**
137: * Register a WAR by delegating the operation to the registerWar() method.
138: * This is used for JMX management.
139: * @param fileName the name of the war to deploy.
140: * @throws RemoteException if rmi call failed.
141: * @throws JWebContainerServiceException if the registration failed.
142: */
143: void registerWarMBean(String fileName) throws RemoteException,
144: JWebContainerServiceException;
145:
146: /**
147: * Test if the specified filename is already deployed or not
148: * @param fileName the name of the war file.
149: * @return true if the war is deployed, else false.
150: */
151: boolean isWarLoaded(String fileName);
152:
153: /**
154: * Unregister a WAR by delegating the operation to the unRegisterWar()
155: * method. This is used for JMX management.
156: * @param fileName the name of the war to undeploy.
157: * @throws RemoteException if rmi call failed.
158: * @throws JWebContainerServiceException if the unregistration failed.
159: */
160: void unRegisterWarMBean(String fileName) throws RemoteException,
161: JWebContainerServiceException;
162:
163: }
|