Search in sources :

Example 1 with AnnotationExceptionHandlerMethodResolver

use of org.springframework.messaging.handler.annotation.support.AnnotationExceptionHandlerMethodResolver in project spring-framework by spring-projects.

the class WebSocketAnnotationMethodMessageHandler method initMessagingAdviceCache.

private void initMessagingAdviceCache(List<MessagingAdviceBean> beans) {
    if (beans == null) {
        return;
    }
    for (MessagingAdviceBean bean : beans) {
        Class<?> type = bean.getBeanType();
        AnnotationExceptionHandlerMethodResolver resolver = new AnnotationExceptionHandlerMethodResolver(type);
        if (resolver.hasExceptionMappings()) {
            registerExceptionHandlerAdvice(bean, resolver);
            logger.info("Detected @MessageExceptionHandler methods in " + bean);
        }
    }
}
Also used : MessagingAdviceBean(org.springframework.messaging.handler.MessagingAdviceBean) AnnotationExceptionHandlerMethodResolver(org.springframework.messaging.handler.annotation.support.AnnotationExceptionHandlerMethodResolver)

Aggregations

MessagingAdviceBean (org.springframework.messaging.handler.MessagingAdviceBean)1 AnnotationExceptionHandlerMethodResolver (org.springframework.messaging.handler.annotation.support.AnnotationExceptionHandlerMethodResolver)1