org.objectweb.jonas_ws.deployment.lib
Class WSDeploymentDescManager

java.lang.Object
  extended byorg.objectweb.jonas_ws.deployment.lib.WSDeploymentDescManager

public class WSDeploymentDescManager
extends java.lang.Object

This class provide a way for managing the WSDeploymentDesc. Note that there is 1 instance of the WSDeploymentDescManager on each JOnAS server.

Author:
Guillaume Sauthier, Xavier Delplanque, Helene Joanin

Method Summary
 void clearCache()
          Clear the cache.
 int getCacheSize()
          Get the size of the cache (number of entries in the cache).
static WSDeploymentDesc getDeploymentDesc(java.lang.String file, java.lang.ClassLoader jarCL)
          Get the specified WebService deployment descriptor.
 WSDeploymentDesc getDeploymentDesc(java.net.URL url, java.lang.ClassLoader jarCL, java.lang.ClassLoader earCL)
          Get the specified ws deployment descriptor and put it in the cache if it is not in.
static WSDeploymentDescManager getInstance()
          Get the unique instance of the WSDeploymentDescManager.
static boolean getParsingWithValidation()
          DOCUMENT ME!
static JonasWebservices loadJonasWebservices(java.io.Reader reader, java.lang.String fileName)
          return a 'xml' object containing jonas-webservices.xml informations
static Webservices loadWebservices(java.io.Reader reader, java.lang.String fileName)
          return a 'xml' object containing webservices.xml informations
 void removeCache(java.lang.ClassLoader cl)
          Remove the DD cache for the specified ClassLoader
static void setParsingWithValidation(boolean v)
          DOCUMENT ME!
 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
 

Method Detail

getInstance

public static WSDeploymentDescManager getInstance()
Get the unique instance of the WSDeploymentDescManager.

Returns:
the instance of the WSDeploymentDescManager.

getDeploymentDesc

public static WSDeploymentDesc getDeploymentDesc(java.lang.String file,
                                                 java.lang.ClassLoader jarCL)
                                          throws WSDeploymentDescException
Get the specified WebService deployment descriptor. Used by WsGen.

Parameters:
file - module (ejbjar or war). It is required that file is not a directory.
jarCL - the classloader where classes are stored.
Returns:
the module webservices deployment descriptor if it exists, null else.
Throws:
WSDeploymentDescException - when WSDeploymentDesc cannot be created with the given files.

getDeploymentDesc

public WSDeploymentDesc getDeploymentDesc(java.net.URL url,
                                          java.lang.ClassLoader jarCL,
                                          java.lang.ClassLoader earCL)
                                   throws WSDeploymentDescException
Get the specified ws deployment descriptor and put it in the cache if it is not in.

Parameters:
url - module (ejbjar or war). It can be a directory or a jar file.
jarCL - classloader used to load bean classes.
earCL - the parent classloader (the ear classloader). Null when not in the case of an ear application.
Returns:
the module webservices deployment descriptor if it exists, null else.
Throws:
WSDeploymentDescException - when WSDeploymentDesc cannot be created with the given files.

loadWebservices

public static Webservices loadWebservices(java.io.Reader reader,
                                          java.lang.String fileName)
                                   throws WSDeploymentDescException
return a 'xml' object containing webservices.xml informations

Returns:
a 'xml' object containing webservices.xml informations
Throws:
WSDeploymentDescException - when Webservices cannot be created with the given files.

loadJonasWebservices

public static JonasWebservices loadJonasWebservices(java.io.Reader reader,
                                                    java.lang.String fileName)
                                             throws WSDeploymentDescException
return a 'xml' object containing jonas-webservices.xml informations

Returns:
a 'xml' object containing jonas-webservices.xml informations
Throws:
WSDeploymentDescException - when JonasWebservices cannot be created with the given files.

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).

clearCache

public void clearCache()
Clear the cache.


removeCache

public void removeCache(java.lang.ClassLoader cl)
Remove the DD cache for the specified ClassLoader


toString

public java.lang.String toString()
Return a string representation of the cache. (Used only for debugging).

Returns:
a string representation of the cache.

setParsingWithValidation

public static void setParsingWithValidation(boolean v)
DOCUMENT ME!

Parameters:
v - DOCUMENT ME!

getParsingWithValidation

public static boolean getParsingWithValidation()
DOCUMENT ME!

Returns:
DOCUMENT ME!