@Test void testHandlerInterceptors() throws Exception { SomeHandler annotatedEventListener = new SomeInterceptingHandler(); testSubject = new AnnotationEventHandlerAdapter(annotatedEventListener, parameterResolverFactory); testSubject.handle(asEventMessage("count")); assertEquals(3, annotatedEventListener.invocations.stream().filter("count"::equals).count()); }
@Override public Object handle(EventMessage<?> event) throws Exception { Optional<MessageHandlingMember<? super Object>> handler = inspector.getHandlers(listenerType) .filter(h -> h.canHandle(event)) .findFirst(); if (handler.isPresent()) { MessageHandlerInterceptorMemberChain<Object> interceptor = inspector.chainedInterceptor(listenerType); return interceptor.handle(event, annotatedEventListener, handler.get()); } return null; }
AnnotationEventHandlerAdapter implements EventMessageHandler { @Override public Object handle(EventMessage<?> event) throws Exception { Optional<MessageHandlingMember<? super Object>> handler = inspector.getHandlers(listenerType) .filter(h -> h.canHandle(event)) .findFirst(); if (handler.isPresent()) { MessageHandlerInterceptorMemberChain<Object> interceptor = inspector.chainedInterceptor(listenerType); return interceptor.handle(event, annotatedEventListener, handler.get()); } return null; } }
AnnotationEventHandlerAdapter implements EventMessageHandler { @Override public Object handle(EventMessage<?> event) throws Exception { Optional<MessageHandlingMember<? super Object>> handler = inspector.getHandlers(listenerType) .filter(h -> h.canHandle(event)) .findFirst(); if (handler.isPresent()) { MessageHandlerInterceptorMemberChain<Object> interceptor = inspector.chainedInterceptor(listenerType); return interceptor.handle(event, annotatedEventListener, handler.get()); } return null; } AnnotationEventHandlerAdapter(Object annotatedEventListener);  AnnotationEventHandlerAdapter(Object annotatedEventListener,
                                         ParameterResolverFactory parameterResolverFactory);  AnnotationEventHandlerAdapter(Object annotatedEventListener,
                                         ParameterResolverFactory parameterResolverFactory,
                                         HandlerDefinition handlerDefinition); }
AnnotationEventHandlerAdapter implements EventMessageHandler { @Override public Object handle(EventMessage<?> event) throws Exception { Optional<MessageHandlingMember<? super Object>> handler = inspector.getHandlers(listenerType) .filter(h -> h.canHandle(event)) .findFirst(); if (handler.isPresent()) { MessageHandlerInterceptorMemberChain<Object> interceptor = inspector.chainedInterceptor(listenerType); return interceptor.handle(event, annotatedEventListener, handler.get()); } return null; } AnnotationEventHandlerAdapter(Object annotatedEventListener);  AnnotationEventHandlerAdapter(Object annotatedEventListener,
                                         ParameterResolverFactory parameterResolverFactory);  AnnotationEventHandlerAdapter(Object annotatedEventListener,
                                         ParameterResolverFactory parameterResolverFactory,
                                         HandlerDefinition handlerDefinition); @Override Object handle(EventMessage<?> event); @Override boolean canHandle(EventMessage<?> event); @Override boolean canHandleType(Class<?> payloadType); @Override Class<?> getTargetType(); @Override void prepareReset(); @Override void prepareReset(R resetContext); @Override boolean supportsReset(); }
AnnotationEventHandlerAdapter implements EventMessageHandler { @Override public Object handle(EventMessage<?> event) throws Exception { Optional<MessageHandlingMember<? super Object>> handler = inspector.getHandlers(listenerType) .filter(h -> h.canHandle(event)) .findFirst(); if (handler.isPresent()) { MessageHandlerInterceptorMemberChain<Object> interceptor = inspector.chainedInterceptor(listenerType); return interceptor.handle(event, annotatedEventListener, handler.get()); } return null; } AnnotationEventHandlerAdapter(Object annotatedEventListener);  AnnotationEventHandlerAdapter(Object annotatedEventListener,
                                         ParameterResolverFactory parameterResolverFactory);  AnnotationEventHandlerAdapter(Object annotatedEventListener,
                                         ParameterResolverFactory parameterResolverFactory,
                                         HandlerDefinition handlerDefinition); @Override Object handle(EventMessage<?> event); @Override boolean canHandle(EventMessage<?> event); @Override boolean canHandleType(Class<?> payloadType); @Override Class<?> getTargetType(); @Override void prepareReset(); @Override void prepareReset(R resetContext); @Override boolean supportsReset();  }