Anatoly Akkerman wrote:

Alex Loubyansky wrote:

I am thinking about writting an MBean that will generate *-service.xml files for datasources.
I see it the following way.
- MBean attributes corresponding to values needed to construct -service.xml (such as url, driver, user, password, etc);
- XML template with dummy/default values;
- XSL stylesheet similar to what David wrote for -ds.xml;
- managed operation 'generate' that will transform XML template, probably, mostly substituting dummy values with managed attribute values.

Actually, I am looking for a nice way to configure datasources in FoeDeployer but I think it could be useful behind it.
Also the same way any -service.xml file can be generated.

Any thoughts?
Thanks.


I would strongly recommend using Jelly (from Apache) (found out about it from Rickard Oberg's weblog). You take your service-xml file and just replace values you might will need to change with expressions like ${varname}. Then you can run the XML file as a script in Jelly in a JellyContext in which you set up all the needed variables, say, from the MBean's attributes. The result of running it through Jelly is XML with the expressions properly evaluated. (Jelly is a much better replacement to JSPs and similar things, what is good about it you can run it w/o any container nonsense). You can also create your custom tag libraries like in JSPs, though it is much better than JSPs. There is not much documentation but it is pretty straight forward. Get back to me if you are having difficulties.

(You would not need XSLT either, actually, I am using Jelly in this way to automatically reconfigure application components, like EJBs or others and system-level components, like MBeans. If anyone is interested, I can share some of that stuff)

Anatoly.

Anatoly, I would be interested to know more about how you used it to automatically reconfigure your application components , so please share some of that if you can ;-))

thnx
Werner

--
----------------------------------------------------------------------
ir. Werner Ramaekers
Enterprise Java Solutions Architect - Shift@
Sun Certified Java Programmer - BeJUG steering commitee member

"May the source be with you."

Read my Blog at http://www.werner.be
----------------------------------------------------------------------




-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in
Las Vegas (supported by COMDEX), the only Apache event to be
fully supported by the ASF. http://www.apachecon.com
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to