Package org.apache.geronimo.xbeans.javaee6

Examples of org.apache.geronimo.xbeans.javaee6.DataSourceType


        return null;
    }

    private SecurityConstraintType addNewHTTPSecurityConstraint(WebAppType webApp, String[] rolesAllowed, TransportGuarantee transportGuarantee, ServletSecurity.EmptyRoleSemantic emptyRoleSemantic,
            String[] omissionMethods, Collection<String> urlPatterns) {
        SecurityConstraintType securityConstraint = addNewSecurityConstraint(webApp, rolesAllowed, transportGuarantee, emptyRoleSemantic);
        if (omissionMethods.length > 0 || securityConstraint != null) {
            if (securityConstraint == null) {
                securityConstraint = webApp.addNewSecurityConstraint();
            }
            WebResourceCollectionType webResourceCollection = securityConstraint.getWebResourceCollectionArray().length == 0 ? securityConstraint.addNewWebResourceCollection() : securityConstraint
                    .getWebResourceCollectionArray(0);
            for (String omissionMethod : omissionMethods) {
                webResourceCollection.addNewHttpMethodOmission().setStringValue(omissionMethod);
            }
            for (String urlPattern : urlPatterns) {
View Full Code Here


        return securityConstraint;
    }

    private SecurityConstraintType addNewHTTPMethodSecurityConstraint(WebAppType webApp, String[] rolesAllowed, TransportGuarantee transportGuarantee,
            ServletSecurity.EmptyRoleSemantic emptyRoleSemantic, String httpMethod, Collection<String> urlPatterns) {
        SecurityConstraintType securityConstraint = addNewSecurityConstraint(webApp, rolesAllowed, transportGuarantee, emptyRoleSemantic);
        if (securityConstraint == null) {
            securityConstraint = webApp.addNewSecurityConstraint();
        }
        WebResourceCollectionType webResourceCollection = securityConstraint.getWebResourceCollectionArray().length == 0 ? securityConstraint.addNewWebResourceCollection() : securityConstraint
                .getWebResourceCollectionArray(0);
        for (String urlPattern : urlPatterns) {
            webResourceCollection.addNewUrlPattern().setStringValue(urlPattern);
        }
        webResourceCollection.addNewHttpMethod().setStringValue(httpMethod);
View Full Code Here

            if (mergeItem != null) {
                if (mergeItem.isFromWebFragment()) {
                    throw new DeploymentException(WebDeploymentMessageUtils.createDuplicateJNDIRefMessage("service-ref", serviceRefName, mergeItem.getBelongedURL(), mergeContext.getCurrentJarUrl()));
                } else if (mergeItem.isFromWebXml() && !isServiceRefInjectTargetsConfiguredInInitialWebXML(serviceRefName, mergeContext)) {
                    //Merge InjectTarget
                    ServiceRefType serviceRef = (ServiceRefType) mergeItem.getValue();
                    for (InjectionTargetType injectTarget : srcServiceRef.getInjectionTargetArray()) {
                        String serviceRefInjectTargetKey = createServiceRefInjectTargetKey(serviceRefName, injectTarget.getInjectionTargetClass().getStringValue(), injectTarget
                                .getInjectionTargetName().getStringValue());
                        if (!mergeContext.containsAttribute(serviceRefInjectTargetKey)) {
                            serviceRef.addNewInjectionTarget().set(injectTarget);
                            mergeContext.setAttribute(serviceRefInjectTargetKey, Boolean.TRUE);
                        }
                    }
                }
            } else {
                ServiceRefType targetServiceRef = (ServiceRefType) webApp.addNewServiceRef().set(srcServiceRef);
                mergeContext.setAttribute(serviceRefKey, new MergeItem(targetServiceRef, mergeContext.getCurrentJarUrl(), ElementSource.WEB_FRAGMENT));
                for (InjectionTargetType injectionTarget : targetServiceRef.getInjectionTargetArray()) {
                    mergeContext.setAttribute(createServiceRefInjectTargetKey(serviceRefName, injectionTarget.getInjectionTargetClass().getStringValue(), injectionTarget.getInjectionTargetName()
                            .getStringValue()), Boolean.TRUE);
                }
            }
        }
View Full Code Here

                servlet.addNewServletName().setStringValue(service.getName());
                servlet.addNewServletClass().setStringValue(service.getName());

                // add new <servlet-mapping/> element
                String location = "/" + JAXWSUtils.getServiceName(service);
                ServletMappingType servletMapping = webApp.addNewServletMapping();
                servletMapping.addNewServletName().setStringValue(service.getName());
                servletMapping.addNewUrlPattern().setStringValue(location);

                // map service
                PortInfo portInfo = new PortInfo();
                portInfo.setLocation(contextRoot + location);
                map.put(service.getName(), portInfo);
View Full Code Here

                    String location = (String)portLocations.get(service.getName());
                    if (location == null) {
                        // add new <servlet-mapping/> element
                        location = "/" + JAXWSUtils.getServiceName(service);
                        ServletMappingType servletMapping = webApp.addNewServletMapping();
                        servletMapping.addNewServletName().setStringValue(service.getName());
                        servletMapping.addNewUrlPattern().setStringValue(location);
                    } else {
                        // weird, there was no servlet entry for this class but
                        // servlet-mapping exists
                        LOG.warn("Found <servlet-mapping> but corresponding <servlet> was not defined");
                    }
View Full Code Here

                }

                LOG.debug("Discovered POJO Web Service: " + service.getName());

                // add new <servlet/> element
                ServletType servlet = webApp.addNewServlet();
                servlet.addNewServletName().setStringValue(service.getName());
                servlet.addNewServletClass().setStringValue(service.getName());

                // add new <servlet-mapping/> element
                String location = "/" + JAXWSUtils.getServiceName(service);
                ServletMappingType servletMapping = webApp.addNewServletMapping();
                servletMapping.addNewServletName().setStringValue(service.getName());
View Full Code Here

        // o.a.g.jetty8.JettyFilterMapping which provided the example
        // of how to do this.
        // http://issues.apache.org/jira/browse/GERONIMO-645
        AbstractName previousServlet = null;
        for (Object aLoadOrder : loadOrder) {
            ServletType servletType = (ServletType) aLoadOrder;
            previousServlet = addServlet(webModuleName, module, previousServlet, servletType, servletMappings, moduleContext);
        }
    }
View Full Code Here

                if (mappedServlets == null) {
                    // no <servlet/> entry, add one

                    LOG.debug("POJO Web Service class {} is not mapped to any servlet", service.getName());

                    ServletType servlet = webApp.addNewServlet();
                    servlet.addNewServletName().setStringValue(service.getName());
                    servlet.addNewServletClass().setStringValue(service.getName());

                    String location = (String)portLocations.get(service.getName());
                    if (location == null) {
                        // add new <servlet-mapping/> element
                        location = "/" + JAXWSUtils.getServiceName(service);
View Full Code Here

        //-------------------------------------------------
        // Ensure annotations are processed correctly
        //-------------------------------------------------
        URL srcXML = classLoader.getResource("annotation/empty-web-src.xml");
        XmlObject xmlObject = XmlObject.Factory.parse(srcXML, options);
        WebAppDocument webAppDoc = (WebAppDocument) xmlObject.changeType(WebAppDocument.type);
        WebAppType webApp = webAppDoc.getWebApp();
        AnnotatedWebApp annotatedWebApp = new AnnotatedWebApp(webApp);
        EJBAnnotationHelper.processAnnotations(annotatedWebApp, classFinder);
        URL expectedXML = classLoader.getResource("annotation/ejb-expected.xml");
        XmlObject expected = XmlObject.Factory.parse(expectedXML);
        log.debug("[@EJB Source XML] " + '\n' + webApp.toString() + '\n');
View Full Code Here

        //-------------------------------------------------
        // Ensure annotations are processed correctly
        //-------------------------------------------------
        URL srcXML = classLoader.getResource("annotation/handler-chain-src.xml");
        XmlObject xmlObject = XmlObject.Factory.parse(srcXML, options);
        WebAppDocument webAppDoc = (WebAppDocument) xmlObject.changeType(WebAppDocument.type);
        WebAppType webApp = webAppDoc.getWebApp();
        AnnotatedWebApp annotatedWebApp = new AnnotatedWebApp(webApp);
        HandlerChainAnnotationHelper.processAnnotations(annotatedWebApp, classFinder);
        URL expectedXML = classLoader.getResource("annotation/handler-chain-expected.xml");
        XmlObject expected = XmlObject.Factory.parse(expectedXML);
        log.debug("[@HandlerChain Source XML] " + '\n' + webApp.toString() + '\n');
View Full Code Here

TOP

Related Classes of org.apache.geronimo.xbeans.javaee6.DataSourceType

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.