Skip to content

Commit dbbdabd

Browse files
Update JavaDoc for Aggregate and CommandHandler.
1 parent a40e379 commit dbbdabd

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

server/src/main/java/org/spine3/server/CommandHandler.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,13 @@
3737
* <p>A command handling method is a {@code public} method that accepts two parameters.
3838
* The first parameter is a command message. The second parameter is {@link CommandContext}.
3939
*
40-
* <p>The method returns an event message of the specific type, or {@code List<Message>}
40+
* <p>The method returns an event message of the specific type, or {@code List} of messages
4141
* if it produces more than one event.
4242
*
43+
* <p>The method may throw one or more throwables derived from {@link FailureThrowable}.
44+
* Throwing a {@code FailureThrowable} indicates that the passed command cannot be handled
45+
* because of a business failure.
46+
*
4347
* @author Alexander Yevsyukov
4448
* @see CommandDispatcher
4549
*/

server/src/main/java/org/spine3/server/aggregate/Aggregate.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@
5151
import static com.google.common.base.Throwables.propagate;
5252
import static org.spine3.base.Identifiers.idToAny;
5353

54-
//TODO:2016-02-17:alexander.yevsyukov: Describe dealing with command validation and throwing Failures.
55-
//TODO:2016-02-17:alexander.yevsyukov: Describe (not) throwing exceptions.
56-
5754
/**
5855
* Abstract base for aggregates.
5956
*
@@ -74,17 +71,17 @@
7471
* </ol>
7572
*
7673
* <h2>Adding command handler methods</h2>
77-
* <p>Command handling methods in the an aggregate are defined in the same was as described in {@link CommandHandler}.
74+
* <p>Command handling methods of an aggregate are defined in the same way as described in {@link CommandHandler}.
7875
*
7976
* <h2>Adding event applier methods</h2>
80-
* <p>Aggregate data is stored as sequence of events it produces. In order to restore the state of the aggregate
81-
* these events are passed to the {@link #play(Iterable)} method, which invokes corresponding
82-
* <em>applier methods</em>.
77+
* <p>Aggregate data is stored as sequence of events it produces. The state of the aggregate
78+
* is restored by re-playing the history of events and invoking corresponding <em>event applier methods</em>.
8379
*
8480
* <p>An event applier is a method that changes the state of the aggregate in response to an event. The aggregate
8581
* must have applier methods for <em>all</em> event types it produces. An event applier takes a single parameter
86-
* of the event message it handles and returns {@code void}. The modification of the state is done via a builder
87-
* instance obtained from {@link #getBuilder()}.
82+
* of the event message it handles and returns {@code void}.
83+
*
84+
* <p>The modification of the state is done via a builder instance obtained from {@link #getBuilder()}.
8885
*
8986
* @param <I> the type for IDs of this class of aggregates
9087
* @param <S> the type of the state held by the aggregate

0 commit comments

Comments
 (0)