Iterator handlerIterator = handlers.iterator();
while (handlerIterator.hasNext()) {
// this is a safe cast since the handlerResolver and binding.setHandlerChain
// and InvocationContext.setHandlerChain verifies it before we get here
Handler handler = (Handler)handlerIterator.next();
// JAXWS 9.2.1.2 sort them by Logical, then SOAP
if (LogicalHandler.class.isAssignableFrom(handler.getClass()))
logicalHandlers.add((LogicalHandler) handler);
else if (SOAPHandler.class.isAssignableFrom(handler.getClass()))
// instanceof ProtocolHandler
protocolHandlers.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()));
}
}
logicalLength = logicalHandlers.size();