Package org.apache.geronimo.xbeans.javaee6

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


            ejbModule.setModuleId(targetPath);
        }

        // Create XMLBeans version of EjbJarType for the AnnotatedApp interface
        EjbJar ejbJar = ejbModule.getEjbJar();
        EjbJarType ejbJarType = XmlUtil.convertToXmlbeans(ejbJar);
        AnnotatedEjbJar annotatedEjbJar = new AnnotatedEjbJar(ejbJarType);

        String name = null;
        if (ejbJarType.isSetModuleName()) {
            name = ejbJarType.getModuleName().getStringValue().trim();
        } else if (standAlone) {
            name = FileUtils.removeExtension(new File(moduleFile.getName()).getName(), ".jar");
        } else {
            name = FileUtils.removeExtension(targetPath, ".jar");
        }
View Full Code Here


        // We must set all mapped name references back to null or Geronimo will blow up
//        unmapReferences(ejbJar, geronimoEjbJarType);

        // create a xmlbeans version of the ejb-jar.xml file, because the jndi code is coupled based on xmlbeans objects
        EjbJarType ejbJarType = XmlUtil.convertToXmlbeans(ejbJar);
        ejbModule.setSpecDD(ejbJarType);

        // convert the plan to xmlbeans since geronimo naming is coupled on xmlbeans objects
        OpenejbGeronimoEjbJarType geronimoOpenejb = XmlUtil.convertToXmlbeans(geronimoEjbJarType);
        ejbModule.setVendorDD(geronimoOpenejb);

        // todo move namingBuilders.buildEnvironment() here when geronimo naming supports it

        // initialize the naming builders
        if (ejbJarType.getAssemblyDescriptor() != null) {
            namingBuilder.initContext(ejbJarType.getAssemblyDescriptor(),
                    geronimoOpenejb,
                    ejbModule);
        }

        EjbDeploymentBuilder ejbDeploymentBuilder = new EjbDeploymentBuilder(earContext, ejbModule, namingBuilder, resourceEnvironmentSetter);
View Full Code Here

            // classFinder in the module will convey whether metadata-complete is set (or not)
            ejbModule.setClassFinder(createEjbJarClassFinder(ejbModule));
        }

        Map<JndiKey, Map<String, Object>> moduleJndiContext = NamingBuilder.JNDI_KEY.get(ejbModule.getSharedContext());
        EnterpriseBeansType enterpriseBeans = ejbJarType.getEnterpriseBeans();
        if (enterpriseBeans != null) {
            for (SessionBeanType xmlbeansEjb : enterpriseBeans.getSessionArray()) {
                String ejbName = xmlbeansEjb.getEjbName().getStringValue().trim();
                GBeanData gbean = getEjbGBean(ejbName);
                ResourceRefType[] resourceRefs = xmlbeansEjb.getResourceRefArray();
                addEnc(gbean, xmlbeansEjb, resourceRefs, moduleJndiContext);
            }
            for (MessageDrivenBeanType xmlbeansEjb : enterpriseBeans.getMessageDrivenArray()) {
                String ejbName = xmlbeansEjb.getEjbName().getStringValue().trim();
                GBeanData gbean = getEjbGBean(ejbName);
                ResourceRefType[] resourceRefs = xmlbeansEjb.getResourceRefArray();
                addEnc(gbean, xmlbeansEjb, resourceRefs, moduleJndiContext);
            }
            for (EntityBeanType xmlbeansEjb : enterpriseBeans.getEntityArray()) {
                String ejbName = xmlbeansEjb.getEjbName().getStringValue().trim();
                GBeanData gbean = getEjbGBean(ejbName);
                ResourceRefType[] resourceRefs = xmlbeansEjb.getResourceRefArray();
                addEnc(gbean, xmlbeansEjb, resourceRefs, moduleJndiContext);
            }
View Full Code Here

    @Override
    public void merge(WebFragmentType webFragment, WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
        for (FilterMappingType srcFilterMapping : webFragment.getFilterMappingArray()) {
            String filterName = srcFilterMapping.getFilterName().getStringValue();
            FilterMappingType targetFilterMapping = (FilterMappingType) mergeContext.getAttribute(createFilterMappingKey(filterName));
            if (targetFilterMapping == null) {
                targetFilterMapping = (FilterMappingType) webApp.addNewFilterMapping().set(srcFilterMapping);
                mergeContext.setAttribute(createFilterMappingKey(filterName), targetFilterMapping);
                for (SubMergeHandler<FilterMappingType, FilterMappingType> subMergeHandler : subMergeHandlers) {
                    subMergeHandler.add(targetFilterMapping, mergeContext);
                }
            } else {
                if (isFilterMappingFromAnnotation(filterName, mergeContext)) {
                    //If the current url-patterns configurations are from annotations, so let's drop them
                    targetFilterMapping.setUrlPatternArray(new UrlPatternType[0]);
                    targetFilterMapping.setDispatcherArray(new DispatcherType[0]);
                    targetFilterMapping.setServletNameArray(new ServletNameType[0]);
                    mergeContext.removeAttribute(createFilterMappingSourceKey(filterName));
                }
                for (SubMergeHandler<FilterMappingType, FilterMappingType> subMergeHandler : subMergeHandlers) {
                    subMergeHandler.merge(srcFilterMapping, targetFilterMapping, mergeContext);
                }
View Full Code Here

    @Override
    public void merge(WebFragmentType webFragment, WebAppType webApp, MergeContext mergeContext) throws DeploymentException {
        for (FilterType srcFilter : webFragment.getFilterArray()) {
            String filterName = srcFilter.getFilterName().getStringValue();
            FilterType targetFilter = (FilterType) mergeContext.getAttribute(createFilterKey(filterName));
            if (targetFilter == null) {
                targetFilter = (FilterType) webApp.addNewFilter().set(srcFilter);
                mergeContext.setAttribute(createFilterKey(filterName), targetFilter);
                for (SubMergeHandler<FilterType, FilterType> subMergeHandler : subMergeHandlers) {
                    subMergeHandler.add(targetFilter, mergeContext);
View Full Code Here

                            securityFactoryData.setAttribute("realmName", loginConfig.getRealmName().getStringValue().trim());
                        } else if (auth == BuiltInAuthMethod.DIGEST) {
                            securityFactoryData.setAttribute("realmName", loginConfig.getRealmName().getStringValue().trim());
                        } else if (auth == BuiltInAuthMethod.FORM) {
                            if (loginConfig.isSetFormLoginConfig()) {
                                FormLoginConfigType formLoginConfig = loginConfig.getFormLoginConfig();
                                securityFactoryData.setAttribute("loginPage", formLoginConfig.getFormLoginPage().getStringValue());
                                securityFactoryData.setAttribute("errorPage", formLoginConfig.getFormErrorPage().getStringValue());
                            }
                        } else if (auth == BuiltInAuthMethod.CLIENTCERT) {
                            //nothing to do
                        } else {
                            throw new DeploymentException("unrecognized auth method, use jaspi to configure: " + authMethod);
View Full Code Here

            mainClas = mainClas.getSuperclass();
        }

        // Get the callback-handler from the deployment descriptor
        if (appClient.isSetCallbackHandler()) {
            FullyQualifiedClassType cls = appClient.getCallbackHandler();
            Class<?> clas;
            try {
                clas = bundle.loadClass(cls.getStringValue().trim());
            }
            catch (ClassNotFoundException e) {
                throw new DeploymentException("AppClientModuleBuilder: Could not load callback-handler class: " + cls.getStringValue(), e);
            }
            classes.add(clas);
        }

        return new ClassFinder(classes);
View Full Code Here

                        JndiNameType resourceRefName = resourceRef.addNewResRefName();
                        resourceRefName.setStringValue(resourceName);

                        if (!resourceType.equals("")) {
                            // resource-ref-type
                            FullyQualifiedClassType qualifiedClass = resourceRef.addNewResType();
                            qualifiedClass.setStringValue(resourceType);
                        }
                        if (method != null || field != null) {
                            // injectionTarget
                            InjectionTargetType injectionTarget = resourceRef.addNewInjectionTarget();
                            configureInjectionTarget(injectionTarget, method, field);
View Full Code Here

                            FullyQualifiedClassType qualifiedClass = resourceRef.addNewResType();
                            qualifiedClass.setStringValue(resourceType);
                        }
                        if (method != null || field != null) {
                            // injectionTarget
                            InjectionTargetType injectionTarget = resourceRef.addNewInjectionTarget();
                            configureInjectionTarget(injectionTarget, method, field);
                        }

                        //------------------------------------------------------------------------------
                        // <resource-ref> optional elements:
View Full Code Here

                        //------------------------------------------------------------------------------
                        // <resource-ref> required elements:
                        //------------------------------------------------------------------------------

                        // resource-ref-name
                        JndiNameType resourceRefName = resourceRef.addNewResRefName();
                        resourceRefName.setStringValue(resourceName);

                        if (!resourceType.equals("")) {
                            // resource-ref-type
                            FullyQualifiedClassType qualifiedClass = resourceRef.addNewResType();
                            qualifiedClass.setStringValue(resourceType);
View Full Code Here

TOP

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

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.