26
26
import io .rsocket .SocketAcceptor ;
27
27
import reactor .core .publisher .Mono ;
28
28
29
+ import org .springframework .core .ReactiveAdapterRegistry ;
29
30
import org .springframework .core .codec .Decoder ;
30
31
import org .springframework .core .codec .Encoder ;
31
32
import org .springframework .lang .Nullable ;
@@ -69,8 +70,26 @@ public class RSocketMessageHandler extends MessageMappingMessageHandler {
69
70
private MimeType defaultMetadataMimeType = MessagingRSocket .COMPOSITE_METADATA ;
70
71
71
72
73
+ /**
74
+ * {@inheritDoc}
75
+ * <p>If {@link #setRSocketStrategies(RSocketStrategies) rsocketStrategies}
76
+ * is also set, this property is re-initialized with the decoders in it.
77
+ * Or vice versa, if {@link #setRSocketStrategies(RSocketStrategies)
78
+ * rsocketStrategies} is not set, it will be initialized from this and
79
+ * other properties.
80
+ */
81
+ @ Override
82
+ public void setDecoders (List <? extends Decoder <?>> decoders ) {
83
+ super .setDecoders (decoders );
84
+ }
85
+
72
86
/**
73
87
* Configure the encoders to use for encoding handler method return values.
88
+ * <p>If {@link #setRSocketStrategies(RSocketStrategies) rsocketStrategies}
89
+ * is also set, this property is re-initialized with the encoders in it.
90
+ * Or vice versa, if {@link #setRSocketStrategies(RSocketStrategies)
91
+ * rsocketStrategies} is not set, it will be initialized from this and
92
+ * other properties.
74
93
*/
75
94
public void setEncoders (List <? extends Encoder <?>> encoders ) {
76
95
this .encoders .addAll (encoders );
@@ -84,12 +103,12 @@ public List<? extends Encoder<?>> getEncoders() {
84
103
}
85
104
86
105
/**
87
- * Provide configuration in the form of {@link RSocketStrategies}. This is
88
- * an alternative to using {@link #setEncoders(List)},
89
- * {@link #setDecoders(List)}, and others directly. It is convenient when
90
- * you also configuring an {@link RSocketRequester} in which case the
91
- * {@link RSocketStrategies} encapsulates required configuration for re-use.
92
- * @param rsocketStrategies the strategies to use
106
+ * Provide configuration in the form of {@link RSocketStrategies} instance
107
+ * which can also be re-used to initialize a client-side
108
+ * {@link RSocketRequester}. When this property is set, it also sets
109
+ * {@link #setDecoders(List) decoders}, {@link #setEncoders(List) encoders},
110
+ * and {@link #setReactiveAdapterRegistry(ReactiveAdapterRegistry)
111
+ * reactiveAdapterRegistry}.
93
112
*/
94
113
public void setRSocketStrategies (@ Nullable RSocketStrategies rsocketStrategies ) {
95
114
this .rsocketStrategies = rsocketStrategies ;
@@ -100,6 +119,10 @@ public void setRSocketStrategies(@Nullable RSocketStrategies rsocketStrategies)
100
119
}
101
120
}
102
121
122
+ /**
123
+ * Return the configured {@link RSocketStrategies}. This may be {@code null}
124
+ * before {@link #afterPropertiesSet()} is called.
125
+ */
103
126
@ Nullable
104
127
public RSocketStrategies getRSocketStrategies () {
105
128
return this .rsocketStrategies ;
0 commit comments