[jboss-jira] [JBoss JIRA] (JGRP-1828) Allow protocols to define inline XML config
Bela Ban (JIRA)
issues at jboss.org
Fri Apr 18 08:04:34 EDT 2014
[ https://issues.jboss.org/browse/JGRP-1828?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12962757#comment-12962757 ]
Bela Ban edited comment on JGRP-1828 at 4/18/14 8:04 AM:
---------------------------------------------------------
The schema additiona would be (at the top level of the schema):
{code:xml}
<xs:complexType name="ForkStack">
<xs:sequence>
<xs:element name="config" type="ConfigType"/>
</xs:sequence>
<xs:attribute name="id" type="xs:string" use="required"/>
</xs:complexType>
{code}
and
{code:xml}
<xs:element name="fork-stacks">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="fork-stack" type="ForkStack"/>
</xs:sequence>
</xs:complexType>
</xs:element>
{code}
or, alternatively:
{code:xml}
<xs:element name="fork-stacks" xmlns="fork-stacks"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="fork-stacks "/>
{code}
The latter would reuse the already existing schema {{fork-stacks.xsd}}.
The (abridged) schema version of FORK would look like this:
{code:xml}
<xs:element name="FORK">
<xs:complexType>
<xs:attribute name="config" type="xs:string">
</xs:attribute>
<xs:attribute name="stats" type="xs:string">
<xs:attribute name="name" type="xs:string">
...
<xs:element name="fork-stacks">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="fork-stack" type="ForkStack"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:complexType>
</xs:element>
{code}
was (Author: belaban):
The schema additiona would be (at the top level of the schema):
{code:xml}
<xs:complexType name="ForkStack">
<xs:sequence>
<xs:element name="config" type="ConfigType"/>
</xs:sequence>
<xs:attribute name="id" type="xs:string" use="required"/>
</xs:complexType>
{code}
and
{code:xml}
<xs:element name="fork-stacks">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="fork-stack" type="ForkStack"/>
</xs:sequence>
</xs:complexType>
</xs:element>
{code}
or, alternatively:
{code:xml}
<xs:element name="fork-stacks" xmlns="fork-stacks"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="fork-stacks "/>
{code}
The latter would reuse the already existing schema {{fork-stacks.xsd}}.
The (abridged) schema version of FORK would look like this:
{code}
<xs:element name="FORK">
<xs:complexType>
<xs:attribute name="config" type="xs:string">
</xs:attribute>
<xs:attribute name="stats" type="xs:string">
<xs:attribute name="name" type="xs:string">
...
<xs:element name="fork-stacks">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="fork-stack" type="ForkStack"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:complexType>
</xs:element>
{code:xml}
> 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