File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed
src/main/java/com/mangasite/config/init Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,8 @@ public void initialize(GenericApplicationContext context) {
7777 .addCustomResolver (new AuthenticationPrincipalArgumentResolver ());
7878
7979 handler .registerMessagingAdvice (
80- new ControllerAdviceWrapper (context .getBean (ControllerAdviceBean .class )));
80+ new ControllerAdviceWrapper (
81+ new ControllerAdviceBean (scope .get (RSocketAdvice .class ))));
8182 });
8283 }
8384}
Original file line number Diff line number Diff line change 11package com .mangasite .config .init ;
22
33import org .springframework .messaging .handler .MessagingAdviceBean ;
4- import org .springframework .web .method .ControllerAdviceBean ;
4+
5+ import com .mangasite .rsocket .RSocketAdvice ;
56
67public class ControllerAdviceWrapper implements MessagingAdviceBean {
7- private final ControllerAdviceBean delegate ;
8+ private final RSocketAdvice delegate ;
89
9- public ControllerAdviceWrapper (ControllerAdviceBean delegate ) {
10- this .delegate = delegate ;
10+ public ControllerAdviceWrapper (RSocketAdvice rSocketAdvice ) {
11+ this .delegate = rSocketAdvice ;
1112 }
1213
1314 @ Override
1415 public int getOrder () {
15- return delegate . getOrder () ;
16+ return 1 ;
1617 }
1718
1819 @ Override
1920 public Class <?> getBeanType () {
20- return delegate .getBeanType ();
21+ return delegate .getClass ();
2122 }
2223
2324 @ Override
2425 public Object resolveBean () {
25- return delegate . resolveBean () ;
26+ return delegate ;
2627 }
2728
2829 @ Override
2930 public boolean isApplicableToBeanType (Class <?> beanType ) {
30- return delegate .isApplicableToBeanType ( beanType );
31+ return beanType . isAssignableFrom ( delegate .getClass () );
3132 }
3233 // delegate all methods
3334}
You can’t perform that action at this time.
0 commit comments