前面所说,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();
每个 bean 元数据被封装成 KernelControllerContext 交由 KernelController 处理。
这里面涉及到 xml 文件经过 jbossxb 的解析过程(暂时略过)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。