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 的解析过程(暂时略过)

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念