use of javax.xml.rpc.handler.Handler in project tomee by apache.
the class HandlerChainImpl method handleRequest.
public boolean handleRequest(MessageContext context) {
MessageSnapshot snapshot = new MessageSnapshot(context);
try {
for (int i = 0; i < size(); i++) {
Handler currentHandler = (Handler) get(i);
invokedHandlers.addFirst(currentHandler);
try {
if (!currentHandler.handleRequest(context)) {
return false;
}
} catch (SOAPFaultException e) {
throw e;
}
}
} finally {
saveChanges(context);
}
if (!snapshot.equals(context)) {
throw new IllegalStateException("The soap message operation or arguments were illegally modified by the HandlerChain");
}
return true;
}
use of javax.xml.rpc.handler.Handler in project tomee by apache.
the class HandlerChainImpl method destroy.
public void destroy() {
for (Iterator iterator = invokedHandlers.iterator(); iterator.hasNext(); ) {
Handler handler = (Handler) iterator.next();
handler.destroy();
}
invokedHandlers.clear();
clear();
}
use of javax.xml.rpc.handler.Handler in project tomcat by apache.
the class ServiceRefFactory method initHandlerChain.
private void initHandlerChain(QName portName, HandlerRegistry handlerRegistry, HandlerInfo handlerInfo, ArrayList<String> soaprolesToAdd) {
HandlerChain handlerChain = (HandlerChain) handlerRegistry.getHandlerChain(portName);
@SuppressWarnings("unchecked") Iterator<Handler> iter = handlerChain.iterator();
while (iter.hasNext()) {
Handler handler = iter.next();
handler.init(handlerInfo);
}
String[] soaprolesRegistered = handlerChain.getRoles();
String[] soaproles = new String[soaprolesRegistered.length + soaprolesToAdd.size()];
int i;
for (i = 0; i < soaprolesRegistered.length; i++) soaproles[i] = soaprolesRegistered[i];
for (int j = 0; j < soaprolesToAdd.size(); j++) soaproles[i + j] = soaprolesToAdd.get(j);
handlerChain.setRoles(soaproles);
handlerRegistry.setHandlerChain(portName, handlerChain);
}
Aggregations