|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ow2.jonas.deployment.common.lib.AbsDeploymentDescManager org.ow2.jonas.deployment.ejb.lib.EjbDeploymentDescManager
public class EjbDeploymentDescManager
This class provide a way for managing the EjbDeploymentDesc. Note that there is an intance of the EjbDeploymentDescManager on each JOnAS server.
Field Summary | |
---|---|
static String |
EJB_JAR_FILE_NAME
ejb-jar.xml filename |
static String |
JONAS_EJB_JAR_FILE_NAME
jonas-ejb-jar.xml filename |
Fields inherited from class org.ow2.jonas.deployment.common.lib.AbsDeploymentDescManager |
---|
LINK_SEPARATOR |
Method Summary | |
---|---|
void |
addClassLoaderUrlMapping(ClassLoader ejbClassloader,
URL[] urls)
Add a mapping between url and classloader |
protected void |
checkType(URL ejbJar,
String ejbType,
IJNDIEnvRefsGroupDesc bd)
Check if the type of the ejb-ref is correct. |
protected void |
checkTypeUsage(URL url,
String mdType,
String mdUsage,
BeanDesc bd)
Check if the type & usage of the message-destination-ref is correct. |
int |
getCacheSize()
Get the size of the cache (number of entries in the cache). |
static DeploymentDesc |
getDeploymentDesc(String ejbjar,
ClassLoader ejbLoader)
Factory method using the ejb-jar file name. |
static DeploymentDesc |
getDeploymentDesc(String ejbJarXmlFileName,
String jonasEjbJarXmlFileName,
String jarFileName)
Factory method using deployment descriptor and Jonas deployment descriptor file names. |
DeploymentDesc |
getDeploymentDesc(URL url,
ClassLoader ejbLoader,
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. |
String |
getJndiName(URL currentFile,
String ejbLink,
ClassLoader earCl,
String ejbType,
DeploymentDesc deploymentDesc,
boolean isEjbRef)
Return the JNDI name from the ejbLink string. |
static String |
getJOnASXmlContent()
Return the content of the jonas-web.xml file |
static boolean |
getParsingWithValidation()
Controls whether the parser is reporting all validity errors. |
static String |
getXmlContent()
Return the content of the web.xml file |
static EjbJar |
loadEjbJar(Reader reader,
String name)
Load the ejb_jar.xml file. |
static JonasEjbJar |
loadJonasEjbJar(Reader reader,
String name)
Load the EjbJar file |
void |
removeCache(ClassLoader earClassLoader)
Make a cleanup of the cache of deployment descriptor. |
void |
setAvailableEjbJarsAndAltDDs(ClassLoader earClassLoader,
URL[] urls,
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 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 |
---|
public static final String EJB_JAR_FILE_NAME
public static final String JONAS_EJB_JAR_FILE_NAME
Method Detail |
---|
public static EjbDeploymentDescManager getInstance()
public static DeploymentDesc getDeploymentDesc(String ejbjar, ClassLoader ejbLoader) throws DeploymentDescException
ejbjar
- ejbjar file nameejbLoader
- classloader used to load bean classes.
DeploymentDescException
- when DeploymentDesc cannot be created with
given ejb-jar file.public DeploymentDesc getDeploymentDesc(URL url, ClassLoader ejbLoader, ClassLoader earLoader) throws DeploymentDescException
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.
DeploymentDescException
- when DeploymentDesc cannot be created
with the given files.public String getJndiName(URL currentFile, String ejbLink, ClassLoader earCl, String ejbType, DeploymentDesc deploymentDesc, boolean isEjbRef) throws DeploymentDescException
currentFile
- the url of the jar being parsed. This is needed because
ejbLink is relative. With the url and the ejbLink, we can know where
the file is locate.ejbLink
- the ejbLink tag of an ejb-refearCl
- optionnal classloaderejbType
- the type of the referenced ejb in the ejb-ref tag.deploymentDesc
- the deployment descriptor of the parsed deploymentDesc.isEjbRef
- true if the jndi name to resolve is an ejb-ref
DeploymentDescException
- when it failedpublic void setAvailableEjbJarsAndAltDDs(ClassLoader earClassLoader, URL[] urls, URL[] altDDs)
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.public void removeCache(ClassLoader earClassLoader)
earClassLoader
- the URLClassLoader of the ear application to
remove from the cache.public int getCacheSize()
public String toString()
toString
in class Object
public static DeploymentDesc getDeploymentDesc(String ejbJarXmlFileName, String jonasEjbJarXmlFileName, String jarFileName) throws DeploymentDescException
ejbJarXmlFileName
- name of the standard DDjonasEjbJarXmlFileName
- name of the specific DDjarFileName
- name of the jar file
DeploymentDescException
- when DeploymentDesc cannot be created with
given files.public static EjbJar loadEjbJar(Reader reader, String name) throws DeploymentDescException
reader
- the reader of the XML file.name
- the name of the file (ejb-jar.xml).
DeploymentDescException
- if the deployment descriptor
is corrupted.public static JonasEjbJar loadJonasEjbJar(Reader reader, String name) throws DeploymentDescException
reader
- reader containing the streamname
- name of the file
DeploymentDescException
- if loading failspublic static boolean getParsingWithValidation()
public static void setParsingWithValidation(boolean validation)
validation
- if true, all external entities will be read.public static String getXmlContent()
public static String getJOnASXmlContent()
protected void checkType(URL ejbJar, String ejbType, IJNDIEnvRefsGroupDesc bd) throws DeploymentDescException
ejbJar
- the URL of the ejb-jar being parsed.ejbType
- the type of the ejb-ref (ejb-ref-type).bd
- the descriptor of the referenced bean.
DeploymentDescException
- if the type is incorrect.protected void checkTypeUsage(URL url, String mdType, String mdUsage, BeanDesc bd) throws DeploymentDescException
url
- the URL of the file being parsed.mdType
- the type of the message-destination-ref
(message-destination-type).mdUsage
- the usage of the message-destination-ref
(message-destination-usage).bd
- the descriptor of the referenced bean.
DeploymentDescException
- if the type is incorrect.public void addClassLoaderUrlMapping(ClassLoader ejbClassloader, URL[] urls)
ejbClassloader
- EjbClassloader on which associate URLsurls
- array of urls associated to the classloader
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |