// to see if the current iterator handler is intended for this service.
// TODO review: need to check for null getHandlerClass() return?
// or will schema not allow it?
String portHandler = handlerType.getHandlerClass().getValue();
Handler handler = null;
// instantiate portHandler class
try {
handler = createHandlerInstance(loadClass(portHandler));
} catch (Exception e) {
// TODO: should we just ignore this problem?
throw ExceptionFactory.makeWebServiceException(e);
}
if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
log.debug("Successfully instantiated the class: " + handler.getClass());
}
// 9.2.1.2 sort them by Logical, then SOAP
if (LogicalHandler.class.isAssignableFrom(handler.getClass()))
handlers.add((LogicalHandler) handler);
else if (SOAPHandler.class.isAssignableFrom(handler.getClass()))
// instanceof ProtocolHandler
handlers.add((SOAPHandler) handler);
else if (Handler.class.isAssignableFrom(handler.getClass())) {
throw ExceptionFactory.makeWebServiceException(Messages
.getMessage("handlerChainErr1", handler
.getClass().getName()));
} else {
throw ExceptionFactory.makeWebServiceException(Messages
.getMessage("handlerChainErr2", handler
.getClass().getName()));
}
}
}