}
private static List buildHandlerInfoList(ServiceRefHandlerType[] handlers, ClassLoader classLoader) throws DeploymentException {
List handlerInfos = new ArrayList();
for (int i = 0; i < handlers.length; i++) {
ServiceRefHandlerType handler = handlers[i];
org.apache.geronimo.xbeans.j2ee.String[] portNameArray = handler.getPortNameArray();
List portNames = new ArrayList();
for (int j = 0; j < portNameArray.length; j++) {
portNames.add(portNameArray[j].getStringValue().trim());
}
// Set portNames = new HashSet(Arrays.asList(portNameArray));
String handlerClassName = handler.getHandlerClass().getStringValue().trim();
Class handlerClass = null;
try {
handlerClass = ClassLoading.loadClass(handlerClassName, classLoader);
} catch (ClassNotFoundException e) {
throw new DeploymentException("Could not load handler class", e);
}
Map config = new HashMap();
ParamValueType[] paramValues = handler.getInitParamArray();
for (int j = 0; j < paramValues.length; j++) {
ParamValueType paramValue = paramValues[j];
String paramName = paramValue.getParamName().getStringValue().trim();
String paramStringValue = paramValue.getParamValue().getStringValue().trim();
config.put(paramName, paramStringValue);
}
XsdQNameType[] soapHeaderQNames = handler.getSoapHeaderArray();
QName[] headerQNames = new QName[soapHeaderQNames.length];
for (int j = 0; j < soapHeaderQNames.length; j++) {
XsdQNameType soapHeaderQName = soapHeaderQNames[j];
headerQNames[j] = soapHeaderQName.getQNameValue();
}
Set soapRoles = new HashSet();
for (int j = 0; j < handler.getSoapRoleArray().length; j++) {
String soapRole = handler.getSoapRoleArray(j).getStringValue().trim();
soapRoles.add(soapRole);
}
ServiceReferenceBuilder.HandlerInfoInfo handlerInfoInfo = new ServiceReferenceBuilder.HandlerInfoInfo(new HashSet(portNames), handlerClass, config, headerQNames, soapRoles);
handlerInfos.add(handlerInfoInfo);
}