Thanks, Anatoly. I'll check it. Also I thought about Velocity which looks similar to Jelly from your description, though I am not familiar with the last one.

Could you, please, look at the following idea with XML/XSL, compare it with Jelly and give your opinion?
- before transformation, each MBean's attribute is set as a parameter to the Transformer with Transformer.setParameter(...) with the name equal to the corresponding parameter name used in XSL stylesheet;
- transform XML template with Transformer and XSL stylesheet.

As for me, XML/XSL requires two templates (XML and XSL) while Jelly/Velocity requires only one.

Also, I wouldn't add any thirdparty library unless it really helps. The JBoss becomes so heavy. I think it's problem.

Thanks.

alex

On Sat, 26 Oct 2002 20:08:08 -0400
Anatoly Akkerman <[EMAIL PROTECTED]> 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.
----
Free Mail http://ua.fm

-------------------------------------------------------
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