Skip to content

Commit adfe04d

Browse files
author
Micha Kiener
committed
SPR-6424, conversation annotations
1 parent d4b1bb1 commit adfe04d

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

org.springframework.context/src/main/java/org/springframework/conversation/annotation/Conversational.java

+25-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
import java.lang.annotation.RetentionPolicy;
2323
import java.lang.annotation.Target;
2424

25+
import org.springframework.conversation.ConversationEndingType;
26+
import org.springframework.conversation.ConversationListener;
2527
import org.springframework.conversation.JoinMode;
28+
import org.springframework.conversation.manager.ConversationManager;
2629

2730
/**
2831
* If this annotation is placed on a method, it will create a new conversation
@@ -56,5 +59,26 @@
5659
*
5760
* @return the join mode to use for creating a new conversation
5861
*/
59-
JoinMode value() default JoinMode.NEW;
62+
JoinMode joinMode() default JoinMode.NEW;
63+
64+
/**
65+
* Returns the timeout to be set within the newly created conversation,
66+
* default is <code>-1</code> which means to use the default timeout as
67+
* being configured on the {@link ConversationManager}. A value of
68+
* <code>0</code> means there is no timeout any other positive value is
69+
* interpreted as a timeout in milliseconds.
70+
*
71+
* @return the timeout in milliseconds to be set on the new conversation
72+
*/
73+
long timeout() default -1;
74+
75+
/**
76+
* Returns the qualifier on how the conversation is about to be ended. This
77+
* value will be passed on to any {@link ConversationListener} registered
78+
* with the conversation being ended.
79+
*
80+
* @return the type of ending, {@link ConversationEndingType#SUCCESS} if not
81+
* explicitly specified
82+
*/
83+
ConversationEndingType endingType() default ConversationEndingType.SUCCESS;
6084
}

org.springframework.context/src/main/java/org/springframework/conversation/annotation/EndConversation.java

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
@Target(ElementType.METHOD)
4040
@Documented
4141
public @interface EndConversation {
42-
4342
/**
4443
* Returns the qualifier on how the conversation is about to be ended. This
4544
* value will be passed on to any {@link ConversationListener} registered

0 commit comments

Comments
 (0)