Skip to content

Commit 4bf6f03

Browse files
committed
hmm
1 parent a1fe6cb commit 4bf6f03

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/main/java/com/mangasite/config/init/AvajeSpringAdapter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
package com.mangasite.config.init;
22

33
import org.springframework.messaging.handler.MessagingAdviceBean;
4-
import org.springframework.web.method.ControllerAdviceBean;
4+
5+
import com.mangasite.rsocket.RSocketAdvice;
56

67
public 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
}

0 commit comments

Comments
 (0)