Package org.apache.geronimo.xbeans.javaee

Examples of org.apache.geronimo.xbeans.javaee.HandlerChainsType


   
    public static void insertHandlers(ServiceRefType serviceRef, URL url) throws Exception {
        // Bind the XML handler chain file to an XMLBeans document
        XmlObject xml = XmlBeansUtil.parse(url, null);
        HandlerChainsDocument hcd = (HandlerChainsDocument) XmlBeansUtil.typedCopy(xml, HandlerChainsDocument.type);
        HandlerChainsType handlerChains = hcd.getHandlerChains();
       
        ServiceRefHandlerChainsType serviceRefHandlerChains = serviceRef.addNewHandlerChains();
        for (HandlerChainType handlerChain : handlerChains.getHandlerChainArray()) {
            ServiceRefHandlerChainType serviceRefHandlerChain = serviceRefHandlerChains.addNewHandlerChain();
            if (handlerChain.getPortNamePattern() != null) {
                serviceRefHandlerChain.setPortNamePattern(handlerChain.getPortNamePattern());
            }
            if (handlerChain.getServiceNamePattern() != null) {
View Full Code Here


public class GeronimoHandlerResolverTest extends TestSupport {

    public void testBasic() throws Exception {
        InputStream in = getClass().getResourceAsStream("/handlers.xml");
        assertTrue(in != null);
        HandlerChainsType handlerChains = toHandlerChains(in);
        assertEquals(3, handlerChains.getHandlerChainArray().length);
       
        GeronimoHandlerResolver resolver =
            new GeronimoHandlerResolver(getClass().getClassLoader(), getClass(), handlerChains, null);
       
        List<Handler> handlers = null;
View Full Code Here

    }

    public void testServiceMatching() throws Exception {
        InputStream in = getClass().getResourceAsStream("/handlers_service.xml");
        assertTrue(in != null);
        HandlerChainsType handlerChains = toHandlerChains(in);
        assertEquals(4, handlerChains.getHandlerChainArray().length);
       
        GeronimoHandlerResolver resolver =
            new GeronimoHandlerResolver(getClass().getClassLoader(), getClass(), handlerChains, null);
       
        List<Handler> handlers = null;
View Full Code Here

    }
   
    public void testBindingMatching() throws Exception {
        InputStream in = getClass().getResourceAsStream("/handlers_bindings.xml");
        assertTrue(in != null);
        HandlerChainsType handlerChains = toHandlerChains(in);
        assertEquals(4, handlerChains.getHandlerChainArray().length);
       
        GeronimoHandlerResolver resolver =
            new GeronimoHandlerResolver(getClass().getClassLoader(), getClass(), handlerChains, null);
       
        List<Handler> handlers = null;
View Full Code Here

    }
   
    public void testPortMatching() throws Exception {
        InputStream in = getClass().getResourceAsStream("/handlers_port.xml");
        assertTrue(in != null);
        HandlerChainsType handlerChains = toHandlerChains(in);
        assertEquals(4, handlerChains.getHandlerChainArray().length);
       
        GeronimoHandlerResolver resolver =
            new GeronimoHandlerResolver(getClass().getClassLoader(), getClass(), handlerChains, null);
       
        List<Handler> handlers = null;
View Full Code Here

    }
   
    public void testMixedMatching() throws Exception {
        InputStream in = getClass().getResourceAsStream("/handlers_mixed.xml");
        assertTrue(in != null);
        HandlerChainsType handlerChains = toHandlerChains(in);
        assertEquals(3, handlerChains.getHandlerChainArray().length);
       
        GeronimoHandlerResolver resolver =
            new GeronimoHandlerResolver(getClass().getClassLoader(), getClass(), handlerChains, null);
       
        List<Handler> handlers = null;
View Full Code Here

        }
        return handlerChains;
    }
   
    public static HandlerChainsType getHandlerChains(String xml) throws XmlException {       
        HandlerChainsType types = null;
        if (xml != null) {
            try {
                types = HandlerChainsDocument.Factory.parse(xml).getHandlerChains();
            } catch (XmlException e){
                types = HandlerChainsType.Factory.parse(xml);
View Full Code Here

        } else {
            hcAnn.validate();

            try {
                URL handlerFileURL = clz.getResource(hcAnn.getFileName());
                HandlerChainsType handlerChainsType = HandlerChainsDocument.Factory.parse(handlerFileURL).getHandlerChains();

                if (null == handlerChainsType || handlerChainsType.getHandlerChainArray() == null) {
                    throw new WebServiceException("Chain not specified");
                }
               
                chain = new ArrayList<Handler>();
                for (HandlerChainType hc : handlerChainsType.getHandlerChainArray()) {
                    chain.addAll(buildHandlerChain(hc, clz.getClassLoader()));
                }

            } catch (Exception e) {
                throw new WebServiceException("Chain not specified", e);
View Full Code Here

            ServiceDelegate.setServiceMetadata(null);
        }
    }

    protected HandlerChainsType getHandlerChains() {
        HandlerChainsType types = null;
        try {
            types = HandlerChainsUtils.getHandlerChains(this.handlerChainsXML);
        } catch (Exception e) {
            LOG.warn("Failed to deserialize handler chains", e);
        }
View Full Code Here

       
    /*
     * Set appropriate handlers for the port/service/bindings.
     */
    protected void initHandlers() throws Exception {       
        HandlerChainsType handlerChains =
            HandlerChainsUtils.getHandlerChains(this.portInfo.getHandlersAsXML());
        GeronimoHandlerResolver handlerResolver =
            new GeronimoHandlerResolver(getImplementorClass().getClassLoader(),
                                        getImplementorClass(),
                                        handlerChains,
View Full Code Here

TOP

Related Classes of org.apache.geronimo.xbeans.javaee.HandlerChainsType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.