ActiveBpel's directory and file configuration strategy

xiaoxiao2021-03-06  59

ActiveBpel has a lot of directory and file configuration, which has also been very cleverly configured, we analyze as follows:

1) Catalina_home Configuring Some friends feel strange to Tomcat's Catalina_home configuration, in fact, see Tomcat's code we can

Understand; in ActiveBpel, how is it implemented? Let's see

Org.activebpel.rt.Tomcat.AeprocesSsengineServlet code knows .org.activebpel.rt.tomcat.AeprocesSsengineServlets to launch BPEL Server and AXIS services

User, as the Tomcat is released automatically, it is booted after startup, the thread can listen to business flows.

Cheng's release .org.activebpel.rt.Tomcat.AeprocesSsengineServlet has code as follows:

Public Static Final String Catalina_Home = System.getProperties

() .GetProperty ("catalina.home"); I think you already know what is going on.

2) ServletConfig Configuration We look at the web.xml file: BPRDIRECTORY BPR

Directory -> aeengineconfigfile aeengineconfig.xml Let's take a look at the code: MbPrdirectory = Catalina_Home "/" aconfig.getinitparameter

("BPRDIRECTORY"); string engineconfigfilename = aconfig.getinitparameter

("aeengineconfigfile"); The above ACONFIG is declared in init (servletconfig aconfig, that is, ActiveBpel

Use the directory and file configuration directly from Web.xml

3) getResourceAsStream using our method look at the code 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);} If you are familiar with ClassLoader, should not be difficult to understand if the above code / bpr / below. There is a configuration file, then read from this directory; otherwise, the file can be packaged in the package, then read the configuration file from the package.

How, good?

转载请注明原文地址:https://www.9cbs.com/read-118629.html

New Post(0)