[jboss-jira] [JBoss JIRA] (JGRP-1828) Allow protocols to define inline XML config

Bela Ban (JIRA) issues at jboss.org
Fri Apr 18 08:26:34 EDT 2014


    [ https://issues.jboss.org/browse/JGRP-1828?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12962758#comment-12962758 ] 

Bela Ban commented on JGRP-1828:
--------------------------------

Hmm, how do we do the actual parsing ? XMLConfigurator does the parsing for the entire XML config, currently. We'd have to provide hooks for a protocol do do part of this parsing on its own. E.g if the default parse encounters an element it doesn't know, it could delagate parsing of this to the protocol.
The FORK protocol already parses from an input stream, and we could simply add a second parse() method which accepts a root DOM element. The default {{Protocol.parse(Element)}} method would be a no-op.
                
> Allow protocols to define inline XML config
> -------------------------------------------
>
>                 Key: JGRP-1828
>                 URL: https://issues.jboss.org/browse/JGRP-1828
>             Project: JGroups
>          Issue Type: Feature Request
>            Reporter: Bela Ban
>            Assignee: Bela Ban
>             Fix For: 3.5
>
>
> Some protocols (e.g. RELAY2 or FORK) need additional configuration, which is usually defined in a separate XML file, e.g.
> {code:xml}
> <FORK config="/home/bela/fork-stacks.xml"/>
> {code}
> File {{fork-stacks.xml}} is:
> {code:xml}
> <fork-stacks xmlns="fork-stacks">
>     <fork-stack id="counter">
>         <config>
>             <COUNTER bypass_bundling="true"/>
>             <COMPRESS/>
>         </config>
>     </fork-stack>
>    <fork-stack id="locking">
>        <config>
>            <CENTRAL_LOCK num_backups="2"/>
>        </config>
>    </fork-stack>
> </fork-stacks>
> {code}
> It would be nice to be able to optionally define such additional configuration inline, e.g.
> {code:xml}
> <FORK>
>   <fork-stacks xmlns="fork-stacks">
>       <fork-stack id="counter">
>           <config>
>               <COUNTER bypass_bundling="true"/>
>               <COMPRESS/>
>           </config>
>       </fork-stack>
>      <fork-stack id="locking">
>          <config>
>              <CENTRAL_LOCK num_backups="2"/>
>          </config>
>      </fork-stack>
>   </fork-stacks>
> </FORK>
> {code}
> As the schema for config files is *generated*, we would have to able to tell the generator ({{XMLSchemaGenerator}}) to include a schema fragment defined by any protocol.
> A schema fragment could be defined via an annotation, e.g. {{@IncludeSchema(schema="fork-stacks.xsd"}}.
> Investigate whether this is feasible.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list