开发者

Axis2 webservice (aar archive) properties file

开发者 https://www.devze.com 2022-12-24 06:47 出处:网络
I\'m currently developing a set of SOAP webservices over Axis2, deployed over a clustered WebLogic 10.3.2 environment.

I'm currently developing a set of SOAP webservices over Axis2, deployed over a clustered WebLogic 10.3.2 environment.

My webservices use some user settings that I want to be editable wi开发者_Python百科thout the need for recompiling and regenerating the AAR archive. With this in mind, I chose to put them into a properties file that is loaded and consumed in runtime.

Unfortunately, I'm having some questions about this:

As far as I know, to achieve what I want, the only option is to put the properties file into the ../axis2/WEB-INF/classes directory of each one of the deployments (on each WebLogic instance) I currently have on my clustered configuration, and then load the file, as follows (or equivalent, this has not been verified for optimization):

InputStreamReader fMainProp = new InputStreamReader(this.getClass().getResourceAsStream("myfile.properties"));
Properties mainProp = new Properties();
mainProp.load(fMainProp);

This is not as practical as I wanted it to be, because each time I want to alter some setting on the properties file, I have to edit each one of the files (deployed over different WebLogic instances) and there is a high probability of modifying one of these files without modifying the others.

What I would like to know is if there is any (better) alternative to accomplish what I want, minimizing the potential conflict of configuration that is created by distributing and replicating the properties file through multiple WebLogic instances.


Your usecase suits use of JMX.

Please see this link for details of using JMX to build custom Mbeans to manage application configurations. http://blogs.oracle.com/WebLogicServer/2009/10/developing_custom_mbeans_to_ma.html

Then you can either opt for console or WLST script based access.


You can set a System Variable in the Weblogic to hold on the absolute property file location. At the weblogic installation you will find setDomainEnv.cmd (Windows) or setDomainEnv.sh (Linux). Inside that add (append) to JAVA_OPTIONS the system variable you need. For example

-DpropLocation=C:/somewhere/The.properties 

In your code you can get the property file location by System.getProperties("propLocation"). You can add multiple System variable by adding spaces in between them.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号