ActiveBpel的目录和文件配置策略
2008-04-09 01:49
246 查看
ActiveBpel有很多的目录和文件配置,它对配置的处理也非常巧妙,我们分析如下:
1)CATALINA_HOME配置
有些朋友对TOMCAT的CATALINA_HOME配置感觉奇怪,其实看看TOMCAT的代码我们就能够
明白;在ActiveBpel中也有同样的配置,它是怎么实现的呢?我们看看
org.activebpel.rt.tomcat.AeProcessEngineServlet的代码就知道了.
org.activebpel.rt.tomcat.AeProcessEngineServlet用来启动bpel服务器和axis服务
器,它是随着tomcat的发布自动装载的,它启动后能够启动线程,该线程能够监听业务流
程的发布.
org.activebpel.rt.tomcat.AeProcessEngineServlet有代码如下:
public static final String CATALINA_HOME = System.getProperties
().getProperty("catalina.home");
我想您已经知道怎么回事了.
2)ServletConfig配置
我们看看web.xml文件:
bprDirectory
bpr
aeEngineConfigFile
aeEngineConfig.xml
我们再看看代码:
mBprDirectory = CATALINA_HOME + "/" + aConfig.getInitParameter
("bprDirectory");
String engineConfigFilename = aConfig.getInitParameter
("aeEngineConfigFile");
上面的aConfig就是在init(ServletConfig aConfig)中声明的,也就是,ActiveBpel启
动时直接从web.xml中读取目录和文件的配置
3)getResourceAsStream的使用
我们看看loadConfiguration方法的代码:
File file = new File(aConfigFilename);
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if(file.exists())
{
// load the configuration xml
in = new FileInputStream(file);
}
else
{
log.info("File " + aConfigFilename + " doesn't exist loading
from default classpath " + DEFAULT_BPEL_ENGINE_CONFIG);
// load the default configuration file if not in bpr directory
in = cl.getResourceAsStream(DEFAULT_BPEL_ENGINE_CONFIG);
}
如果您对ClassLoader比较熟悉,应该不难看懂上面的代码.如果/bpr/下面有配置文件,
则从该目录下读;否则,该文件可以被打包放到包里面了,那么从包中读取配置文件.
怎么样,不错吧?
1)CATALINA_HOME配置
有些朋友对TOMCAT的CATALINA_HOME配置感觉奇怪,其实看看TOMCAT的代码我们就能够
明白;在ActiveBpel中也有同样的配置,它是怎么实现的呢?我们看看
org.activebpel.rt.tomcat.AeProcessEngineServlet的代码就知道了.
org.activebpel.rt.tomcat.AeProcessEngineServlet用来启动bpel服务器和axis服务
器,它是随着tomcat的发布自动装载的,它启动后能够启动线程,该线程能够监听业务流
程的发布.
org.activebpel.rt.tomcat.AeProcessEngineServlet有代码如下:
public static final String CATALINA_HOME = System.getProperties
().getProperty("catalina.home");
我想您已经知道怎么回事了.
2)ServletConfig配置
我们看看web.xml文件:
bprDirectory
bpr
aeEngineConfigFile
aeEngineConfig.xml
我们再看看代码:
mBprDirectory = CATALINA_HOME + "/" + aConfig.getInitParameter
("bprDirectory");
String engineConfigFilename = aConfig.getInitParameter
("aeEngineConfigFile");
上面的aConfig就是在init(ServletConfig aConfig)中声明的,也就是,ActiveBpel启
动时直接从web.xml中读取目录和文件的配置
3)getResourceAsStream的使用
我们看看loadConfiguration方法的代码:
File file = new File(aConfigFilename);
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if(file.exists())
{
// load the configuration xml
in = new FileInputStream(file);
}
else
{
log.info("File " + aConfigFilename + " doesn't exist loading
from default classpath " + DEFAULT_BPEL_ENGINE_CONFIG);
// load the default configuration file if not in bpr directory
in = cl.getResourceAsStream(DEFAULT_BPEL_ENGINE_CONFIG);
}
如果您对ClassLoader比较熟悉,应该不难看懂上面的代码.如果/bpr/下面有配置文件,
则从该目录下读;否则,该文件可以被打包放到包里面了,那么从包中读取配置文件.
怎么样,不错吧?
相关文章推荐
- ActiveBpel的目录和文件配置策略
- Linux etc目录配置文件详解
- 商务通服务器版LR_Data目录下相关配置文件
- tomcat显示目录文件配置
- 配置《UNIX环境高级编程》中程序的运行环境,解决“apue.h:没有那个文件或目录”错误
- linux下的apache在httpd.conf配置目录别名和include引入自配置文件配置的方法
- linux目录结构及配置文件及常用命令
- windows下,c /c++实现磁盘扫描,结合配置文件,读取特定后缀文件目录代码
- linux下查看系统是32位还是64位,删除文件或者目录,查看ip配置命令
- ActiveBPEL2.0安装配置文档
- vue-cli脚手架config目录下index.js配置文件
- Java读取WEB-INF目录下的properties配置文件
- springmvc上传临时文件目录配置
- LNMP安装目录、配置文件位置、目录文件位置
- 一个WEB项目安装包,自动配置数据库,config文件和虚拟目录。。(原创)
- Linux 配置文件策略
- 删除root子目录,如何恢复子目录配置文件
- java 使用递归获取指定文件路径目录,删除指定的文件后缀(可扩展,根据具体需要的删除的后缀进行配置)~~
- Linux备用常用笔记——etc目录下主要配置文件解释
- 解决maven3和myeclipse8.6结合后配置文件无法自动拷贝到对应目录问题