Permalink
Browse files

Minor optimizations, code style and javadoc

  • Loading branch information...
1 parent 2ebc8b1 commit 76026feeb304947ad9658d55d17c8410b529d6ea @abuijze abuijze committed Mar 27, 2014
View
8 .../java/org/axonframework/commandhandling/annotation/AggregateAnnotationCommandHandler.java
@@ -219,8 +219,8 @@ public AggregateAnnotationCommandHandler(Class<T> aggregateType, Repository<T> r
@Deprecated
public synchronized void unsubscribe() {
if (commandBus != null) {
- for (Map.Entry<String, CommandHandler<Object>> handlerEntry : handlers.entrySet()) {
- commandBus.unsubscribe(handlerEntry.getKey(), handlerEntry.getValue());
+ for (String commandType : handlers.keySet()) {
+ commandBus.unsubscribe(commandType, this);
}
}
}
@@ -237,8 +237,8 @@ public synchronized void unsubscribe() {
@Deprecated
public synchronized void subscribe() {
if (commandBus != null) {
- for (Map.Entry<String, CommandHandler<Object>> handlerEntry : handlers.entrySet()) {
- commandBus.subscribe(handlerEntry.getKey(), handlerEntry.getValue());
+ for (String commandType : handlers.keySet()) {
+ commandBus.subscribe(commandType, this);
}
}
}
View
2 core/src/main/java/org/axonframework/commandhandling/disruptor/DisruptorCommandBus.java
@@ -256,7 +256,7 @@ public void dispatch(final CommandMessage<?> command) {
int invokerSegment = 0;
int publisherSegment = 0;
int serializerSegment = 0;
- if ((commandHandlerInvokers.length > 1 || publisherCount > 1 || serializerCount > 0)) {
+ if ((commandHandlerInvokers.length > 1 || publisherCount > 1 || serializerCount > 1)) {
Object aggregateIdentifier = commandTargetResolver.resolveTarget(command).getIdentifier();
if (aggregateIdentifier != null) {
int idHash = aggregateIdentifier.hashCode() & Integer.MAX_VALUE;
View
3 core/src/main/java/org/axonframework/common/Priority.java
@@ -23,6 +23,9 @@
import java.lang.annotation.Target;
/**
+ * Indicates the relative priority of the annotated component. Components with a higher priority are considered before
+ * those with lower priority.
+ *
* @author Allard Buijze
* @since 2.1
*/

0 comments on commit 76026fe

Please sign in to comment.