Search in sources :

Example 1 with LogicalHandler

use of jakarta.xml.ws.handler.LogicalHandler in project metro-jax-ws by eclipse-ee4j.

the class ClientLogicalHandlerTube method setUpProcessor.

void setUpProcessor() {
    if (handlers == null) {
        // Take a snapshot, User may change chain after invocation, Same chain
        // should be used for the entire MEP
        handlers = new ArrayList<>();
        WSBinding binding = getBinding();
        List<LogicalHandler> logicalSnapShot = ((BindingImpl) binding).getHandlerConfig().getLogicalHandlers();
        if (!logicalSnapShot.isEmpty()) {
            handlers.addAll(logicalSnapShot);
            if (binding.getSOAPVersion() == null) {
                processor = new XMLHandlerProcessor(this, binding, handlers);
            } else {
                processor = new SOAPHandlerProcessor(true, this, binding, handlers);
            }
        }
    }
}
Also used : WSBinding(com.sun.xml.ws.api.WSBinding) LogicalHandler(jakarta.xml.ws.handler.LogicalHandler)

Example 2 with LogicalHandler

use of jakarta.xml.ws.handler.LogicalHandler in project tomee by apache.

the class HandlerResolverImpl method sortHandlers.

/**
 * sorts the handlers into correct order. All of the logical handlers first
 * followed by the protocol handlers
 *
 * @param handlers
 * @return sorted list of handlers
 */
private List<Handler> sortHandlers(final List<Handler> handlers) {
    final List<LogicalHandler> logicalHandlers = new ArrayList<>();
    final List<Handler> protocolHandlers = new ArrayList<>();
    for (final Handler handler : handlers) {
        if (handler instanceof LogicalHandler) {
            logicalHandlers.add((LogicalHandler) handler);
        } else {
            protocolHandlers.add(handler);
        }
    }
    final List<Handler> sortedHandlers = new ArrayList<>();
    sortedHandlers.addAll(logicalHandlers);
    sortedHandlers.addAll(protocolHandlers);
    return sortedHandlers;
}
Also used : LogicalHandler(jakarta.xml.ws.handler.LogicalHandler) ArrayList(java.util.ArrayList) Handler(jakarta.xml.ws.handler.Handler) LogicalHandler(jakarta.xml.ws.handler.LogicalHandler)

Example 3 with LogicalHandler

use of jakarta.xml.ws.handler.LogicalHandler in project tomee by apache.

the class ClientHandlerResolverImpl method sortHandlers.

/**
 * sorts the handlers into correct order. All of the logical handlers first
 * followed by the protocol handlers
 *
 * @param handlers List
 * @return sorted list of handlers
 */
private List<Handler> sortHandlers(final List<Handler> handlers) {
    final List<LogicalHandler> logicalHandlers = new ArrayList<LogicalHandler>();
    final List<Handler> protocolHandlers = new ArrayList<Handler>();
    for (final Handler handler : handlers) {
        if (handler instanceof LogicalHandler) {
            logicalHandlers.add((LogicalHandler) handler);
        } else {
            protocolHandlers.add(handler);
        }
    }
    final List<Handler> sortedHandlers = new ArrayList<Handler>();
    sortedHandlers.addAll(logicalHandlers);
    sortedHandlers.addAll(protocolHandlers);
    return sortedHandlers;
}
Also used : LogicalHandler(jakarta.xml.ws.handler.LogicalHandler) ArrayList(java.util.ArrayList) Handler(jakarta.xml.ws.handler.Handler) LogicalHandler(jakarta.xml.ws.handler.LogicalHandler)

Aggregations

LogicalHandler (jakarta.xml.ws.handler.LogicalHandler)3 Handler (jakarta.xml.ws.handler.Handler)2 ArrayList (java.util.ArrayList)2 WSBinding (com.sun.xml.ws.api.WSBinding)1