org.ow2.jonas.deployment.ws.lib
Class WSDeploymentDescManager

java.lang.Object
  extended by org.ow2.jonas.deployment.common.lib.AbsDeploymentDescManager
      extended by org.ow2.jonas.deployment.ws.lib.WSDeploymentDescManager
All Implemented Interfaces:
DeploymentDescManager

public class WSDeploymentDescManager
extends AbsDeploymentDescManager

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

Field Summary
static String JONAS_WS_EJBJAR_FILE_NAME
          jonas-ejb-jar.xml filename.
static String JONAS_WS_WEBAPP_FILE_NAME
          jonas-ejb-jar.xml filename.
static String WS_EJBJAR_FILE_NAME
          ejb-jar.xml filename.
static String WS_WEBAPP_FILE_NAME
          ejb-jar.xml filename.
 
Fields inherited from class org.ow2.jonas.deployment.common.lib.AbsDeploymentDescManager
LINK_SEPARATOR
 
Method Summary
 void clearCache()
          Clear the cache.
 int getCacheSize()
          Get the size of the cache (number of entries in the cache).
static WSDeploymentDesc getDeploymentDesc(String file, ClassLoader jarCL)
          Get the specified WebService deployment descriptor.
 WSDeploymentDesc getDeploymentDesc(URL url, ClassLoader jarCL, ClassLoader earCL)
          Get the specified ws deployment descriptor and put it in the cache if it is not in.
 WSDeploymentDesc getDeploymentDesc(URL url, URL unpackedURL, ClassLoader jarCL, 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()
          Controls whether the parser is reporting all validity errors.
 PortComponentDesc getPortComponentDesc(URL callerURL, String portComponentLinkName, ClassLoader moduleLoader, ClassLoader earLoader)
          Return the port component desc from the pcLink string.
static JonasWebservices loadJonasWebservices(Reader reader, String fileName)
          return a 'xml' object containing jonas-webservices.xml informations.
static Webservices loadWebservices(Reader reader, String fileName)
          return a 'xml' object containing webservices.xml informations.
 void removeCache(ClassLoader cl)
          Remove the DD cache for the specified ClassLoader.
static void setParsingWithValidation(boolean validation)
          Controls whether the parser is reporting all validity errors.
 String toString()
          Return a string representation of the cache.
 
Methods inherited from class org.ow2.jonas.deployment.common.lib.AbsDeploymentDescManager
containsResource, findJonasServiceRef, mergeWebServiceRef, xmlContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WS_EJBJAR_FILE_NAME

public static final String WS_EJBJAR_FILE_NAME
ejb-jar.xml filename.

See Also:
Constant Field Values

JONAS_WS_EJBJAR_FILE_NAME

public static final String JONAS_WS_EJBJAR_FILE_NAME
jonas-ejb-jar.xml filename.

See Also:
Constant Field Values

WS_WEBAPP_FILE_NAME

public static final String WS_WEBAPP_FILE_NAME
ejb-jar.xml filename.

See Also:
Constant Field Values

JONAS_WS_WEBAPP_FILE_NAME

public static final String JONAS_WS_WEBAPP_FILE_NAME
jonas-ejb-jar.xml filename.

See Also:
Constant Field Values
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(String file,
                                                 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(URL url,
                                          ClassLoader jarCL,
                                          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.

getDeploymentDesc

public WSDeploymentDesc getDeploymentDesc(URL url,
                                          URL unpackedURL,
                                          ClassLoader jarCL,
                                          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.
unpackedURL - Unpacked URL of the module archive
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(Reader reader,
                                          String fileName)
                                   throws WSDeploymentDescException
return a 'xml' object containing webservices.xml informations.

Parameters:
reader - webservices.xml file input stream reader
fileName - webservices.xml file name
Returns:
a 'xml' object containing webservices.xml informations
Throws:
WSDeploymentDescException - when Webservices cannot be created with the given files.

loadJonasWebservices

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

Parameters:
reader - jonas-webservices.xml file input stream reader
fileName - jonas-webservices.xml file name
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(ClassLoader cl)
Remove the DD cache for the specified ClassLoader.

Parameters:
cl - the Key ClassLoader

toString

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

Overrides:
toString in class Object
Returns:
a string representation of the cache.

getParsingWithValidation

public static boolean getParsingWithValidation()
Controls whether the parser is reporting all validity errors.

Returns:
if true, all external entities will be read.

setParsingWithValidation

public static void setParsingWithValidation(boolean validation)
Controls whether the parser is reporting all validity errors.

Parameters:
validation - if true, all external entities will be read.

getPortComponentDesc

public PortComponentDesc getPortComponentDesc(URL callerURL,
                                              String portComponentLinkName,
                                              ClassLoader moduleLoader,
                                              ClassLoader earLoader)
                                       throws WSDeploymentDescException
Return the port component desc from the pcLink string. pcLink format : filename.[jar or war]#portComponentName in the same Ear File

Parameters:
callerURL - the url of the module being parsed. This is needed because pcLink is relative. With the url and the pcLink, we can know where the file is locate.
portComponentLinkName - the pcLink tag of an port-component-ref.
earLoader - the classloader of the ear.
moduleLoader - classlaoder of the current module
Returns:
the pcLink portComponent.
Throws:
WSDeploymentDescException - when it failed


Copyright © 2010 OW2 Consortium. All Rights Reserved.