Package org.apache.geronimo.xbeans.javaee

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


                try {

                    log.debug("addEJB(): Does not exist in DD: " + localRefName);

                    // Doesn't exist in deployment descriptor -- add new
                    EjbLocalRefType ejbLocalRef = annotatedApp.addNewEjbLocalRef();

                    //------------------------------------------------------------------------------
                    // <ejb-local-ref> required elements:
                    //------------------------------------------------------------------------------

                    // ejb-ref-name
                    EjbRefNameType ejbRefName = ejbLocalRef.addNewEjbRefName();
                    ejbRefName.setStringValue(localRefName);
                    ejbLocalRef.setEjbRefName(ejbRefName);

                    //------------------------------------------------------------------------------
                    // <ejb-local-ref> optional elements:
                    //------------------------------------------------------------------------------

                    // local
                    if (interfce != null) {
                        String localAnnotation = interfce.getName();
                        if (!localAnnotation.equals("")) {
                            LocalType local = ejbLocalRef.addNewLocal();
                            local.setStringValue(localAnnotation);
                            ejbLocalRef.setLocal(local);
                        }
                    }

                    // ejb-link
                    String beanName = annotation.beanName();
                    if (!beanName.equals("")) {
                        EjbLinkType ejbLink = ejbLocalRef.addNewEjbLink();
                        ejbLink.setStringValue(beanName);
                        ejbLocalRef.setEjbLink(ejbLink);
                    }

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

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

                    // injectionTarget
                    if (method != null || field != null) {                            // No class-level injection
                        InjectionTargetType injectionTarget = ejbLocalRef.addNewInjectionTarget();
                        FullyQualifiedClassType qualifiedClass = injectionTarget.addNewInjectionTargetClass();
                        JavaIdentifierType javaType = injectionTarget.addNewInjectionTargetName();
                        if (method != null) {
                            qualifiedClass.setStringValue(method.getDeclaringClass().getName());
                            javaType.setStringValue(method.getName().substring(3));   // method should start with "set"
View Full Code Here


            log.debug("addEJB(): <ejb-local-ref> found");

            String localRefName = getName(annotation.name(), method, field);

            EjbLocalRefType ejbLocalRef = null;
           
            EjbLocalRefType[] ejbLocalRefEntries = annotatedApp.getEjbLocalRefArray();
            for (EjbLocalRefType ejbLocalRefEntry : ejbLocalRefEntries) {
                if (ejbLocalRefEntry.getEjbRefName().getStringValue().trim().equals(localRefName)) {
                    ejbLocalRef = ejbLocalRefEntry;
                    break;
                }
            }
            if (ejbLocalRef == null) {
                try {

                    log.debug("addEJB(): Does not exist in DD: " + localRefName);

                    // Doesn't exist in deployment descriptor -- add new
                    ejbLocalRef = annotatedApp.addNewEjbLocalRef();

                    //------------------------------------------------------------------------------
                    // <ejb-local-ref> required elements:
                    //------------------------------------------------------------------------------

                    // ejb-ref-name
                    EjbRefNameType ejbRefName = ejbLocalRef.addNewEjbRefName();
                    ejbRefName.setStringValue(localRefName);
                    ejbLocalRef.setEjbRefName(ejbRefName);

                    //------------------------------------------------------------------------------
                    // <ejb-local-ref> optional elements:
                    //------------------------------------------------------------------------------

                    // local
                    if (interfce != null) {
                        String localAnnotation = interfce.getName();
                        if (!localAnnotation.equals("")) {
                            LocalType local = ejbLocalRef.addNewLocal();
                            local.setStringValue(localAnnotation);
                            ejbLocalRef.setLocal(local);
                        }
                    }

                    // ejb-link
                    String beanName = annotation.beanName();
                    if (!beanName.equals("")) {
                        EjbLinkType ejbLink = ejbLocalRef.addNewEjbLink();
                        ejbLink.setStringValue(beanName);
                        ejbLocalRef.setEjbLink(ejbLink);
                    }

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

                    // description
                    String descriptionAnnotation = annotation.description();
                    if (!descriptionAnnotation.equals("")) {
                        DescriptionType description = ejbLocalRef.addNewDescription();
                        description.setStringValue(descriptionAnnotation);
                    }
                }
                catch (Exception e) {
                    log.debug("EJBAnnotationHelper: Exception caught while processing <ejb-local-ref>", e);
                }
            }
           
            // injectionTarget
            if (method != null || field != null) {
                InjectionTargetType[] targets = ejbLocalRef.getInjectionTargetArray();
                if (!hasTarget(method, field, targets)) {
                    configureInjectionTarget(ejbLocalRef.addNewInjectionTarget(), method, field);
                }
            }
        }                                                                           // end if local
        else if (remoteFlag) {                                                      // remote
View Full Code Here

                try {

                    log.debug("addEJB(): Does not exist in DD: " + localRefName);

                    // Doesn't exist in deployment descriptor -- add new
                    EjbLocalRefType ejbLocalRef = annotatedApp.addNewEjbLocalRef();

                    //------------------------------------------------------------------------------
                    // <ejb-local-ref> required elements:
                    //------------------------------------------------------------------------------

                    // ejb-ref-name
                    EjbRefNameType ejbRefName = ejbLocalRef.addNewEjbRefName();
                    ejbRefName.setStringValue(localRefName);
                    ejbLocalRef.setEjbRefName(ejbRefName);

                    //------------------------------------------------------------------------------
                    // <ejb-local-ref> optional elements:
                    //------------------------------------------------------------------------------

                    // local
                    if (interfce != null) {
                        String localAnnotation = interfce.getName();
                        if (!localAnnotation.equals("")) {
                            LocalType local = ejbLocalRef.addNewLocal();
                            local.setStringValue(localAnnotation);
                            ejbLocalRef.setLocal(local);
                        }
                    }

                    // ejb-link
                    String beanName = annotation.beanName();
                    if (!beanName.equals("")) {
                        EjbLinkType ejbLink = ejbLocalRef.addNewEjbLink();
                        ejbLink.setStringValue(beanName);
                        ejbLocalRef.setEjbLink(ejbLink);
                    }

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

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

                    // injectionTarget
                    if (method != null || field != null) {                            // No class-level injection
                        InjectionTargetType injectionTarget = ejbLocalRef.addNewInjectionTarget();
                        FullyQualifiedClassType qualifiedClass = injectionTarget.addNewInjectionTargetClass();
                        JavaIdentifierType javaType = injectionTarget.addNewInjectionTargetName();
                        if (method != null) {
                            qualifiedClass.setStringValue(method.getDeclaringClass().getName());
                            javaType.setStringValue(method.getName().substring(3));   // method should start with "set"
View Full Code Here

            log.debug("addEJB(): <ejb-local-ref> found");

            String localRefName = getName(annotation.name(), method, field);

            EjbLocalRefType ejbLocalRef = null;
           
            EjbLocalRefType[] ejbLocalRefEntries = annotatedApp.getEjbLocalRefArray();
            for (EjbLocalRefType ejbLocalRefEntry : ejbLocalRefEntries) {
                if (ejbLocalRefEntry.getEjbRefName().getStringValue().trim().equals(localRefName)) {
                    ejbLocalRef = ejbLocalRefEntry;
                    break;
                }
            }
            if (ejbLocalRef == null) {
                try {

                    log.debug("addEJB(): Does not exist in DD: " + localRefName);

                    // Doesn't exist in deployment descriptor -- add new
                    ejbLocalRef = annotatedApp.addNewEjbLocalRef();

                    //------------------------------------------------------------------------------
                    // <ejb-local-ref> required elements:
                    //------------------------------------------------------------------------------

                    // ejb-ref-name
                    EjbRefNameType ejbRefName = ejbLocalRef.addNewEjbRefName();
                    ejbRefName.setStringValue(localRefName);
                    ejbLocalRef.setEjbRefName(ejbRefName);

                    //------------------------------------------------------------------------------
                    // <ejb-local-ref> optional elements:
                    //------------------------------------------------------------------------------

                    // local
                    if (interfce != null) {
                        String localAnnotation = interfce.getName();
                        if (!localAnnotation.equals("")) {
                            LocalType local = ejbLocalRef.addNewLocal();
                            local.setStringValue(localAnnotation);
                            ejbLocalRef.setLocal(local);
                        }
                    }

                    // ejb-link
                    String beanName = annotation.beanName();
                    if (!beanName.equals("")) {
                        EjbLinkType ejbLink = ejbLocalRef.addNewEjbLink();
                        ejbLink.setStringValue(beanName);
                        ejbLocalRef.setEjbLink(ejbLink);
                    }

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

                    // description
                    String descriptionAnnotation = annotation.description();
                    if (!descriptionAnnotation.equals("")) {
                        DescriptionType description = ejbLocalRef.addNewDescription();
                        description.setStringValue(descriptionAnnotation);
                    }
                }
                catch (Exception e) {
                    log.debug("EJBAnnotationHelper: Exception caught while processing <ejb-local-ref>", e);
                }
            }
           
            // injectionTarget
            if (method != null || field != null) {
                InjectionTargetType[] targets = ejbLocalRef.getInjectionTargetArray();
                if (!hasTarget(method, field, targets)) {
                    configureInjectionTarget(ejbLocalRef.addNewInjectionTarget(), method, field);
                }
            }
        }                                                                           // end if local
        else if (remoteFlag) {                                                      // remote
View Full Code Here

                try {

                    log.debug("addEJB(): Does not exist in DD: " + localRefName);

                    // Doesn't exist in deployment descriptor -- add new
                    EjbLocalRefType ejbLocalRef = annotatedApp.addNewEjbLocalRef();

                    //------------------------------------------------------------------------------
                    // <ejb-local-ref> required elements:
                    //------------------------------------------------------------------------------

                    // ejb-ref-name
                    EjbRefNameType ejbRefName = ejbLocalRef.addNewEjbRefName();
                    ejbRefName.setStringValue(localRefName);
                    ejbLocalRef.setEjbRefName(ejbRefName);

                    //------------------------------------------------------------------------------
                    // <ejb-local-ref> optional elements:
                    //------------------------------------------------------------------------------

                    // local
                    if (interfce != null) {
                        String localAnnotation = interfce.getName();
                        if (!localAnnotation.equals("")) {
                            LocalType local = ejbLocalRef.addNewLocal();
                            local.setStringValue(localAnnotation);
                            ejbLocalRef.setLocal(local);
                        }
                    }

                    // ejb-link
                    String beanName = annotation.beanName();
                    if (!beanName.equals("")) {
                        EjbLinkType ejbLink = ejbLocalRef.addNewEjbLink();
                        ejbLink.setStringValue(beanName);
                        ejbLocalRef.setEjbLink(ejbLink);
                    }

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

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

                    // injectionTarget
                    if (method != null || field != null) {                            // No class-level injection
                        InjectionTargetType injectionTarget = ejbLocalRef.addNewInjectionTarget();
                        FullyQualifiedClassType qualifiedClass = injectionTarget.addNewInjectionTargetClass();
                        JavaIdentifierType javaType = injectionTarget.addNewInjectionTargetName();
                        if (method != null) {
                            qualifiedClass.setStringValue(method.getDeclaringClass().getName());
                            javaType.setStringValue(method.getName().substring(3));   // method should start with "set"
View Full Code Here

            }
            if ( !exists ) {
                try {

                    // Doesn't exist in deployment descriptor -- add new
                    EjbLocalRefType ejbLocalRef = webApp.addNewEjbLocalRef();

                    //------------------------------------------------------------------------------
                    // <ejb-local-ref> required elements:
                    //------------------------------------------------------------------------------

                    // ejb-ref-name
                    EjbRefNameType ejbRefName = EjbRefNameType.Factory.newInstance();
                    ejbRefName.setStringValue( localRefName );
                    ejbLocalRef.setEjbRefName( ejbRefName );

                    //------------------------------------------------------------------------------
                    // <ejb-local-ref> optional elements:
                    //------------------------------------------------------------------------------

                    // local
                    String localAnnotation = interfce.getName();
                    if ( localAnnotation.length() > 0 ) {
                        LocalType local = LocalType.Factory.newInstance();
                        local.setStringValue( localAnnotation );
                        ejbLocalRef.setLocal( local );
                    }

                    // ejb-link
                    String beanName = annotation.beanName();
                    if ( beanName.length() > 0 ) {
                        EjbLinkType ejbLink = EjbLinkType.Factory.newInstance();
                        ejbLink.setStringValue( beanName );
                        ejbLocalRef.setEjbLink( ejbLink );
                    }

                    // mappedName
                    String mappdedNameAnnotation = annotation.mappedName();
                    if ( mappdedNameAnnotation.length() > 0 ) {
                        XsdStringType mappedName = XsdStringType.Factory.newInstance();
                        mappedName.setStringValue( mappdedNameAnnotation );
                        ejbLocalRef.setMappedName( mappedName );
                    }

                    // description
                    String descriptionAnnotation = annotation.description();
                    if ( descriptionAnnotation.length() > 0 ) {
                        DescriptionType description = DescriptionType.Factory.newInstance();
                        description.setStringValue( descriptionAnnotation );
                        int arraySize = ejbLocalRef.sizeOfDescriptionArray();
                        ejbLocalRef.insertNewDescription( arraySize );
                        ejbLocalRef.setDescriptionArray( arraySize,description );
                    }

                    // injectionTarget
                    InjectionTargetType injectionTarget = InjectionTargetType.Factory.newInstance();
                    FullyQualifiedClassType qualifiedClass = FullyQualifiedClassType.Factory.newInstance();
                    JavaIdentifierType javaType = JavaIdentifierType.Factory.newInstance();
                    if ( method != null ) {
                        qualifiedClass.setStringValue( method.getDeclaringClass().getName() );
                        javaType.setStringValue( method.getName().substring(3) );   // method should start with "set"
                        injectionTarget.setInjectionTargetClass( qualifiedClass );
                        injectionTarget.setInjectionTargetName( javaType );
                        int arraySize = ejbLocalRef.sizeOfInjectionTargetArray();
                        ejbLocalRef.insertNewInjectionTarget( arraySize );
                        ejbLocalRef.setInjectionTargetArray( arraySize,injectionTarget );
                    }
                    else if ( field !=null ) {
                        qualifiedClass.setStringValue( field.getDeclaringClass().getName() );
                        javaType.setStringValue( field.getName() );
                        injectionTarget.setInjectionTargetClass( qualifiedClass );
                        injectionTarget.setInjectionTargetName( javaType );
                        int arraySize = ejbLocalRef.sizeOfInjectionTargetArray();
                        ejbLocalRef.insertNewInjectionTarget( arraySize );
                        ejbLocalRef.setInjectionTargetArray( arraySize,injectionTarget );
                    }

                }
                catch ( Exception anyException ) {
                    log.debug( "EJBAnnotationHelper: Exception caught while processing <ejb-local-ref>" );
View Full Code Here

            log.debug("addEJB(): <ejb-local-ref> found");

            String localRefName = getName(annotation.name(), method, field);

            EjbLocalRefType ejbLocalRef = null;
           
            EjbLocalRefType[] ejbLocalRefEntries = annotatedApp.getEjbLocalRefArray();
            for (EjbLocalRefType ejbLocalRefEntry : ejbLocalRefEntries) {
                if (ejbLocalRefEntry.getEjbRefName().getStringValue().trim().equals(localRefName)) {
                    ejbLocalRef = ejbLocalRefEntry;
                    break;
                }
            }
            if (ejbLocalRef == null) {
                try {

                    log.debug("addEJB(): Does not exist in DD: " + localRefName);

                    // Doesn't exist in deployment descriptor -- add new
                    ejbLocalRef = annotatedApp.addNewEjbLocalRef();

                    //------------------------------------------------------------------------------
                    // <ejb-local-ref> required elements:
                    //------------------------------------------------------------------------------

                    // ejb-ref-name
                    EjbRefNameType ejbRefName = ejbLocalRef.addNewEjbRefName();
                    ejbRefName.setStringValue(localRefName);
                    ejbLocalRef.setEjbRefName(ejbRefName);

                    //------------------------------------------------------------------------------
                    // <ejb-local-ref> optional elements:
                    //------------------------------------------------------------------------------

                    // local
                    if (interfce != null) {
                        String localAnnotation = interfce.getName();
                        if (!localAnnotation.equals("")) {
                            LocalType local = ejbLocalRef.addNewLocal();
                            local.setStringValue(localAnnotation);
                            ejbLocalRef.setLocal(local);
                        }
                    }

                    // ejb-link
                    String beanName = annotation.beanName();
                    if (!beanName.equals("")) {
                        EjbLinkType ejbLink = ejbLocalRef.addNewEjbLink();
                        ejbLink.setStringValue(beanName);
                        ejbLocalRef.setEjbLink(ejbLink);
                    }

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

                    // description
                    String descriptionAnnotation = annotation.description();
                    if (!descriptionAnnotation.equals("")) {
                        DescriptionType description = ejbLocalRef.addNewDescription();
                        description.setStringValue(descriptionAnnotation);
                    }
                }
                catch (Exception e) {
                    log.debug("EJBAnnotationHelper: Exception caught while processing <ejb-local-ref>", e);
                }
            }
           
            // injectionTarget
            if (method != null || field != null) {
                InjectionTargetType[] targets = ejbLocalRef.getInjectionTargetArray();
                if (!hasTarget(method, field, targets)) {
                    configureInjectionTarget(ejbLocalRef.addNewInjectionTarget(), method, field);
                }
            }
        }                                                                           // end if local
        else if (remoteFlag) {                                                      // remote
View Full Code Here

            log.debug("addEJB(): <ejb-local-ref> found");

            String localRefName = getName(annotation.name(), method, field);

            EjbLocalRefType ejbLocalRef = null;
           
            EjbLocalRefType[] ejbLocalRefEntries = annotatedApp.getEjbLocalRefArray();
            for (EjbLocalRefType ejbLocalRefEntry : ejbLocalRefEntries) {
                if (ejbLocalRefEntry.getEjbRefName().getStringValue().trim().equals(localRefName)) {
                    ejbLocalRef = ejbLocalRefEntry;
                    break;
                }
            }
            if (ejbLocalRef == null) {
                try {

                    log.debug("addEJB(): Does not exist in DD: " + localRefName);

                    // Doesn't exist in deployment descriptor -- add new
                    ejbLocalRef = annotatedApp.addNewEjbLocalRef();

                    //------------------------------------------------------------------------------
                    // <ejb-local-ref> required elements:
                    //------------------------------------------------------------------------------

                    // ejb-ref-name
                    EjbRefNameType ejbRefName = ejbLocalRef.addNewEjbRefName();
                    ejbRefName.setStringValue(localRefName);
                    ejbLocalRef.setEjbRefName(ejbRefName);

                    //------------------------------------------------------------------------------
                    // <ejb-local-ref> optional elements:
                    //------------------------------------------------------------------------------

                    // local
                    if (interfce != null) {
                        String localAnnotation = interfce.getName();
                        if (!localAnnotation.equals("")) {
                            LocalType local = ejbLocalRef.addNewLocal();
                            local.setStringValue(localAnnotation);
                            ejbLocalRef.setLocal(local);
                        }
                    }

                    // ejb-link
                    String beanName = annotation.beanName();
                    if (!beanName.equals("")) {
                        EjbLinkType ejbLink = ejbLocalRef.addNewEjbLink();
                        ejbLink.setStringValue(beanName);
                        ejbLocalRef.setEjbLink(ejbLink);
                    }

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

                    // description
                    String descriptionAnnotation = annotation.description();
                    if (!descriptionAnnotation.equals("")) {
                        DescriptionType description = ejbLocalRef.addNewDescription();
                        description.setStringValue(descriptionAnnotation);
                    }
                }
                catch (Exception e) {
                    log.debug("EJBAnnotationHelper: Exception caught while processing <ejb-local-ref>", e);
                }
            }
           
            // injectionTarget
            if (method != null || field != null) {
                InjectionTargetType[] targets = ejbLocalRef.getInjectionTargetArray();
                if (!hasTarget(method, field, targets)) {
                    configureInjectionTarget(ejbLocalRef.addNewInjectionTarget(), method, field);
                }
            }
        }                                                                           // end if local
        else if (remoteFlag) {                                                      // remote
View Full Code Here

TOP

Related Classes of org.apache.geronimo.xbeans.javaee.EjbLocalRefType

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.