org.objectweb.easybeans.deployment.xml.parsing
Class EJB3DeploymentDescLoader

java.lang.Object
  extended by org.objectweb.easybeans.deployment.xml.parsing.EJB3DeploymentDescLoader

public final class EJB3DeploymentDescLoader
extends java.lang.Object

This class analyzes the EJB3 deployment descriptor and fill a struct with getters.

Author:
Florent Benoit

Field Summary
private  EJB3 ejb3
          EJB3 instance object that is the result of the parsing.
private static java.lang.String J2EE_NS
          Persistence namespace (J2EE).
private static java.lang.String JAVAEE_NS
          Persistence namespace (Java EE).
private static JLog logger
          Logger.
private  java.net.URL url
          URL of the file being analyzed.
private static boolean validating
          Validating with schema ?
private  java.lang.String xmlns
          Namespace to use when analyzing the XML file.
 
Constructor Summary
private EJB3DeploymentDescLoader(java.net.URL url)
          Utility class, no public constructor.
 
Method Summary
private  void analyzeApplicationException(org.w3c.dom.Element assemblyDescriptorElement, AssemblyDescriptor assemblyDescriptor)
          Analyze the application Exception of the assembly descriptor of an EJB-JAR.
private  void analyzeAroundInvoke(org.w3c.dom.Element envElement, AbsEnvironment env)
          Analyze the lifecycle elements.
private  void analyzeAssemblyDescriptor(org.w3c.dom.Element assemblyDescriptorElement, AssemblyDescriptor assemblyDescriptor)
          Analyze the assembly descriptor of an EJB-JAR.
private  void analyzeBean(org.w3c.dom.Element beanElement, AbsBean bean)
          Analyze common stuff of a bean.
private  void analyzeBeans(org.w3c.dom.Element enterpriseBeansElement, EnterpriseBeans enterpriseBeans)
          Analyze common stuff of beans.
private  void analyzeCommonEJBRef(org.w3c.dom.Element refElement, AbsEJBRef ref)
          Analyze the ejb-ref/local-ref element and find the sub-elements.
private  void analyzeEJBLocalRef(org.w3c.dom.Element envElement, AbsEnvironment env)
          Analyze the environment element and find the ejb-local-ref element.
private  void analyzeEJBRef(org.w3c.dom.Element envElement, AbsEnvironment env)
          Analyze the environment element and find the ejb-ref element.
private  void analyzeEnvEnvtry(org.w3c.dom.Element envElement, AbsEnvironment bean)
          Analyze the env-entry element.
private  void analyzeEnvironement(org.w3c.dom.Element envElement, AbsEnvironment bean)
          Analyze the environment (could be a bean, servlet, etc).
private  void analyzeInjectionTarget(org.w3c.dom.Element refElement, AbsResourceGroup resourceGroup)
          Analyze the injection-target element and add them to the given resource group object used by ejb-ref, ejb-local-ref, resource-ref, etc.
private  void analyzeInterceptorBinding(org.w3c.dom.Element assemblyDescriptorElement, AssemblyDescriptor assemblyDescriptor)
          Analyze the interceptor binding of the assembly descriptor of an EJB-JAR.
private  void analyzeInterceptorsElement(org.w3c.dom.Element interceptorsElement, Interceptors interceptors)
          Analyze the interceptors element of an EJB-JAR.
private  void analyzeLifeCycle(org.w3c.dom.Element envElement, AbsEnvironment env, java.lang.String lifecycleName)
          Analyze the lifecycle elements.
private  void analyzeResourceEnvRef(org.w3c.dom.Element envElement, AbsEnvironment env)
          Analyze the environment element and find the resource-env-ref element.
private  void analyzeResourceRef(org.w3c.dom.Element envElement, AbsEnvironment env)
          Analyze the environment element and find the resource-ref element.
private  void analyzeSessionBean(org.w3c.dom.Element beanElement, Session bean)
          Analyze XML of a session bean.
 EJB3 getEJB3()
           
private  MethodDD getMethodFromElement(org.w3c.dom.Element methodElement)
          Gets the methodDD from the given dom element.
static EJB3 loadDeploymentDescriptor(java.net.URL url)
          Load the ejb-jar.xml file.
 void parse()
          Analyze the URL and build an EJB3 object which contains data of the XML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVAEE_NS

private static final java.lang.String JAVAEE_NS
Persistence namespace (Java EE).

See Also:
Constant Field Values

J2EE_NS

private static final java.lang.String J2EE_NS
Persistence namespace (J2EE).

See Also:
Constant Field Values

logger

private static JLog logger
Logger.


validating

private static boolean validating
Validating with schema ?


ejb3

private EJB3 ejb3
EJB3 instance object that is the result of the parsing.


url

private java.net.URL url
URL of the file being analyzed.


xmlns

private java.lang.String xmlns
Namespace to use when analyzing the XML file. It depends if the archive is J2EE or Java EE module.

Constructor Detail

EJB3DeploymentDescLoader

private EJB3DeploymentDescLoader(java.net.URL url)
Utility class, no public constructor.

Parameters:
url - the url that is pointing to the EJB Xml file.
Method Detail

loadDeploymentDescriptor

public static EJB3 loadDeploymentDescriptor(java.net.URL url)
                                     throws ParsingException
Load the ejb-jar.xml file.

Parameters:
url - the URL of the XML file.
Returns:
an application object.
Throws:
ParsingException - if parsing of XML file fails.

parse

public void parse()
           throws ParsingException
Analyze the URL and build an EJB3 object which contains data of the XML.

Throws:
ParsingException - if the analyze of the file fails.

analyzeBeans

private void analyzeBeans(org.w3c.dom.Element enterpriseBeansElement,
                          EnterpriseBeans enterpriseBeans)
Analyze common stuff of beans.

Parameters:
enterpriseBeansElement - the dom element.
enterpriseBeans - the structure representing object.

analyzeBean

private void analyzeBean(org.w3c.dom.Element beanElement,
                         AbsBean bean)
Analyze common stuff of a bean.

Parameters:
beanElement - the dom element.
bean - the structure representing object.

analyzeSessionBean

private void analyzeSessionBean(org.w3c.dom.Element beanElement,
                                Session bean)
Analyze XML of a session bean.

Parameters:
beanElement - the dom element.
bean - the structure representing object.

getMethodFromElement

private MethodDD getMethodFromElement(org.w3c.dom.Element methodElement)
Gets the methodDD from the given dom element.

Parameters:
methodElement - the dom element to analyze
Returns:
the given method object

analyzeEnvironement

private void analyzeEnvironement(org.w3c.dom.Element envElement,
                                 AbsEnvironment bean)
Analyze the environment (could be a bean, servlet, etc).

Parameters:
envElement - the dom element.
bean - the structure representing object.

analyzeCommonEJBRef

private void analyzeCommonEJBRef(org.w3c.dom.Element refElement,
                                 AbsEJBRef ref)
Analyze the ejb-ref/local-ref element and find the sub-elements.

Parameters:
refElement - given XML element which contains ejb-ref-name, ejb-ref-type, etc.
ref - the struct object representing the XML element.

analyzeInjectionTarget

private void analyzeInjectionTarget(org.w3c.dom.Element refElement,
                                    AbsResourceGroup resourceGroup)
Analyze the injection-target element and add them to the given resource group object used by ejb-ref, ejb-local-ref, resource-ref, etc.

Parameters:
refElement - given XML element which contains a resource element.
resourceGroup - the struct object representing the XML element.

analyzeEJBRef

private void analyzeEJBRef(org.w3c.dom.Element envElement,
                           AbsEnvironment env)
Analyze the environment element and find the ejb-ref element.

Parameters:
envElement - given XML element which contains ejb-ref.
env - the struct object representing the XML element.

analyzeResourceRef

private void analyzeResourceRef(org.w3c.dom.Element envElement,
                                AbsEnvironment env)
Analyze the environment element and find the resource-ref element.

Parameters:
envElement - given XML element which contains resource-ref.
env - the struct object representing the XML element.

analyzeResourceEnvRef

private void analyzeResourceEnvRef(org.w3c.dom.Element envElement,
                                   AbsEnvironment env)
Analyze the environment element and find the resource-env-ref element.

Parameters:
envElement - given XML element which contains resource-ref.
env - the struct object representing the XML element.

analyzeEJBLocalRef

private void analyzeEJBLocalRef(org.w3c.dom.Element envElement,
                                AbsEnvironment env)
Analyze the environment element and find the ejb-local-ref element.

Parameters:
envElement - given XML element which contains ejb-local-ref.
env - the struct object representing the XML element.

analyzeAroundInvoke

private void analyzeAroundInvoke(org.w3c.dom.Element envElement,
                                 AbsEnvironment env)
Analyze the lifecycle elements.

Parameters:
envElement - the dom element.
env - the structure representing object.

analyzeLifeCycle

private void analyzeLifeCycle(org.w3c.dom.Element envElement,
                              AbsEnvironment env,
                              java.lang.String lifecycleName)
Analyze the lifecycle elements.

Parameters:
envElement - the dom element.
env - the structure representing object.
lifecycleName - the name of lifecycle (post-construct, etc)

analyzeEnvEnvtry

private void analyzeEnvEnvtry(org.w3c.dom.Element envElement,
                              AbsEnvironment bean)
Analyze the env-entry element.

Parameters:
envElement - the dom element.
bean - the structure representing object.

analyzeInterceptorsElement

private void analyzeInterceptorsElement(org.w3c.dom.Element interceptorsElement,
                                        Interceptors interceptors)
Analyze the interceptors element of an EJB-JAR.

Parameters:
interceptorsElement - the dom element.
interceptors - the structure representing object.

analyzeAssemblyDescriptor

private void analyzeAssemblyDescriptor(org.w3c.dom.Element assemblyDescriptorElement,
                                       AssemblyDescriptor assemblyDescriptor)
Analyze the assembly descriptor of an EJB-JAR.

Parameters:
assemblyDescriptorElement - the dom element.
assemblyDescriptor - the structure representing object.

analyzeInterceptorBinding

private void analyzeInterceptorBinding(org.w3c.dom.Element assemblyDescriptorElement,
                                       AssemblyDescriptor assemblyDescriptor)
Analyze the interceptor binding of the assembly descriptor of an EJB-JAR.

Parameters:
assemblyDescriptorElement - the dom element.
assemblyDescriptor - the structure representing object.

analyzeApplicationException

private void analyzeApplicationException(org.w3c.dom.Element assemblyDescriptorElement,
                                         AssemblyDescriptor assemblyDescriptor)
Analyze the application Exception of the assembly descriptor of an EJB-JAR.

Parameters:
assemblyDescriptorElement - the dom element.
assemblyDescriptor - the structure representing object.

getEJB3

public EJB3 getEJB3()
Returns:
the object resulting of the XML parsing.