diff --git a/spring-messaging/src/main/java/org/springframework/messaging/rsocket/annotation/support/RSocketFrameTypeMessageCondition.java b/spring-messaging/src/main/java/org/springframework/messaging/rsocket/annotation/support/RSocketFrameTypeMessageCondition.java index 3288df528087..7ae1c1bf9ca1 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/rsocket/annotation/support/RSocketFrameTypeMessageCondition.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/rsocket/annotation/support/RSocketFrameTypeMessageCondition.java @@ -45,6 +45,45 @@ public class RSocketFrameTypeMessageCondition extends AbstractMessageCondition frameTypeConditionCache; @@ -56,13 +95,6 @@ public class RSocketFrameTypeMessageCondition extends AbstractMessageCondition frameTypes; @@ -179,27 +211,16 @@ public static RSocketFrameTypeMessageCondition getCondition(int cardinalityIn, i case 0: case 1: switch (cardinalityOut) { - case 0: return FF_RR_CONDITION; - case 1: return RR_CONDITION; - case 2: return RS_CONDITION; + case 0: return REQUEST_FNF_OR_RESPONSE_CONDITION; + case 1: return REQUEST_RESPONSE_CONDITION; + case 2: return REQUEST_STREAM_CONDITION; default: throw new IllegalStateException("Invalid cardinality: " + cardinalityOut); } case 2: - return RC_CONDITION; + return REQUEST_CHANNEL_CONDITION; default: throw new IllegalStateException("Invalid cardinality: " + cardinalityIn); } } - - private static final RSocketFrameTypeMessageCondition FF_CONDITION = from(FrameType.REQUEST_FNF); - private static final RSocketFrameTypeMessageCondition RR_CONDITION = from(FrameType.REQUEST_RESPONSE); - private static final RSocketFrameTypeMessageCondition RS_CONDITION = from(FrameType.REQUEST_STREAM); - private static final RSocketFrameTypeMessageCondition RC_CONDITION = from(FrameType.REQUEST_CHANNEL); - private static final RSocketFrameTypeMessageCondition FF_RR_CONDITION = FF_CONDITION.combine(RR_CONDITION); - - private static RSocketFrameTypeMessageCondition from(FrameType... frameTypes) { - return new RSocketFrameTypeMessageCondition(frameTypes); - } - }