JBoss AS 6.1.0 Final 启动的xml描述文件解析与对应的解析类

前端之家收集整理的这篇文章主要介绍了JBoss AS 6.1.0 Final 启动的xml描述文件解析与对应的解析类前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

前面所说,JBoss AS 6.1.0 Final 以 bootstram.xml 作为入口,读取bootstram.xml 中的其他 8个描述文件并部署到内核中。

启动过程就是部署过程。


一、启动文件 bootstram.xml

bootstram.xml 对应的实体类为BootstrapMetaData ,解析类为BootstrapSchemaBinding ,

解析过程由BootstrapParser.parse( bootstrapUrl) 完成,bootstrapUrl 是 bootstramp.xml 的绝对路径


 
<?xml version="1.0" encoding="UTF-8"?>
<bootstrap xmlns="urn:jboss:bootstrap:1.0">

   <url>bootstrap/classloader.xml</url>
   <url>bootstrap/stdio.xml</url>
   <url>bootstrap/kernel.xml</url>
   <url>bootstrap/aop.xml</url>
   <url>bootstrap/jmx.xml</url>
   <url>bootstrap/deployers.xml</url>
   <url>bootstrap/profile.xml</url>
   <url>bootstrap/security.xml</url>
</bootstrap>
  


 
  protected void setupBootstrapDescriptorsFromBootstrapUrl()   {
      ...
      final BootstrapMetaData bmd = BootstrapParser.parse(bootstrapUrl);
      final List<String> urlStrings = bmd.getBootstrapURLs();
      ...
  }
  


二、描述文件

bootstrap.xml中url 指定的xml文件,对应的实体类是KernelDeployment (AbstractKernelDeployment),解析类为SchemaBindingResolver,

解析过程由TempBasicXMLDeployer 完成。

 
TempBasicXMLDeployer kernelDeployer= new TempBasicXMLDeployer(kernel);
kernelDeployer.deploy();
 


每个KernelDeployment 包含一个或多个 bean 的元数据,

每个 bean 元数据被封装成 KernelControllerContext 交由 KernelController 处理。


这里面涉及到 xml 文件经过 jbossxb 的解析过程(暂时略过)

原文链接:https://www.f2er.com/xml/297892.html

猜你在找的XML相关文章