INT-3379 - Allow Placeholders for Enums

JIRA: https://jira.spring.io/browse/INT-3379

Change enumerated attributes to a union with xsd:string
to allow placeholders.

JMS and XML deferred to 4.1 due to the amount of
changes needed to the parsers. See INT-3384.
This commit is contained in:
Gary Russell
2014-04-23 09:08:14 -04:00
parent d2f3aa95a7
commit aeeb9db4f6
13 changed files with 236 additions and 164 deletions

View File

@@ -334,28 +334,7 @@
</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="round-robin">
<xsd:annotation>
<xsd:documentation>
[DEFAULT] Defines a Round Robin dispatching strategy which allows
load balancing of messages
between multiple Message Handlers. Which
message
handler receives the message first is determined by the 'order'
attribute
of such Message Handler.
</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="none">
<xsd:annotation>
<xsd:documentation>
No LoadBalancingStrategy will be used.
</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
</xsd:restriction>
<xsd:union memberTypes="loadBalancerEnumeration xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="failover" type="xsd:string">
@@ -404,6 +383,31 @@
<xsd:attributeGroup ref="subscribersAttributeGroup" />
</xsd:complexType>
<xsd:simpleType name="loadBalancerEnumeration">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="round-robin">
<xsd:annotation>
<xsd:documentation>
[DEFAULT] Defines a Round Robin dispatching strategy which allows
load balancing of messages
between multiple Message Handlers. Which
message
handler receives the message first is determined by the 'order'
attribute
of such Message Handler.
</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="none">
<xsd:annotation>
<xsd:documentation>
No LoadBalancingStrategy will be used.
</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="publish-subscribe-channel">
<xsd:annotation>
<xsd:documentation>
@@ -1751,10 +1755,7 @@
]]></xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="MILLISECONDS" />
<xsd:enumeration value="SECONDS" />
</xsd:restriction>
<xsd:union memberTypes="timeUnitEnumeration xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="cron" type="xsd:string">
@@ -1793,6 +1794,13 @@
</xsd:attribute>
</xsd:complexType>
<xsd:simpleType name="timeUnitEnumeration">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="MILLISECONDS" />
<xsd:enumeration value="SECONDS" />
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="selector-chain">
<xsd:complexType>
<xsd:annotation>
@@ -1812,17 +1820,21 @@
]]></xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="ALL" />
<xsd:enumeration value="ANY" />
<xsd:enumeration value="MAJORITY" />
<xsd:enumeration value="MAJORITY_OR_TIE" />
</xsd:restriction>
<xsd:union memberTypes="votingStrategyEnumeration xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="votingStrategyEnumeration">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="ALL" />
<xsd:enumeration value="ANY" />
<xsd:enumeration value="MAJORITY" />
<xsd:enumeration value="MAJORITY_OR_TIE" />
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="selector">
<xsd:complexType>
<xsd:complexContent>
@@ -3687,15 +3699,7 @@
]]></xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="REQUIRED" />
<xsd:enumeration value="SUPPORTS" />
<xsd:enumeration value="MANDATORY" />
<xsd:enumeration value="REQUIRES_NEW" />
<xsd:enumeration value="NOT_SUPPORTED" />
<xsd:enumeration value="NEVER" />
<xsd:enumeration value="NESTED" />
</xsd:restriction>
<xsd:union memberTypes="propagationEnumeration xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="isolation" default="DEFAULT">
@@ -3705,13 +3709,7 @@
]]></xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="DEFAULT" />
<xsd:enumeration value="READ_UNCOMMITTED" />
<xsd:enumeration value="READ_COMMITTED" />
<xsd:enumeration value="REPEATABLE_READ" />
<xsd:enumeration value="SERIALIZABLE" />
</xsd:restriction>
<xsd:union memberTypes="isolationEnumeration xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="timeout" type="xsd:string" default="-1">
@@ -3743,6 +3741,28 @@
</xsd:attribute>
</xsd:complexType>
<xsd:simpleType name="propagationEnumeration">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="REQUIRED" />
<xsd:enumeration value="SUPPORTS" />
<xsd:enumeration value="MANDATORY" />
<xsd:enumeration value="REQUIRES_NEW" />
<xsd:enumeration value="NOT_SUPPORTED" />
<xsd:enumeration value="NEVER" />
<xsd:enumeration value="NESTED" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="isolationEnumeration">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="DEFAULT" />
<xsd:enumeration value="READ_UNCOMMITTED" />
<xsd:enumeration value="READ_COMMITTED" />
<xsd:enumeration value="REPEATABLE_READ" />
<xsd:enumeration value="SERIALIZABLE" />
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="pseudoTransactionalType">
<xsd:attributeGroup ref="transactionSyncAttributeGroup" />
</xsd:complexType>

View File

@@ -2,13 +2,21 @@
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd"
xmlns:util="http://www.springframework.org/schema/util">
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<context:property-placeholder properties-ref="props"/>
<util:properties id="props">
<beans:prop key="failover">false</beans:prop>
</util:properties>
<channel id="noLoadBalancerNoFailover" >
<dispatcher load-balancer="none" failover="false"/>
<dispatcher load-balancer="none" failover="${failover}"/>
</channel>
<channel id="noLoadBalancerNoFailoverExecutor" >
<dispatcher load-balancer="none" failover="false" task-executor="taskExecutor"/>

View File

@@ -2,17 +2,25 @@
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd">
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<context:property-placeholder properties-ref="props"/>
<util:properties id="props">
<beans:prop key="majority">MAJORITY</beans:prop>
</util:properties>
<selector-chain id="selectorChain">
<selector ref="selector1"/>
<selector ref="selector2"/>
</selector-chain>
<selector-chain id="nestedSelectorChain" voting-strategy="MAJORITY">
<selector-chain id="nestedSelectorChain" voting-strategy="${majority}">
<selector ref="selector1"/>
<selector-chain voting-strategy="ALL">
<selector ref="selector2"/>

View File

@@ -2,11 +2,19 @@
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd">
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<poller id="poller" receive-timeout="1234" fixed-rate="5" time-unit="SECONDS"/>
<context:property-placeholder properties-ref="props"/>
<util:properties id="props">
<beans:prop key="seconds">SECONDS</beans:prop>
</util:properties>
<poller id="poller" receive-timeout="1234" fixed-rate="5" time-unit="${seconds}"/>
</beans:beans>

View File

@@ -2,10 +2,19 @@
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd">
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<context:property-placeholder properties-ref="props"/>
<util:properties id="props">
<beans:prop key="required">REQUIRED</beans:prop>
<beans:prop key="readCommitted">READ_COMMITTED</beans:prop>
</util:properties>
<channel id="input">
<queue capacity="1"/>
@@ -21,7 +30,7 @@
method="good"
output-channel="output">
<poller max-messages-per-poll="1" fixed-delay="10000">
<transactional transaction-manager="txManager" propagation="REQUIRED"/>
<transactional transaction-manager="txManager" propagation="${required}" isolation="${readCommitted}"/>
</poller>
</service-activator>