org.objectweb.jonas_ejb.deployment.lib
Class EjbDeploymentDescManager

java.lang.Object
  |
  +--org.objectweb.jonas_ejb.deployment.lib.EjbDeploymentDescManager

public class EjbDeploymentDescManager
extends java.lang.Object

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

Author:
Ludovic Bert, Florent Benoit

Field Summary
static java.lang.String EJB_JAR_FILE_NAME
           
static java.lang.String JONAS_EJB_JAR_FILE_NAME
           
 
Method Summary
 int getCacheSize()
          Get the size of the cache (number of entries in the cache).
static DeploymentDesc getDeploymentDesc(java.lang.String ejbjar, java.lang.ClassLoader ejbLoader)
          Factory method using the ejb-jar file name.
static DeploymentDesc getDeploymentDesc(java.lang.String ejbJarXmlFileName, java.lang.String jonasEjbJarXmlFileName)
          Factory method using deployment descriptor and Jonas deployment descriptor file names. used by GEnIC or GenIDL
 DeploymentDesc getDeploymentDesc(java.net.URL url, java.lang.ClassLoader ejbLoader, java.lang.ClassLoader earLoader)
          Get the specified ejb deployment descriptor and put it in the cache if it is not in.
static EjbDeploymentDescManager getInstance()
          Get an instance of the EjbDeploymentDescManager.
static boolean getParsingWithValidation()
           
 void removeCache(java.lang.ClassLoader earClassLoader)
          Make a cleanup of the cache of deployment descriptor.
 void setAvailableEjbJarsAndAltDDs(java.lang.ClassLoader earClassLoader, java.net.URL[] urls, java.net.URL[] altDDs)
          Set for the given ear identified by its earClassLoader the list of the ejb-jar that can be in the ejb-link and the optional Desployment Desc.
static void setParsingWithValidation(boolean v)
           
 java.lang.String toString()
          Return a string representation of the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EJB_JAR_FILE_NAME

public static final java.lang.String EJB_JAR_FILE_NAME

JONAS_EJB_JAR_FILE_NAME

public static final java.lang.String JONAS_EJB_JAR_FILE_NAME
Method Detail

getInstance

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

getDeploymentDesc

public static DeploymentDesc getDeploymentDesc(java.lang.String ejbjar,
                                               java.lang.ClassLoader ejbLoader)
                                        throws DeploymentDescException
Factory method using the ejb-jar file name. Used by GenIC/GenIDL.
Parameters:
ejbjar - ejbjar file name
ejbLoader - classloader used to load bean classes.
Returns:
instance of the corresponding DeploymentDesc
Throws:
DeploymentDescException - when DeploymentDesc cannot be created with given ejb-jar file.

getDeploymentDesc

public DeploymentDesc getDeploymentDesc(java.net.URL url,
                                        java.lang.ClassLoader ejbLoader,
                                        java.lang.ClassLoader earLoader)
                                 throws DeploymentDescException
Get the specified ejb deployment descriptor and put it in the cache if it is not in. Called by createContainer & WebDeploymentDescManager
Parameters:
url - the url where to load xml deployment descriptors.
ejbLoader - classloader used to load bean classes.
earLoader - the parent classloader (the ear classloader). Null if there in the case of an ejb-jar application.
Returns:
DeploymentDesc the ejb deployment descriptor. (This method is used for the ear applications).
Throws:
DeploymentDescException - when DeploymentDesc cannot be created with the given files.

setAvailableEjbJarsAndAltDDs

public void setAvailableEjbJarsAndAltDDs(java.lang.ClassLoader earClassLoader,
                                         java.net.URL[] urls,
                                         java.net.URL[] altDDs)
Set for the given ear identified by its earClassLoader the list of the ejb-jar that can be in the ejb-link and the optional Desployment Desc.
Parameters:
earClassLoader - the classloader of the ear application.
urls - the list of the URLs of the ear application that can be in the ejb-link.
altDDs - the list of the URLs of the alternate DDs to use if specified.

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 URLClassLoader of the ear application to remove from the cache.

getCacheSize

public int getCacheSize()
Get the size of the cache (number of entries in the cache). Used only for debugging.
Returns:
the size of the cache (number of entries in the cache).

toString

public java.lang.String toString()
Return a string representation of the cache. (Used only for debugging).
Overrides:
toString in class java.lang.Object
Returns:
a string representation of the cache.

getDeploymentDesc

public static DeploymentDesc getDeploymentDesc(java.lang.String ejbJarXmlFileName,
                                               java.lang.String jonasEjbJarXmlFileName)
                                        throws DeploymentDescException
Factory method using deployment descriptor and Jonas deployment descriptor file names. used by GEnIC or GenIDL
Returns:
instance of the corresponding DeploymentDesc
Throws:
DeploymentDescException - when DeploymentDesc cannot be created with given files.

setParsingWithValidation

public static void setParsingWithValidation(boolean v)

getParsingWithValidation

public static boolean getParsingWithValidation()