[jboss-dev-forums] [Design of JBoss ESB] - Re: Configuration - normalization
tfennelly
do-not-reply at jboss.com
Tue Dec 12 05:23:21 EST 2006
"kurt.stam at jboss.com" wrote : I've been working with Dave and Tom, and the current design is such that we're building a ConfigurationController, which monitors the file mentioned above call jbossesb.xml. When updates to this file occur the controller reloads the file. Validates it against it's xsd (the current version can be found here: http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb.xsd
| When the document passes validation it will run through a an xslt process which generates new versions of the jbossesb-listener.xml and jbossesb-gateway.xml, which in turn will get picked up by the current Listener and Gateway controller. The idea is that this code is pretty much a facade to the current configuration.
|
| --Kurt
After looking at the XSD and what we need to generate from it, I think it would be quite difficult to do this with XSLT. So, where I'm at is - using XMLBeans to build a config model from the XSD based config and from that, generate the 2 configs we need (ala the current format).
I think that performing this generation with anything other than raw Java would be difficult because the XSD is so highly normalised. We need to be able to iterate over and jump around the XSD based config model instance in order to generate the current "ConfigTree" type configurations. Of course this is possible in XSLT, but I think it's far easier in something like Java.
So basically, we have a "Generator" class which looks as follows:
| public class Generator {
|
| /**
| * Public constructor.
| * @param config The input configuration file.
| * @throws ConfigurationException Bad listener ESB configuration.
| * @throws IOException Unable to read the ESB listener configuration.
| */
| public Generator(File config) throws ConfigurationException, IOException {...}
|
| /**
| * Get the list of server names for which the configuration instance (supplied at
| * construction)specifies configurations.
| * @return List of server names.
| */
| public List<String> getServers() {...}
|
| /**
| * Generate the configuration set for the named server in the supplied output directory.
| * <p/>
| * The names of the generated files will be <i><serverName></i>-esb-config.xml
| * (ESB Aware Listeners configuration) and <i><serverName></i>-esb-config-gateway.xml
| * (Gateway Listeners configuration).
| *
| * @param serverName The server name.
| * @param outdir The output directory to where the configuration set is to be generated.
| * The directory will be created if it doesn't already exist.
| * @throws ConfigurationException Failed to generate configuration set.
| */
| public void generate(String serverName, File outdir) throws ConfigurationException {...}
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993007#3993007
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993007
More information about the jboss-dev-forums
mailing list