Skip to content

Commit

Permalink
Removed requirement to use <repositories> element in DisruptorCommandBus
Browse files Browse the repository at this point in the history
It is an optional element, as repositories can now also be specified
outside of the <disruptor-command-bus> element.
Also updated quickstart sample

Issue #AXON-275 Comment
  • Loading branch information
abuijze committed Jan 12, 2015
1 parent 4efacb8 commit d3a631a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
Expand Up @@ -99,11 +99,13 @@ protected AbstractBeanDefinition parseInternal(Element element, ParserContext pa
.addConstructorArgValue(configurationDefinition)
.getBeanDefinition();
Element repoElement = DomUtils.getChildElementByTagName(element, ELEMENT_REPOSITORIES);
List<Element> repositories = DomUtils.getChildElementsByTagName(repoElement, ELEMENT_REPOSITORY);
String id = super.resolveId(element, definition, parserContext);
for (Element repository : repositories) {
parseRepository(repository, id, parserContext,
configurationDefinition.getPropertyValues().getPropertyValue("cache"));
if (repoElement != null) {
List<Element> repositories = DomUtils.getChildElementsByTagName(repoElement, ELEMENT_REPOSITORY);
String id = super.resolveId(element, definition, parserContext);
for (Element repository : repositories) {
parseRepository(repository, id, parserContext,
configurationDefinition.getPropertyValues().getPropertyValue("cache"));
}
}
definition.setDestroyMethodName("stop");
return definition;
Expand Down
Expand Up @@ -386,7 +386,7 @@
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="repositories">
<xsd:element name="repositories" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Wrapper element for a list of &lt;repository&gt; elements. Each child
element defines a supported aggregate type and the identifier of the repository to
Expand Down
14 changes: 7 additions & 7 deletions quickstart/src/main/resources/disruptor-config.xml
Expand Up @@ -15,16 +15,16 @@
~ limitations under the License.
-->

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:axon="http://www.axonframework.org/schema/core"
xmlns="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.axonframework.org/schema/core http://www.axonframework.org/schema/axon-core.xsd">

<axon:disruptor-command-bus id="commandBus" event-bus="eventBus" event-store="eventStore">
<axon:repositories>
<axon:repository id="toDoRepository" aggregate-type="org.axonframework.quickstart.annotated.ToDoItem"/>
</axon:repositories>
</axon:disruptor-command-bus>
<axon:disruptor-command-bus id="commandBus" event-bus="eventBus" event-store="eventStore"/>

<axon:disruptor-repository id="toDoRepository"
aggregate-type="org.axonframework.quickstart.annotated.ToDoItem"
command-bus="commandBus"/>

<bean id="commandGateway" class="org.axonframework.commandhandling.gateway.CommandGatewayFactoryBean">
<property name="commandBus" ref="commandBus"/>
Expand Down

0 comments on commit d3a631a

Please sign in to comment.