* This method returns a method retriever that properly implements the specified behavior,
* which is determined by a user-defined system property
*/
private MethodRetriever getMethodRetriever () {
MethodRetriever methodRetriever = null;
//default behavior
boolean newSunBehavior = false;
String legacyWebmethod = null;
String postWebMethodRules = readUsePostWebMethodRulesFlag();
if (WSToolingUtils.hasValue(postWebMethodRules) && postWebMethodRules.equalsIgnoreCase("true")) {
if (log.isDebugEnabled()) {
log.debug("EndpointInterfaceDescriptionImpl: System property " + MDQConstants.USE_POST_WEB_METHOD_RULES + " set to true, all other configurations are ignored");
}
newSunBehavior = true;
} else {
//Lets make sure the default behavior is supported by packaged JDK.
//this check verifies JAX-WS2.2 tooling is supported.
newSunBehavior = isNewSunBehaviorSupported();
//The system property always overrides the manifest
//property. So, if both are set than the manifest property will be ignored
legacyWebmethod = readLegacyWebMethodFlag();
if (WSToolingUtils.hasValue(legacyWebmethod) && legacyWebmethod.equalsIgnoreCase("true")) {
if (log.isDebugEnabled()) {
log.debug("EndpointInterfaceDescriptionImpl: System or Manifest property " + MDQConstants.USE_LEGACY_WEB_METHOD_RULES + " set to true");
}
//LegacyWebmethod property set to true, use old JAX-WS tooling behavior.
newSunBehavior = false;
} else {
//If LegacyWebmehtod was not set check for sun property.
String newSunRulesFlag = getNewSunRulesFlag();
if (WSToolingUtils.hasValue(newSunRulesFlag) && newSunRulesFlag.equalsIgnoreCase("true")) {
if (log.isDebugEnabled()) {
log.debug("EndpointInterfaceDescriptionImpl: System property " + MDQConstants.USE_LEGACY_WEB_METHOD_RULES_SUN + " set to true");
}
newSunBehavior = false;
}
}
}
//Now based on the outcome of LegacyWebmethod and sun property check, retrieve methods to expose.
methodRetriever = newSunBehavior ? new PostRI216MethodRetrieverImpl(dbc, this) : new LegacyMethodRetrieverImpl(dbc, this);
//set LegacyWebmethod Definition on MethodRetriever.
methodRetriever.setLegacyWebMethod(legacyWebmethod);
if(log.isDebugEnabled()) {
if (newSunBehavior) {
log.debug("getMethodRetriever: returning a PostRI216MethodRetrieverImpl");
} else {
log.debug("getMethodRetriever: returning a LegacyMethodRetrieverImpl");