use of org.apache.shenyu.admin.controller.ShenyuHttpRegistryController in project incubator-shenyu by apache.
the class ShenyuHttpRegistryControllerBeanPostProcessor method postProcessAfterInitialization.
@Override
public Object postProcessAfterInitialization(final Object bean, final String beanName) throws BeansException {
if (bean instanceof ShenyuHttpRegistryController) {
try {
RequestMappingHandlerMapping requestMappingHandlerMapping = SpringBeanUtils.getInstance().getBean(RequestMappingHandlerMapping.class);
Method method = requestMappingHandlerMapping.getClass().getSuperclass().getSuperclass().getDeclaredMethod("detectHandlerMethods", Object.class);
method.setAccessible(true);
method.invoke(requestMappingHandlerMapping, beanName);
} catch (Exception e) {
throw new ShenyuException(e.getMessage());
}
}
return bean;
}
Aggregations