Skip to content

Commit

Permalink
Proposal: SagaLifecycle.associationValues(). #1125
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDrivenMitch committed Mar 17, 2022
1 parent 918ddad commit a23f268
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import org.axonframework.messaging.Scope;
import org.axonframework.messaging.ScopeDescriptor;

import java.util.Set;

/**
* Abstract base class of a component that models a saga's life cycle.
*/
Expand Down Expand Up @@ -87,6 +89,15 @@ public static void end() {
getInstance().doEnd();
}

/**
* Retrieves all current {@link AssociationValue} that are currently associated with the saga that is being
* executed.
* @return All current {@link AssociationValue} that are currently associated with the saga
*/
public static Set<AssociationValue> associationValues() {
return getInstance().getAssociationValues().asSet();
}

/**
* {@link SagaLifecycle} instance method to mark the current saga as ended.
*/
Expand All @@ -108,6 +119,8 @@ public static void end() {
*/
protected abstract void doAssociateWith(AssociationValue associationValue);

protected abstract AssociationValues getAssociationValues();

/**
* Get the current {@link SagaLifecycle} instance for the current thread. If none exists an {@link
* IllegalStateException} is thrown.
Expand Down

0 comments on commit a23f268

Please sign in to comment.