Package org.apache.geronimo.web25.deployment

Examples of org.apache.geronimo.web25.deployment.DefaultWebAppInfoFactory


            }

            webAppData.setReferencePattern("ContextCustomizer", jspLifecycleName);
        }

        WebAppInfoBuilder webAppInfoBuilder = (WebAppInfoBuilder)sharedContext.get(WebModule.WEB_APP_INFO);
        if (webAppInfoBuilder != null) {
            WebAppInfo webAppInfo = webAppInfoBuilder.getWebAppInfo();
            webAppInfo.listeners.addAll(listenerNames);
            //install default jsp servlet....
            ServletInfo jspServlet = webAppInfoBuilder.copy(defaultJspServletInfo);
            List<JspConfig> jspConfigs = webApp.getJspConfig();
            List<String> jspMappings = new ArrayList<String>();
            for (JspConfig jspConfig : jspConfigs) {
                for (JspPropertyGroup propertyGroup : jspConfig.getJspPropertyGroup()) {
                    WebAppInfoBuilder.normalizeUrlPatterns(propertyGroup.getUrlPattern(), jspMappings);
View Full Code Here


                if (null == webModuleData.getReferencePatterns(TomcatWebAppContext.GBEAN_REF_CLUSTERED_VALVE_RETRIEVER)) {
                    log.warn("No clustering builders configured: app will not be clustered");
                }
            }

            WebAppInfoBuilder webAppInfoBuilder = new WebAppInfoBuilder(webApp, webAppInfoFactory);
            WebAppInfo webAppInfo = webAppInfoBuilder.build();

            webModuleData.setAttribute("webAppInfo", webAppInfo);

            webModule.getSharedContext().put(WebModule.WEB_APP_INFO, webAppInfoBuilder);
View Full Code Here

    public static String createFilterMappingSourceKey(String filterName) {
        return "filter-mapping.filter-name." + filterName + ".sources";
    }

    public static boolean isFilterMappingFromAnnotation(String filterName, MergeContext mergeContext) {
        ElementSource elementSource = (ElementSource) mergeContext.getAttribute(createFilterMappingSourceKey(filterName));
        return elementSource != null && elementSource.equals(ElementSource.ANNOTATION);
    }
View Full Code Here

        ElementSource elementSource = (ElementSource) mergeContext.getAttribute(createFilterMappingSourceKey(filterName));
        return elementSource != null && elementSource.equals(ElementSource.ANNOTATION);
    }

    public static boolean isFilterMappingFromWebXml(String filterName, MergeContext mergeContext) {
        ElementSource elementSource = (ElementSource) mergeContext.getAttribute(createFilterMappingSourceKey(filterName));
        return elementSource != null && elementSource.equals(ElementSource.WEB_XML);
    }
View Full Code Here

    public static boolean isServletMappingConfigured(String servletName, MergeContext mergeContext) {
        return mergeContext.containsAttribute(createServletMappingKey(servletName));
    }

    public static boolean isServletMappingFromAnnotation(String servletName, MergeContext mergeContext) {
        ElementSource elementSource = (ElementSource) mergeContext.getAttribute(createServletMappingSourceKey(servletName));
        return elementSource != null && elementSource.equals(ElementSource.ANNOTATION);
    }
View Full Code Here

        ElementSource elementSource = (ElementSource) mergeContext.getAttribute(createServletMappingSourceKey(servletName));
        return elementSource != null && elementSource.equals(ElementSource.ANNOTATION);
    }

    public static boolean isServletMappingFromWebXml(String servletName, MergeContext mergeContext) {
        ElementSource elementSource = (ElementSource) mergeContext.getAttribute(createServletMappingSourceKey(servletName));
        return elementSource != null && elementSource.equals(ElementSource.WEB_XML);
    }
View Full Code Here

    public static String createFilterMappingSourceKey(String filterName) {
        return "filter-mapping.filter-name." + filterName + ".sources";
    }

    public static boolean isFilterMappingFromAnnotation(String filterName, MergeContext mergeContext) {
        ElementSource elementSource = (ElementSource) mergeContext.getAttribute(createFilterMappingSourceKey(filterName));
        return elementSource != null && elementSource.equals(ElementSource.ANNOTATION);
    }
View Full Code Here

    @Override
    public void merge(WebFragment webFragment, WebApp webApp, MergeContext mergeContext) throws DeploymentException {
        for (MessageDestinationRef srcMessageDestinationRef : webFragment.getMessageDestinationRef()) {
            String messageDestinationRefName = srcMessageDestinationRef.getMessageDestinationRefName();
            String messageDestinationRefKey = createMessageDestinationRefKey(messageDestinationRefName);
            MergeItem mergeItem = (MergeItem) mergeContext.getAttribute(messageDestinationRefKey);
            if (mergeItem != null) {
                if (mergeItem.isFromWebFragment()) {
                    throw new DeploymentException(WebDeploymentMessageUtils.createDuplicateJNDIRefMessage("message-destination-ref", messageDestinationRefName, mergeItem.getBelongedURL(), mergeContext.getCurrentJarUrl()));
                } else if (mergeItem.isFromWebXml() && !isMessageDestinationRefInjectTargetsConfiguredInInitialWebXML(messageDestinationRefName, mergeContext)) {
                    //Merge InjectTarget
                    MessageDestinationRef messageDestinationRef = (MessageDestinationRef) mergeItem.getValue();
                    for (InjectionTarget injectTarget : srcMessageDestinationRef.getInjectionTarget()) {
                        String messageDestinationRefInjectTargetKey = createMessageDestinationRefInjectTargetKey(messageDestinationRefName, injectTarget.getInjectionTargetClass(), injectTarget
                                .getInjectionTargetName());
                        if (!mergeContext.containsAttribute(messageDestinationRefInjectTargetKey)) {
                            messageDestinationRef.getInjectionTarget().add(injectTarget);
                            mergeContext.setAttribute(messageDestinationRefInjectTargetKey, Boolean.TRUE);
                        }
                    }
                }
            } else {
                webApp.getMessageDestinationRef().add(srcMessageDestinationRef);
                mergeContext.setAttribute(messageDestinationRefKey, new MergeItem(srcMessageDestinationRef, mergeContext.getCurrentJarUrl(), ElementSource.WEB_FRAGMENT));
                for (InjectionTarget injectionTarget : srcMessageDestinationRef.getInjectionTarget()) {
                    mergeContext.setAttribute(createMessageDestinationRefInjectTargetKey(messageDestinationRefName, injectionTarget.getInjectionTargetClass(), injectionTarget.getInjectionTargetName()
                            ), Boolean.TRUE);
                }
            }
View Full Code Here

    @Override
    public void preProcessWebXmlElement(WebApp webApp, MergeContext mergeContext) throws DeploymentException {
        for (MessageDestinationRef messageDestinationRef : webApp.getMessageDestinationRef()) {
            String messageDestinationRefName = messageDestinationRef.getMessageDestinationRefName();
            mergeContext.setAttribute(createMessageDestinationRefKey(messageDestinationRefName), new MergeItem(messageDestinationRef, null, ElementSource.WEB_XML));
            //Create an attribute tag to indicate whether injectTarget is configured in web.xml file
            if (!messageDestinationRef.getInjectionTarget().isEmpty()) {
                mergeContext.setAttribute(createMessageDestinationRefInjectTargetConfiguredInWebXMLKey(messageDestinationRefName), Boolean.TRUE);
            }
            for (InjectionTarget injectionTarget : messageDestinationRef.getInjectionTarget()) {
View Full Code Here

    @Override
    public void merge(WebFragment webFragment, WebApp webApp, MergeContext mergeContext) throws DeploymentException {
        for (PersistenceUnitRef srcPersistenceUnitRef : webFragment.getPersistenceUnitRef()) {
            String persistenceUnitRefName = srcPersistenceUnitRef.getPersistenceUnitRefName();
            String persistenceUnitRefKey = createPersistenceUnitRefKey(persistenceUnitRefName);
            MergeItem mergeItem = (MergeItem) mergeContext.getAttribute(persistenceUnitRefKey);
            if (mergeItem != null) {
                if (mergeItem.isFromWebFragment()) {
                    throw new DeploymentException(WebDeploymentMessageUtils.createDuplicateJNDIRefMessage("persistence-unit-ref", persistenceUnitRefName, mergeItem.getBelongedURL(), mergeContext.getCurrentJarUrl()));
                } else if (mergeItem.isFromWebXml() && !isPersistenceUnitRefInjectTargetsConfiguredInInitialWebXML(persistenceUnitRefName, mergeContext)) {
                    //Merge InjectTarget
                    PersistenceUnitRef persistenceUnitRef = (PersistenceUnitRef) mergeItem.getValue();
                    for (InjectionTarget injectTarget : srcPersistenceUnitRef.getInjectionTarget()) {
                        String persistenceUnitRefInjectTargetKey = createPersistenceUnitRefInjectTargetKey(persistenceUnitRefName, injectTarget.getInjectionTargetClass(), injectTarget
                                .getInjectionTargetName());
                        if (!mergeContext.containsAttribute(persistenceUnitRefInjectTargetKey)) {
                            persistenceUnitRef.getInjectionTarget().add(injectTarget);
                            mergeContext.setAttribute(persistenceUnitRefInjectTargetKey, Boolean.TRUE);
                        }
                    }
                }
            } else {
                webApp.getPersistenceUnitRef().add(srcPersistenceUnitRef);
                mergeContext.setAttribute(persistenceUnitRefKey, new MergeItem(srcPersistenceUnitRef, mergeContext.getCurrentJarUrl(), ElementSource.WEB_FRAGMENT));
                for (InjectionTarget injectionTarget : srcPersistenceUnitRef.getInjectionTarget()) {
                    mergeContext.setAttribute(createPersistenceUnitRefInjectTargetKey(persistenceUnitRefName, injectionTarget.getInjectionTargetClass(), injectionTarget.getInjectionTargetName()
                            ), Boolean.TRUE);
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.web25.deployment.DefaultWebAppInfoFactory

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.