if (isInOnly) {
//IN parameters just use their own type
try {
paramJavaType = ClassLoading.loadClass(paramJavaTypeName, classLoader);
} catch (ClassNotFoundException e) {
throw new DeploymentException("could not load parameter type", e);
}
return paramJavaType;
} else {
//INOUT and OUT parameters use holders. See jaxrpc spec 4.3.5
String holderName;
if (isComplexType) {
//complex types get mapped:
//package is determined from the namespace to package map + ".holders"
//class name is the complex type QNMAne local part + "Holder", with the initial character uppercased.
String namespace = typeQName.getNamespaceURI();
String packageName = WSDescriptorParser.getPackageFromNamespace(namespace, mapping);
StringBuffer buf = new StringBuffer(packageName.length() + typeQName.getLocalPart().length() + 14);
buf.append(packageName).append(".holders.").append(typeQName.getLocalPart()).append("Holder");
buf.setCharAt(packageName.length() + 9, Character.toUpperCase(typeQName.getLocalPart().charAt(0)));
holderName = buf.toString();
} else {
//see if it is in the primitive type and simple type mapping
try {
paramJavaType = ClassLoading.loadClass(paramJavaTypeName, classLoader);
} catch (ClassNotFoundException e) {
throw new DeploymentException("could not load parameter type", e);
}
Class holder = rpcHolderClasses.get(paramJavaType);
if (holder != null) {
try {
//TODO use class names in map or make sure we are in the correct classloader to start with.
holder = ClassLoading.loadClass(holder.getName(), classLoader);
} catch (ClassNotFoundException e) {
throw new DeploymentException("could not load holder type in correct classloader", e);
}
return holder;
}
//Otherwise, the holder must be in:
//package same as type's package + ".holders"
//class name same as type name + "Holder"
String paramTypeName = paramJavaType.getName();
StringBuffer buf = new StringBuffer(paramTypeName.length() + 14);
int dot = paramTypeName.lastIndexOf(".");
//foo.Bar >>> foo.holders.BarHolder
buf.append(paramTypeName.substring(0, dot)).append(".holders").append(paramTypeName.substring(dot)).append("Holder");
holderName = buf.toString();
}
try {
return ClassLoading.loadClass(holderName, classLoader);
} catch (ClassNotFoundException e) {
throw new DeploymentException("Could not load holder class", e);
}
}
}