javax.xml.ws.handler.PortInfo Java Examples

The following examples show how to use javax.xml.ws.handler.PortInfo. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ServiceImplTest.java    From cxf with Apache License 2.0 6 votes vote down vote up
@Test
public void testHandlerResolver() {
    URL wsdl1 = getClass().getResource("/wsdl/calculator.wsdl");
    assertNotNull(wsdl1);

    ServiceImpl service = new ServiceImpl(getBus(), wsdl1, SERVICE_1, ServiceImpl.class);

    TestHandlerResolver resolver = new TestHandlerResolver();
    assertNull(resolver.getPortInfo());

    service.setHandlerResolver(resolver);

    CalculatorPortType cal = service.getPort(PORT_1, CalculatorPortType.class);
    assertNotNull(cal);

    PortInfo info = resolver.getPortInfo();
    assertNotNull(info);
    assertEquals(SERVICE_1, info.getServiceName());
    assertEquals(PORT_1, info.getPortName());
    assertEquals(SOAPBinding.SOAP12HTTP_BINDING, info.getBindingID());
}
 
Example #2
Source File: PortInfoImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Object.equals is overridden here so that PortInfo objects
 * can be compared when using them as keys in the map in
 * HandlerResolverImpl. This method relies on the equals()
 * methods of java.lang.String and javax.xml.namespace.QName.
 *
 * @param obj The PortInfo object to test for equality.
 * @return True if they match, and false if they do not or
 * if the object passed in is not a PortInfo.
 */
public boolean equals(Object obj) {
    if (obj instanceof PortInfo) {
        PortInfo info = (PortInfo) obj;
        if (bindingId.toString().equals(info.getBindingID()) &&
            portName.equals(info.getPortName()) &&
            serviceName.equals(info.getServiceName())) {
            return true;
        }
    }
    return false;
}
 
Example #3
Source File: HandlerResolverImpl.java    From tomee with Apache License 2.0 5 votes vote down vote up
public List<Handler> getHandlerChain(final PortInfo portInfo) {
    List<Handler> chain = new ArrayList<>();
    for (final HandlerChainData handlerChain : handlerChains) {
        List<Handler> handlers = buildHandlers(portInfo, handlerChain);
        handlers = sortHandlers(handlers);
        chain.addAll(handlers);
    }
    chain = sortHandlers(chain);
    return chain;
}
 
Example #4
Source File: ClientHandlerResolverImpl.java    From tomee with Apache License 2.0 5 votes vote down vote up
@Override
public List<Handler> getHandlerChain(final javax.xml.ws.handler.PortInfo portInfo) {
    List<Handler> chain = new ArrayList<Handler>();
    for (final HandlerChainMetaData handlerChain : handlerChains) {
        List<Handler> handlers = buildHandlers(portInfo, handlerChain);
        handlers = sortHandlers(handlers);
        chain.addAll(handlers);
    }
    chain = sortHandlers(chain);
    return chain;
}
 
Example #5
Source File: HandlerResolverImpl.java    From cxf with Apache License 2.0 5 votes vote down vote up
/**
 * Obtain handler chain from annotations.
 */
private List<Handler> getHandlersFromAnnotation(Class<?> clazz, PortInfo portInfo) {
    AnnotationHandlerChainBuilder builder = new AnnotationHandlerChainBuilder();

    return builder.buildHandlerChainFromClass(clazz,
        portInfo != null ? portInfo.getPortName() : null,
        portInfo != null ? portInfo.getServiceName() : null,
        portInfo != null ? portInfo.getBindingID() : null);
}
 
Example #6
Source File: HandlerResolverImpl.java    From cxf with Apache License 2.0 5 votes vote down vote up
private List<Handler> createHandlerChain(PortInfo portInfo) {
    List<Handler> chain = new ArrayList<>();

    if (annotationClass != null) {
        chain.addAll(getHandlersFromAnnotation(annotationClass, portInfo));
    }

    for (Handler<?> h : chain) {
        configHandler(h);
    }

    return chain;
}
 
Example #7
Source File: HandlerResolverImpl.java    From cxf with Apache License 2.0 5 votes vote down vote up
public List<Handler> getHandlerChain(PortInfo portInfo) {

        List<Handler> handlerChain = handlerMap.get(portInfo);
        if (handlerChain == null) {
            handlerChain = createHandlerChain(portInfo);
            handlerMap.put(portInfo, handlerChain);
        }
        return handlerChain;
    }
 
Example #8
Source File: ClientVersionHandler.java    From development with Apache License 2.0 5 votes vote down vote up
/**
 * This method adds a version SOAP Handler into the handler chain of a web
 * service. The version SOAP Handler is responsible to add a version
 * information in the header of the outbound SOAP message.
 * 
 * @param service
 *            set HandlerResolver for service by invoking service
 *            <code>setHandlerResolver</code> method.
 * @return service with handler chain for handling version information.
 */
public Service addVersionInformationToClient(Service service) {
    service.setHandlerResolver(new HandlerResolver() {
        @SuppressWarnings("rawtypes")
        @Override
        public List<Handler> getHandlerChain(PortInfo portInfo) {
            List<Handler> handlerList = new ArrayList<Handler>();
            handlerList.add(new VersionHandler(version));
            return handlerList;
        }
    });
    return service;
}
 
Example #9
Source File: AuthHandlerResolver.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
@SuppressWarnings("rawtypes")
public List<Handler> getHandlerChain(PortInfo portInfo) {
	List<Handler> handlerChain = new ArrayList<Handler>();
	HeaderHandler hh = new HeaderHandler(username, password);
	handlerChain.add(hh);
	return handlerChain;
}
 
Example #10
Source File: HandlerConfigurator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
HandlerResolver getResolver() {
    return new HandlerResolver() {
        public List<Handler> getHandlerChain(PortInfo portInfo) {
            return new ArrayList<Handler>(
                handlerModel.getHandlersForPortInfo(portInfo).getHandlers());
        }
    };
}
 
Example #11
Source File: PortInfoImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Object.equals is overridden here so that PortInfo objects
 * can be compared when using them as keys in the map in
 * HandlerResolverImpl. This method relies on the equals()
 * methods of java.lang.String and javax.xml.namespace.QName.
 *
 * @param obj The PortInfo object to test for equality.
 * @return True if they match, and false if they do not or
 * if the object passed in is not a PortInfo.
 */
public boolean equals(Object obj) {
    if (obj instanceof PortInfo) {
        PortInfo info = (PortInfo) obj;
        if (bindingId.toString().equals(info.getBindingID()) &&
            portName.equals(info.getPortName()) &&
            serviceName.equals(info.getServiceName())) {
            return true;
        }
    }
    return false;
}
 
Example #12
Source File: HandlerChainsModel.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public HandlerAnnotationInfo getHandlersForPortInfo(PortInfo info){

        HandlerAnnotationInfo handlerInfo = new HandlerAnnotationInfo();
        List<Handler> handlerClassList = new ArrayList<Handler>();
        Set<String> roles = new HashSet<String>();

        for(HandlerChainType hchain : handlerChains) {
            boolean hchainMatched = false;
            if((!hchain.isConstraintSet()) ||
                    JAXWSUtils.matchQNames(info.getServiceName(), hchain.getServiceNamePattern()) ||
                    JAXWSUtils.matchQNames(info.getPortName(), hchain.getPortNamePattern()) ||
                    hchain.getProtocolBindings().contains(info.getBindingID()) ){
                hchainMatched = true;

            }
            if(hchainMatched) {
                for(HandlerType handler : hchain.getHandlers()) {
                    try {
                        Handler handlerClass = (Handler) loadClass(annotatedClass.getClassLoader(),
                                handler.getHandlerClass()).newInstance();
                        callHandlerPostConstruct(handlerClass);
                        handlerClassList.add(handlerClass);
                    } catch (InstantiationException ie){
                        throw new RuntimeException(ie);
                    } catch (IllegalAccessException e) {
                        throw new RuntimeException(e);
                    }

                    roles.addAll(handler.getSoapRoles());
                }

            }
        }

        handlerInfo.setHandlers(handlerClassList);
        handlerInfo.setRoles(roles);
        return handlerInfo;

    }
 
Example #13
Source File: HandlerConfigurator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
HandlerResolver getResolver() {
    return new HandlerResolver() {
        public List<Handler> getHandlerChain(PortInfo portInfo) {
            return new ArrayList<Handler>(
                handlerModel.getHandlersForPortInfo(portInfo).getHandlers());
        }
    };
}
 
Example #14
Source File: PortInfoImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Object.equals is overridden here so that PortInfo objects
 * can be compared when using them as keys in the map in
 * HandlerResolverImpl. This method relies on the equals()
 * methods of java.lang.String and javax.xml.namespace.QName.
 *
 * @param obj The PortInfo object to test for equality.
 * @return True if they match, and false if they do not or
 * if the object passed in is not a PortInfo.
 */
public boolean equals(Object obj) {
    if (obj instanceof PortInfo) {
        PortInfo info = (PortInfo) obj;
        if (bindingId.toString().equals(info.getBindingID()) &&
            portName.equals(info.getPortName()) &&
            serviceName.equals(info.getServiceName())) {
            return true;
        }
    }
    return false;
}
 
Example #15
Source File: HandlerChainsModel.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public HandlerAnnotationInfo getHandlersForPortInfo(PortInfo info){

        HandlerAnnotationInfo handlerInfo = new HandlerAnnotationInfo();
        List<Handler> handlerClassList = new ArrayList<Handler>();
        Set<String> roles = new HashSet<String>();

        for(HandlerChainType hchain : handlerChains) {
            boolean hchainMatched = false;
            if((!hchain.isConstraintSet()) ||
                    JAXWSUtils.matchQNames(info.getServiceName(), hchain.getServiceNamePattern()) ||
                    JAXWSUtils.matchQNames(info.getPortName(), hchain.getPortNamePattern()) ||
                    hchain.getProtocolBindings().contains(info.getBindingID()) ){
                hchainMatched = true;

            }
            if(hchainMatched) {
                for(HandlerType handler : hchain.getHandlers()) {
                    try {
                        Handler handlerClass = (Handler) loadClass(annotatedClass.getClassLoader(),
                                handler.getHandlerClass()).newInstance();
                        callHandlerPostConstruct(handlerClass);
                        handlerClassList.add(handlerClass);
                    } catch (InstantiationException ie){
                        throw new RuntimeException(ie);
                    } catch (IllegalAccessException e) {
                        throw new RuntimeException(e);
                    }

                    roles.addAll(handler.getSoapRoles());
                }

            }
        }

        handlerInfo.setHandlers(handlerClassList);
        handlerInfo.setRoles(roles);
        return handlerInfo;

    }
 
Example #16
Source File: HandlerConfigurator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
HandlerResolver getResolver() {
    return new HandlerResolver() {
        public List<Handler> getHandlerChain(PortInfo portInfo) {
            return new ArrayList<Handler>(
                handlerModel.getHandlersForPortInfo(portInfo).getHandlers());
        }
    };
}
 
Example #17
Source File: HandlerChainsModel.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public HandlerAnnotationInfo getHandlersForPortInfo(PortInfo info){

        HandlerAnnotationInfo handlerInfo = new HandlerAnnotationInfo();
        List<Handler> handlerClassList = new ArrayList<Handler>();
        Set<String> roles = new HashSet<String>();

        for(HandlerChainType hchain : handlerChains) {
            boolean hchainMatched = false;
            if((!hchain.isConstraintSet()) ||
                    JAXWSUtils.matchQNames(info.getServiceName(), hchain.getServiceNamePattern()) ||
                    JAXWSUtils.matchQNames(info.getPortName(), hchain.getPortNamePattern()) ||
                    hchain.getProtocolBindings().contains(info.getBindingID()) ){
                hchainMatched = true;

            }
            if(hchainMatched) {
                for(HandlerType handler : hchain.getHandlers()) {
                    try {
                        Handler handlerClass = (Handler) loadClass(annotatedClass.getClassLoader(),
                                handler.getHandlerClass()).newInstance();
                        callHandlerPostConstruct(handlerClass);
                        handlerClassList.add(handlerClass);
                    } catch (InstantiationException ie){
                        throw new RuntimeException(ie);
                    } catch (IllegalAccessException e) {
                        throw new RuntimeException(e);
                    }

                    roles.addAll(handler.getSoapRoles());
                }

            }
        }

        handlerInfo.setHandlers(handlerClassList);
        handlerInfo.setRoles(roles);
        return handlerInfo;

    }
 
Example #18
Source File: HandlerChainsModel.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public HandlerAnnotationInfo getHandlersForPortInfo(PortInfo info){

        HandlerAnnotationInfo handlerInfo = new HandlerAnnotationInfo();
        List<Handler> handlerClassList = new ArrayList<Handler>();
        Set<String> roles = new HashSet<String>();

        for(HandlerChainType hchain : handlerChains) {
            boolean hchainMatched = false;
            if((!hchain.isConstraintSet()) ||
                    JAXWSUtils.matchQNames(info.getServiceName(), hchain.getServiceNamePattern()) ||
                    JAXWSUtils.matchQNames(info.getPortName(), hchain.getPortNamePattern()) ||
                    hchain.getProtocolBindings().contains(info.getBindingID()) ){
                hchainMatched = true;

            }
            if(hchainMatched) {
                for(HandlerType handler : hchain.getHandlers()) {
                    try {
                        Handler handlerClass = (Handler) loadClass(annotatedClass.getClassLoader(),
                                handler.getHandlerClass()).newInstance();
                        callHandlerPostConstruct(handlerClass);
                        handlerClassList.add(handlerClass);
                    } catch (InstantiationException ie){
                        throw new RuntimeException(ie);
                    } catch (IllegalAccessException e) {
                        throw new RuntimeException(e);
                    }

                    roles.addAll(handler.getSoapRoles());
                }

            }
        }

        handlerInfo.setHandlers(handlerClassList);
        handlerInfo.setRoles(roles);
        return handlerInfo;

    }
 
Example #19
Source File: HandlerConfigurator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
HandlerResolver getResolver() {
    return new HandlerResolver() {
        public List<Handler> getHandlerChain(PortInfo portInfo) {
            return new ArrayList<Handler>(
                handlerModel.getHandlersForPortInfo(portInfo).getHandlers());
        }
    };
}
 
Example #20
Source File: HandlerChainsModel.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public HandlerAnnotationInfo getHandlersForPortInfo(PortInfo info){

        HandlerAnnotationInfo handlerInfo = new HandlerAnnotationInfo();
        List<Handler> handlerClassList = new ArrayList<Handler>();
        Set<String> roles = new HashSet<String>();

        for(HandlerChainType hchain : handlerChains) {
            boolean hchainMatched = false;
            if((!hchain.isConstraintSet()) ||
                    JAXWSUtils.matchQNames(info.getServiceName(), hchain.getServiceNamePattern()) ||
                    JAXWSUtils.matchQNames(info.getPortName(), hchain.getPortNamePattern()) ||
                    hchain.getProtocolBindings().contains(info.getBindingID()) ){
                hchainMatched = true;

            }
            if(hchainMatched) {
                for(HandlerType handler : hchain.getHandlers()) {
                    try {
                        Handler handlerClass = (Handler) loadClass(annotatedClass.getClassLoader(),
                                handler.getHandlerClass()).newInstance();
                        callHandlerPostConstruct(handlerClass);
                        handlerClassList.add(handlerClass);
                    } catch (InstantiationException ie){
                        throw new RuntimeException(ie);
                    } catch (IllegalAccessException e) {
                        throw new RuntimeException(e);
                    }

                    roles.addAll(handler.getSoapRoles());
                }

            }
        }

        handlerInfo.setHandlers(handlerClassList);
        handlerInfo.setRoles(roles);
        return handlerInfo;

    }
 
Example #21
Source File: PortInfoImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Object.equals is overridden here so that PortInfo objects
 * can be compared when using them as keys in the map in
 * HandlerResolverImpl. This method relies on the equals()
 * methods of java.lang.String and javax.xml.namespace.QName.
 *
 * @param obj The PortInfo object to test for equality.
 * @return True if they match, and false if they do not or
 * if the object passed in is not a PortInfo.
 */
public boolean equals(Object obj) {
    if (obj instanceof PortInfo) {
        PortInfo info = (PortInfo) obj;
        if (bindingId.toString().equals(info.getBindingID()) &&
            portName.equals(info.getPortName()) &&
            serviceName.equals(info.getServiceName())) {
            return true;
        }
    }
    return false;
}
 
Example #22
Source File: HandlerConfigurator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
HandlerResolver getResolver() {
    return new HandlerResolver() {
        public List<Handler> getHandlerChain(PortInfo portInfo) {
            return new ArrayList<Handler>(
                handlerModel.getHandlersForPortInfo(portInfo).getHandlers());
        }
    };
}
 
Example #23
Source File: HandlerChainsModel.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public HandlerAnnotationInfo getHandlersForPortInfo(PortInfo info){

        HandlerAnnotationInfo handlerInfo = new HandlerAnnotationInfo();
        List<Handler> handlerClassList = new ArrayList<Handler>();
        Set<String> roles = new HashSet<String>();

        for(HandlerChainType hchain : handlerChains) {
            boolean hchainMatched = false;
            if((!hchain.isConstraintSet()) ||
                    JAXWSUtils.matchQNames(info.getServiceName(), hchain.getServiceNamePattern()) ||
                    JAXWSUtils.matchQNames(info.getPortName(), hchain.getPortNamePattern()) ||
                    hchain.getProtocolBindings().contains(info.getBindingID()) ){
                hchainMatched = true;

            }
            if(hchainMatched) {
                for(HandlerType handler : hchain.getHandlers()) {
                    try {
                        Handler handlerClass = (Handler) loadClass(annotatedClass.getClassLoader(),
                                handler.getHandlerClass()).newInstance();
                        callHandlerPostConstruct(handlerClass);
                        handlerClassList.add(handlerClass);
                    } catch (InstantiationException ie){
                        throw new RuntimeException(ie);
                    } catch (IllegalAccessException e) {
                        throw new RuntimeException(e);
                    }

                    roles.addAll(handler.getSoapRoles());
                }

            }
        }

        handlerInfo.setHandlers(handlerClassList);
        handlerInfo.setRoles(roles);
        return handlerInfo;

    }
 
Example #24
Source File: PortInfoImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Object.equals is overridden here so that PortInfo objects
 * can be compared when using them as keys in the map in
 * HandlerResolverImpl. This method relies on the equals()
 * methods of java.lang.String and javax.xml.namespace.QName.
 *
 * @param obj The PortInfo object to test for equality.
 * @return True if they match, and false if they do not or
 * if the object passed in is not a PortInfo.
 */
public boolean equals(Object obj) {
    if (obj instanceof PortInfo) {
        PortInfo info = (PortInfo) obj;
        if (bindingId.toString().equals(info.getBindingID()) &&
            portName.equals(info.getPortName()) &&
            serviceName.equals(info.getServiceName())) {
            return true;
        }
    }
    return false;
}
 
Example #25
Source File: HandlerChainsModel.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public HandlerAnnotationInfo getHandlersForPortInfo(PortInfo info){

        HandlerAnnotationInfo handlerInfo = new HandlerAnnotationInfo();
        List<Handler> handlerClassList = new ArrayList<Handler>();
        Set<String> roles = new HashSet<String>();

        for(HandlerChainType hchain : handlerChains) {
            boolean hchainMatched = false;
            if((!hchain.isConstraintSet()) ||
                    JAXWSUtils.matchQNames(info.getServiceName(), hchain.getServiceNamePattern()) ||
                    JAXWSUtils.matchQNames(info.getPortName(), hchain.getPortNamePattern()) ||
                    hchain.getProtocolBindings().contains(info.getBindingID()) ){
                hchainMatched = true;

            }
            if(hchainMatched) {
                for(HandlerType handler : hchain.getHandlers()) {
                    try {
                        Handler handlerClass = (Handler) loadClass(annotatedClass.getClassLoader(),
                                handler.getHandlerClass()).newInstance();
                        callHandlerPostConstruct(handlerClass);
                        handlerClassList.add(handlerClass);
                    } catch (InstantiationException ie){
                        throw new RuntimeException(ie);
                    } catch (IllegalAccessException e) {
                        throw new RuntimeException(e);
                    }

                    roles.addAll(handler.getSoapRoles());
                }

            }
        }

        handlerInfo.setHandlers(handlerClassList);
        handlerInfo.setRoles(roles);
        return handlerInfo;

    }
 
Example #26
Source File: PortInfoImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Object.equals is overridden here so that PortInfo objects
 * can be compared when using them as keys in the map in
 * HandlerResolverImpl. This method relies on the equals()
 * methods of java.lang.String and javax.xml.namespace.QName.
 *
 * @param obj The PortInfo object to test for equality.
 * @return True if they match, and false if they do not or
 * if the object passed in is not a PortInfo.
 */
public boolean equals(Object obj) {
    if (obj instanceof PortInfo) {
        PortInfo info = (PortInfo) obj;
        if (bindingId.toString().equals(info.getBindingID()) &&
            portName.equals(info.getPortName()) &&
            serviceName.equals(info.getServiceName())) {
            return true;
        }
    }
    return false;
}
 
Example #27
Source File: HandlerConfigurator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
HandlerResolver getResolver() {
    return new HandlerResolver() {
        public List<Handler> getHandlerChain(PortInfo portInfo) {
            return new ArrayList<Handler>(
                handlerModel.getHandlersForPortInfo(portInfo).getHandlers());
        }
    };
}
 
Example #28
Source File: HandlerChainsModel.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public HandlerAnnotationInfo getHandlersForPortInfo(PortInfo info){

        HandlerAnnotationInfo handlerInfo = new HandlerAnnotationInfo();
        List<Handler> handlerClassList = new ArrayList<Handler>();
        Set<String> roles = new HashSet<String>();

        for(HandlerChainType hchain : handlerChains) {
            boolean hchainMatched = false;
            if((!hchain.isConstraintSet()) ||
                    JAXWSUtils.matchQNames(info.getServiceName(), hchain.getServiceNamePattern()) ||
                    JAXWSUtils.matchQNames(info.getPortName(), hchain.getPortNamePattern()) ||
                    hchain.getProtocolBindings().contains(info.getBindingID()) ){
                hchainMatched = true;

            }
            if(hchainMatched) {
                for(HandlerType handler : hchain.getHandlers()) {
                    try {
                        Handler handlerClass = (Handler) loadClass(annotatedClass.getClassLoader(),
                                handler.getHandlerClass()).newInstance();
                        callHandlerPostConstruct(handlerClass);
                        handlerClassList.add(handlerClass);
                    } catch (InstantiationException ie){
                        throw new RuntimeException(ie);
                    } catch (IllegalAccessException e) {
                        throw new RuntimeException(e);
                    }

                    roles.addAll(handler.getSoapRoles());
                }

            }
        }

        handlerInfo.setHandlers(handlerClassList);
        handlerInfo.setRoles(roles);
        return handlerInfo;

    }
 
Example #29
Source File: PortInfoImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Object.equals is overridden here so that PortInfo objects
 * can be compared when using them as keys in the map in
 * HandlerResolverImpl. This method relies on the equals()
 * methods of java.lang.String and javax.xml.namespace.QName.
 *
 * @param obj The PortInfo object to test for equality.
 * @return True if they match, and false if they do not or
 * if the object passed in is not a PortInfo.
 */
public boolean equals(Object obj) {
    if (obj instanceof PortInfo) {
        PortInfo info = (PortInfo) obj;
        if (bindingId.toString().equals(info.getBindingID()) &&
            portName.equals(info.getPortName()) &&
            serviceName.equals(info.getServiceName())) {
            return true;
        }
    }
    return false;
}
 
Example #30
Source File: HandlerConfigurator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
HandlerResolver getResolver() {
    return new HandlerResolver() {
        public List<Handler> getHandlerChain(PortInfo portInfo) {
            return new ArrayList<Handler>(
                handlerModel.getHandlersForPortInfo(portInfo).getHandlers());
        }
    };
}