Examples of EnvEntryType


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

                    try {

                        log.debug("addResource(): Does not exist in DD: " + resourceName);

                        // Doesn't exist in deployment descriptor -- add new
                        EnvEntryType envEntry = annotatedApp.addNewEnvEntry();

                        //------------------------------------------------------------------------------
                        // <env-entry> required elements:
                        //------------------------------------------------------------------------------

                        // env-entry-name
                        JndiNameType envEntryName = envEntry.addNewEnvEntryName();
                        envEntryName.setStringValue(resourceName);

                        if (!resourceType.equals("")) {
                            // env-entry-type
                            EnvEntryTypeValuesType envEntryType = envEntry.addNewEnvEntryType();
                            envEntryType.setStringValue(resourceType);
                        }                        
                        if (method != null || field != null) {
                            // injectionTarget
                            InjectionTargetType injectionTarget = envEntry.addNewInjectionTarget();
                            configureInjectionTarget(injectionTarget, method, field);
                        }

                        // mappedName
                        String mappdedNameAnnotation = annotation.mappedName();
                        if (!mappdedNameAnnotation.equals("")) {
                            XsdStringType mappedName = envEntry.addNewMappedName();
                            mappedName.setStringValue(mappdedNameAnnotation);
                            envEntry.setMappedName(mappedName);
                        }

                        //------------------------------------------------------------------------------
                        // <env-entry> optional elements:
                        //------------------------------------------------------------------------------

                        // description
                        String descriptionAnnotation = annotation.description();
                        if (!descriptionAnnotation.equals("")) {
                            DescriptionType description = envEntry.addNewDescription();
                            description.setStringValue(descriptionAnnotation);
                        }

                    }
                    catch (Exception anyException) {
View Full Code Here

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

                    try {

                        log.debug("addResource(): Does not exist in DD: " + resourceName);

                        // Doesn't exist in deployment descriptor -- add new
                        EnvEntryType envEntry = annotatedApp.addNewEnvEntry();

                        //------------------------------------------------------------------------------
                        // <env-entry> required elements:
                        //------------------------------------------------------------------------------

                        // env-entry-name
                        JndiNameType envEntryName = envEntry.addNewEnvEntryName();
                        envEntryName.setStringValue(resourceName);

                        if (!resourceType.equals("")) {
                            // env-entry-type
                            EnvEntryTypeValuesType envEntryType = envEntry.addNewEnvEntryType();
                            envEntryType.setStringValue(resourceType);
                        } else if (method != null || field != null) {
                            // injectionTarget
                            InjectionTargetType injectionTarget = envEntry.addNewInjectionTarget();
                            configureInjectionTarget(injectionTarget, method, field);
                        }

                        // env-entry-value
                        String mappdedNameAnnotation = annotation.mappedName();
                        if (!mappdedNameAnnotation.equals("")) {
                            XsdStringType value = envEntry.addNewEnvEntryValue();
                            value.setStringValue(mappdedNameAnnotation);
                            envEntry.setMappedName(value);
                        }

                        //------------------------------------------------------------------------------
                        // <env-entry> optional elements:
                        //------------------------------------------------------------------------------

                        // description
                        String descriptionAnnotation = annotation.description();
                        if (!descriptionAnnotation.equals("")) {
                            DescriptionType description = envEntry.addNewDescription();
                            description.setStringValue(descriptionAnnotation);
                        }

                    }
                    catch (Exception anyException) {
View Full Code Here

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

                    try {

                        log.debug("addResource(): Does not exist in DD: " + resourceName);

                        // Doesn't exist in deployment descriptor -- add new
                        EnvEntryType envEntry = annotatedApp.addNewEnvEntry();

                        //------------------------------------------------------------------------------
                        // <env-entry> required elements:
                        //------------------------------------------------------------------------------

                        // env-entry-name
                        JndiNameType envEntryName = envEntry.addNewEnvEntryName();
                        envEntryName.setStringValue(resourceName);

                        if (!resourceType.equals(Object.class)) {
                            // env-entry-type
                            EnvEntryTypeValuesType envEntryType = envEntry.addNewEnvEntryType();
                            envEntryType.setStringValue(resourceType.getCanonicalName());
                        }                        
                        if (method != null || field != null) {
                            // injectionTarget
                            InjectionTargetType injectionTarget = envEntry.addNewInjectionTarget();
                            configureInjectionTarget(injectionTarget, method, field);
                        }

                        //------------------------------------------------------------------------------
                        // <env-entry> optional elements:
                        //------------------------------------------------------------------------------
                       
                        // mappedName
                        String mappdedNameAnnotation = annotation.mappedName();
                        if (!mappdedNameAnnotation.equals("")) {
                            XsdStringType mappedName = envEntry.addNewMappedName();
                            mappedName.setStringValue(mappdedNameAnnotation);
                        }

                        // description
                        String descriptionAnnotation = annotation.description();
                        if (!descriptionAnnotation.equals("")) {
                            DescriptionType description = envEntry.addNewDescription();
                            description.setStringValue(descriptionAnnotation);
                        }

                        // lookup
                        String lookup = annotation.lookup();
                        if (!lookup.equals("")) {
                            XsdStringType lookupName = envEntry.addNewLookupName();
                            lookupName.setStringValue(lookup);
                        }
                    }
                    catch (Exception anyException) {
                        log.debug("ResourceAnnotationHelper: Exception caught while processing <env-entry>");
View Full Code Here

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

            if (mergeItem != null) {
                if (mergeItem.isFromWebFragment()) {
                    throw new DeploymentException(WebDeploymentMessageUtils.createDuplicateJNDIRefMessage("env-entry", envEntryName, mergeItem.getBelongedURL(), mergeContext.getCurrentJarUrl()));
                } else if (mergeItem.isFromWebXml() && !isEnvEntryInjectTargetsConfiguredInInitialWebXML(envEntryName, mergeContext)) {
                    //Merge InjectTarget
                    EnvEntryType envEntry = (EnvEntryType) mergeItem.getValue();
                    for (InjectionTargetType injectTarget : srcEnvEntry.getInjectionTargetArray()) {
                        String envEntryInjectTargetKey = createEnvEntryInjectTargetKey(envEntryName, injectTarget.getInjectionTargetClass().getStringValue(), injectTarget
                                .getInjectionTargetName().getStringValue());
                        if (!mergeContext.containsAttribute(envEntryInjectTargetKey)) {
                            envEntry.addNewInjectionTarget().set(injectTarget);
                            mergeContext.setAttribute(envEntryInjectTargetKey, Boolean.TRUE);
                        }
                    }
                }
            } else {
                EnvEntryType targetEnvEntry = (EnvEntryType) webApp.addNewEnvEntry().set(srcEnvEntry);
                mergeContext.setAttribute(envEntryKey, new MergeItem(targetEnvEntry, mergeContext.getCurrentJarUrl(), ElementSource.WEB_FRAGMENT));
                for (InjectionTargetType injectionTarget : targetEnvEntry.getInjectionTargetArray()) {
                    mergeContext.setAttribute(createEnvEntryInjectTargetKey(envEntryName, injectionTarget.getInjectionTargetClass().getStringValue(), injectionTarget.getInjectionTargetName()
                            .getStringValue()), Boolean.TRUE);
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.