Enable default message processor as fallback
This commit enables what was actually intended in the first place: for implementing a facet, you only need to specify processors that change the default behaviour.
@@ -137,14 +137,15 @@ public class FacetTypeSlipComputer implements InitializingBean, ApplicationConte
if(matches(annotation, messageType, direction, facetType)){
return pair.getKey().toString();
}
- } else {
+ }
+ //either facetType is null or we did not find a FacetMessageProcessor for it
+ // try to find a DefaultFacetMessageProcessor to handle the message
Annotation annotation = AopUtils.getTargetClass(facet).getAnnotation(DefaultFacetMessageProcessor
.class);
- if(matches(annotation, messageType, direction, facetType)){
+ if(matches(annotation, messageType, direction, null)){
return pair.getKey().toString();
}
}
- }
throw new WonMessageProcessingException(String.format("unexpected combination of messageType %s, " +
"facetType %s and direction %s encountered", messageType, facetType, direction));
}
