File tree Expand file tree Collapse file tree
src/main/java/org/comroid/interaction Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ public Class<String> getResponseType() {
5454 @ Override
5555 public void sendResponse (InteractionContext context , String response ) {
5656 output .println (response );
57+ log .info (response );
5758 }
5859
5960 @ Override
Original file line number Diff line number Diff line change @@ -114,11 +114,16 @@ public void invoke() {
114114
115115 @ SuppressWarnings ("unchecked" )
116116 private void handleResponse (final Object response ) {
117- components (ResponseConverter .class ).map (converter -> converter .convertResponse (response )).filter (Objects ::nonNull ).forEach (formatted -> {
118- var fType = formatted .getClass ();
119- components (ResponseHandler .class ).filter (handler -> handler .getResponseType ().isAssignableFrom (fType ))
120- .forEach (handler -> handler .sendResponse (this , formatted ));
121- });
117+ components (ResponseConverter .class ).distinct ()
118+ .map (converter -> converter .convertResponse (response ))
119+ .distinct ()
120+ .filter (Objects ::nonNull )
121+ .forEach (formatted -> {
122+ var fType = formatted .getClass ();
123+ components (ResponseHandler .class ).distinct ()
124+ .filter (handler -> handler .getResponseType ().isAssignableFrom (fType ))
125+ .forEach (handler -> handler .sendResponse (this , formatted ));
126+ });
122127 }
123128
124129 private static Supplier <RuntimeException > noSuchCommand (String name ) {
You can’t perform that action at this time.
0 commit comments