org.objectweb.jonas_web.deployment.lib
Class WebDeploymentDescManager

java.lang.Object
  |
  +--org.objectweb.jonas_web.deployment.lib.WebDeploymentDescManager

public class WebDeploymentDescManager
extends java.lang.Object

This class provide a way for managing the WebContainerDeploymentDesc. Note that there is an intance of the WebDeploymentDescManager on each JOnAS server.

Author:
Ludovic Bert, Florent Benoit

Method Summary
 int getCacheSize()
          Get the size of the cache (number of entries in the cache).
 WebContainerDeploymentDesc getDeploymentDesc(java.net.URL url, java.lang.ClassLoader loaderForCls, java.lang.ClassLoader earLoader)
          Get the specified web deployment descriptor.
static WebDeploymentDescManager getInstance()
          Get an instance of the WebDeploymentDescManager.
 void removeCache(java.lang.ClassLoader earClassLoader)
          Make a cleanup of the cache of deployment descriptor.
 void setAltDD(java.lang.ClassLoader earClassLoader, java.net.URL[] urls, java.net.URL[] altDDs)
          Set the alt deployment desc which are used instead of the web.xml file which is in the war file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static WebDeploymentDescManager getInstance()
Get an instance of the WebDeploymentDescManager.
Returns:
the instance of the WebDeploymentDescManager.

getDeploymentDesc

public WebContainerDeploymentDesc getDeploymentDesc(java.net.URL url,
                                                    java.lang.ClassLoader loaderForCls,
                                                    java.lang.ClassLoader earLoader)
                                             throws WebContainerDeploymentDescException
Get the specified web deployment descriptor.
Parameters:
url - the url where to load xml deployment descriptors.
loaderForCls - classloader used to load web classes.
earLoader - the ear classloader.
Returns:
WebContainerDeploymentDesc the web deployment descriptor.
Throws:
WebContainerDeploymentDescException - when WebContainerDeploymentDesc cannot be created with the given files.

removeCache

public void removeCache(java.lang.ClassLoader earClassLoader)
Make a cleanup of the cache of deployment descriptor. This method must be invoked after the ear deployment by the EAR service.
Parameters:
earClassLoader - the ClassLoader of the ear application to remove from the cache.

setAltDD

public void setAltDD(java.lang.ClassLoader earClassLoader,
                     java.net.URL[] urls,
                     java.net.URL[] altDDs)
Set the alt deployment desc which are used instead of the web.xml file which is in the war file. The alt-dd tag is in the application.xml file of the ear files and is used ony in the EAR case. ie : deployment of wars packaged into EAR applications. alt-dd tag is optionnal
Parameters:
earClassLoader - the ear classloader which is used for mapped the URLs of the wars to the Alt dd.
urls - the urls of the wars
altDDs - the alt-dd name for the specified war URLs

getCacheSize

public int getCacheSize()
Get the size of the cache (number of entries in the cache). This method is used only for the tests.
Returns:
the size of the cache (number of entries in the cache).