INT-2516 Warn for Invalid request-payload-type

Issue initialization warning on inappropriate
request-payload-type attribute on Http Inbound Endpoint.
This commit is contained in:
Oleg Zhurakousky
2012-06-06 10:36:02 -04:00
committed by Gary Russell
parent 956e7bcd0d
commit 4e9d22eb7b

View File

@@ -296,6 +296,8 @@ abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewaySuppor
} }
} }
} }
this.validateSupportedMethods();
} }
/** /**
@@ -512,4 +514,17 @@ abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewaySuppor
} }
return evaluationContext; return evaluationContext;
} }
private void validateSupportedMethods() {
if (this.requestPayloadType != null){
for (HttpMethod httpMethod : this.supportedMethods) {
if (HttpMethod.GET.equals(httpMethod) || HttpMethod.HEAD.equals(httpMethod) || HttpMethod.OPTIONS.equals(httpMethod)){
if (logger.isWarnEnabled()){
logger.warn("The 'requestPayloadType' attribute will have no relevance for one of the specified HTTP methods '" +
httpMethod + "'");
}
}
}
}
}
} }