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


            hcAnn.validate();

            HandlerChainType hc = null;
            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");
                }
                //We expect only one HandlerChainType here
                hc = handlerChainsType.getHandlerChainArray()[0];
            } catch (Exception e) {
                log.debug(e.getMessage(), e);
                throw new WebServiceException("Chain not specified", e);
            }
View Full Code Here

                                 Map<Object, EndpointInfo> seiInfoMap) {
        super(handlerChainsXML, seiInfoMap, name, serviceQName, wsdlURI, referenceClassName, serviceClassName);
    }

    protected HandlerResolver getHandlerResolver(Class serviceClass) {
        HandlerChainsType types = null;
        try {
            if (this.handlerChainsXML != null){
                try {
                    types = HandlerChainsDocument.Factory.parse(this.handlerChainsXML).getHandlerChains();
                } catch (XmlException e){
View Full Code Here

     * Gets the right handlers for the port/service/bindings and
     * performs injection.
     */
    protected void configureHandlers() throws Exception {
        String xml = this.portInfo.getHandlersAsXML();
        HandlerChainsType handlerChains = xml == null ? null : HandlerChainsDocument.Factory.parse(xml).getHandlerChains();
        Axis2HandlerResolver handlerResolver =
            new Axis2HandlerResolver(endpointInstance.getClass().getClassLoader(),
                                   endpointInstance.getClass(),
                                   handlerChains,
                                   this.annotationProcessor);
View Full Code Here

public class Axis2HandlerResolverTest 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);
       
        Axis2HandlerResolver resolver =
            new Axis2HandlerResolver(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(3, handlerChains.getHandlerChainArray().length);
       
        Axis2HandlerResolver resolver =
            new Axis2HandlerResolver(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(3, handlerChains.getHandlerChainArray().length);
       
        Axis2HandlerResolver resolver =
            new Axis2HandlerResolver(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(3, handlerChains.getHandlerChainArray().length);
       
        Axis2HandlerResolver resolver =
            new Axis2HandlerResolver(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);
       
        Axis2HandlerResolver resolver =
            new Axis2HandlerResolver(getClass().getClassLoader(), getClass(), handlerChains, null);
       
        List<Handler> handlers = null;
View Full Code Here

                if (url != null) {
                    // 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();

                    // Find the <service-ref> entry this handler chain belongs to and insert it
                    ServiceRefType[] serviceRefs = annotatedApp.getServiceRefArray();
                    boolean exists = false;
                    for ( ServiceRefType serviceRef : serviceRefs ) {
                        if ( serviceRef.getServiceRefName().getStringValue().trim().equals(serviceRefName) ) {
                            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

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.