JBoss启动时加载应用程序的顺序
2011-02-22 16:40
369 查看
转自:http://tanyankai.javaeye.com/blog/569627
Html代码
以下说到的版本是jboss-4.2.3.GA
并且假设JBoss安装在D:\Java\jboss-4.2.3.GA
JBoss部署的时候支持很多种格式打的包,比如说我们从deploy目录下面会看到有后缀名为deployer、sar,war,rar,xml ... (后来发现其实JBoss部署支持的格式,远远不止这些)
但是这些不同格式的应用是怎样的一个加载顺序呢?或者说有没有什么规律?带着这个疑问我在Jboss启动的时候仔细的看了一下命令行中的信息,发现两个信息:
1、 最先加载的是后缀名为deployer目录下应用或者服务;
2、 每次都会等有相同后缀名的应用(或者目录下的应用)完全加载完之后才会去加载另外一种后缀名
发现这两点之后,我就找了一下Jboss的一些配置文件,原来在D:\Java\jboss-4.2.3.GA\server\default\conf\xmdesc org.jboss.deployment.MainDeployer-xmbean.xml文件里面有这么一段内容:
Xml代码
<attribute access='read-write' setMethod='setEnhancedSuffixOrder' getMethod='getEnhancedSuffixOrder'>
<description>Allows the override of the suffix order declared by subdeployers, using the syntax [order:]suffix
</description>
<name>EnhancedSuffixOrder</name>
<type>[Ljava.lang.String;</type>
<!--
Statically set one or more enhanced suffix orders, independent of the value proposed by subdeployers.
Some deployers may also allow the suffixes/orders to be set locally, so that's preferable too.
For reference, this is the list of enhanced suffixes likely to be set by deployers (it may not
be completely up-to-date, or there can be user-defined deployers).
050:.deployer,050:-deployer.xml,100:.aop,100:-aop.xml,150:.sar,150:-service.xml,200:. ,250:.rar,300:-ds.xml,350:.har,400:.jar,400:.ejb3,400:.par,500:.war,600:.wsr,650:.ear,700:.jar,750:.zip,800:.bsh,900:.last
Until we resolve some startup issues, we'll setup some static enhanced suffix orders bellow
and leave the rest of the suffixes contributed dynamically by registering deployers.
-->
<descriptors>
<value value="250:.rar,300:-ds.xml,400:.jar,500:.war,550:.jse,650:.ear,800:.bsh"/>
</descriptors>
</attribute>
Html代码
如果我们需要在JBoss下面部署很多应用,并且有些时候这些应用相互之间需要有先后启动顺序,我们可以通过以下两种方式做到。
1、 根据实际需要,部署到不同的子目录下面
2、 通过修改下面value值来改变JBoss默认加载顺序
Xml代码
<descriptors>
<value value="250:.rar,300:-ds.xml,400:.jar,500:.war,550:.jse,650:.ear,800:.bsh,850:.deployer"/>
</descriptors>
Html代码
以下说到的版本是jboss-4.2.3.GA
并且假设JBoss安装在D:\Java\jboss-4.2.3.GA
JBoss部署的时候支持很多种格式打的包,比如说我们从deploy目录下面会看到有后缀名为deployer、sar,war,rar,xml ... (后来发现其实JBoss部署支持的格式,远远不止这些)
但是这些不同格式的应用是怎样的一个加载顺序呢?或者说有没有什么规律?带着这个疑问我在Jboss启动的时候仔细的看了一下命令行中的信息,发现两个信息:
1、 最先加载的是后缀名为deployer目录下应用或者服务;
2、 每次都会等有相同后缀名的应用(或者目录下的应用)完全加载完之后才会去加载另外一种后缀名
发现这两点之后,我就找了一下Jboss的一些配置文件,原来在D:\Java\jboss-4.2.3.GA\server\default\conf\xmdesc org.jboss.deployment.MainDeployer-xmbean.xml文件里面有这么一段内容:
Xml代码
<attribute access='read-write' setMethod='setEnhancedSuffixOrder' getMethod='getEnhancedSuffixOrder'>
<description>Allows the override of the suffix order declared by subdeployers, using the syntax [order:]suffix
</description>
<name>EnhancedSuffixOrder</name>
<type>[Ljava.lang.String;</type>
<!--
Statically set one or more enhanced suffix orders, independent of the value proposed by subdeployers.
Some deployers may also allow the suffixes/orders to be set locally, so that's preferable too.
For reference, this is the list of enhanced suffixes likely to be set by deployers (it may not
be completely up-to-date, or there can be user-defined deployers).
050:.deployer,050:-deployer.xml,100:.aop,100:-aop.xml,150:.sar,150:-service.xml,200:. ,250:.rar,300:-ds.xml,350:.har,400:.jar,400:.ejb3,400:.par,500:.war,600:.wsr,650:.ear,700:.jar,750:.zip,800:.bsh,900:.last
Until we resolve some startup issues, we'll setup some static enhanced suffix orders bellow
and leave the rest of the suffixes contributed dynamically by registering deployers.
-->
<descriptors>
<value value="250:.rar,300:-ds.xml,400:.jar,500:.war,550:.jse,650:.ear,800:.bsh"/>
</descriptors>
</attribute>
Html代码
如果我们需要在JBoss下面部署很多应用,并且有些时候这些应用相互之间需要有先后启动顺序,我们可以通过以下两种方式做到。
1、 根据实际需要,部署到不同的子目录下面
2、 通过修改下面value值来改变JBoss默认加载顺序
Xml代码
<descriptors>
<value value="250:.rar,300:-ds.xml,400:.jar,500:.war,550:.jse,650:.ear,800:.bsh,850:.deployer"/>
</descriptors>
相关文章推荐
- 从JBOSS启动的问题谈及JBOSS中jar的加载顺序
- 从JBOSS启动的问题谈及JBOSS中jar的加载顺序
- 从JBOSS启动的问题谈及JBOSS中jar的加载顺序
- iOS应用程序启动时所有方法的调用顺序
- Tomcat启动时加载数据到缓存[web.xml中listener加载顺序]
- dll文件加载运行加载的14001错误,由于应用程序配置不正确,应用程序未能启动
- jboss之启动加载过程详解(四)
- Java Web项目启动加载顺序
- web项目 启动加载顺序
- linux的加载和启动顺序(三)
- Tomcat启动后,web加载顺序
- Symbian应用程序启动顺序
- Symbian应用程序启动顺序
- 命令行启动android emulator及用adb加载应用程序
- 在jboss启动时加载class方法(定时操作)
- iOS个人整理05-应用程序的启动流程--视图控制器ViewController的加载过程--MVC架构
- Symbian应用程序启动顺序
- linux驱动模块开机自动加载,以及应用程序开机自启动
- Symbian应用程序启动顺序
- MFC SDI应用程序的启动顺序