Package org.apache.openejb.jee

Examples of org.apache.openejb.jee.Text


        return null;
      }

      Text[] result = new Text[strings.length];
      for (int i = 0; i < result.length; i++) {
        result[i] = new Text();
        result[i].setValue(strings[i]);
      }

      return result;
    }
View Full Code Here


    private Text[] getTexts(Text[] originalTexts, String[] newStrings) {
      if (newStrings != null && newStrings.length > 0 && (originalTexts == null || originalTexts.length == 0)) {
        Text[] texts = new Text[newStrings.length];
        for (int i = 0; i < newStrings.length; i++) {
          texts[i] = new Text(null, newStrings[i]);
        }

        return texts;
      } else {
        return originalTexts;
View Full Code Here

        if (dataSource.getClassName() == null) {
            dataSource.setClassName(dsDefinition.className());
        }

        if (dataSource.getDescription() == null && dsDefinition.description().trim().length() > 0) {
            dataSource.setDescriptions(new Text[]{new Text(null, dsDefinition.description().trim())});
        }

        if (dataSource.getUser() == null && dsDefinition.user().trim().length() > 0) {
            dataSource.setUser(dsDefinition.user().trim());
        }
View Full Code Here

                        //------------------------------------------------------------------------------

                        // description
                        String descriptionAnnotation = annotation.description();
                        if (!descriptionAnnotation.equals("")) {
                            resourceRef.setDescriptions(new Text[]{new Text(null, descriptionAnnotation)});
                        }

                        // authentication
                        if (annotation.authenticationType() == Resource.AuthenticationType.CONTAINER) {
                            resourceRef.setResAuth(ResAuth.CONTAINER);
View Full Code Here

            //------------------------------------------------------------------------------

            // description
            String descriptionAnnotation = annotation.description();
            if (!descriptionAnnotation.isEmpty()) {
                resourceEnvRef.setDescriptions(new Text[] {new Text(null, descriptionAnnotation) }  );
            }

            // mappedName
            String mappdedNameAnnotation = annotation.mappedName();
            if (!mappdedNameAnnotation.isEmpty()) {
View Full Code Here

            //------------------------------------------------------------------------------

            // description
            String descriptionAnnotation = annotation.description();
            if (!descriptionAnnotation.isEmpty()) {
                messageDestinationRef.setDescriptions(new Text[]{new Text(null, descriptionAnnotation)});
            }

            // mappedName
            String mappdedNameAnnotation = annotation.mappedName();
            if (!mappdedNameAnnotation.isEmpty()) {
View Full Code Here

                        }

                        // description
                        String descriptionAnnotation = annotation.description();
                        if (!descriptionAnnotation.equals("")) {
                            envEntry.setDescriptions(new Text[] {new Text(null, descriptionAnnotation)});
                        }

                        // lookup
                        String lookup = annotation.lookup();
                        if (!lookup.equals("")) {
View Full Code Here

                        //------------------------------------------------------------------------------

                        // description
                        String descriptionAnnotation = annotation.description();
                        if (!descriptionAnnotation.equals("")) {
                            serviceRef.setDescriptions(new Text[] {new Text(null, descriptionAnnotation)  });
                        }

                        // service-ref-type
                        if (serviceRef.getServiceRefType() == null) {
                            serviceRef.setServiceRefType(resourceType);
View Full Code Here

                    }

                    // description
                    String descriptionAnnotation = annotation.description();
                    if (!descriptionAnnotation.isEmpty()) {
                        ejbLocalRef.setDescriptions(new Text[] {new Text(null, descriptionAnnotation)});
                    }

                    ejbLocalRef.setRefType(EjbReference.Type.LOCAL);
                    annotatedApp.getEjbLocalRef().add(ejbLocalRef);
                }
                catch (Exception e) {
                    log.debug("EJBAnnotationHelper: Exception caught while processing <ejb-local-ref>", e);
                }
            }

            // injectionTarget
            if (method != null || field != null) {
                Set<InjectionTarget> targets = ejbLocalRef.getInjectionTarget();
                if (!hasTarget(method, field, targets)) {
                    ejbLocalRef.getInjectionTarget().add(configureInjectionTarget(method, field));
                }
            }
        }                                                                           // end if local
        else if (remoteFlag) {                                                      // remote

            //--------------------------------------------------------------------------------------
            // 2. <ejb-ref>
            //--------------------------------------------------------------------------------------

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

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

            EjbRef ejbRef = annotatedApp.getEjbRefMap().get(getJndiName(remoteRefName));

            if (ejbRef == null) {
                try {

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

                    // Doesn't exist in deployment descriptor -- add new
                    ejbRef = new EjbRef();

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

                    // ejb-ref-name
                    ejbRef.setEjbRefName(remoteRefName);

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

                    // remote
                    if (interfce != null) {
                        String remoteAnnotation = interfce.getName();
                        if (!remoteAnnotation.isEmpty()) {
                            ejbRef.setRemote(remoteAnnotation);
                        }
                    }

                    // ejb-link
                    String beanName = annotation.beanName();
                    if (!beanName.isEmpty()) {
                        ejbRef.setEjbLink(beanName);
                    }

                    // mappedName
                    String mappdedNameAnnotation = annotation.mappedName();
                    if (!mappdedNameAnnotation.isEmpty()) {
                        ejbRef.setMappedName(mappdedNameAnnotation);
                    }

                    // lookup
                    String lookupName = annotation.lookup();
                    if (!lookupName.isEmpty()) {
                        ejbRef.setLookupName(lookupName);
                    }

                    // description
                    String descriptionAnnotation = annotation.description();
                    if (!descriptionAnnotation.isEmpty()) {
                        ejbRef.setDescriptions(new Text[] {new Text(null, descriptionAnnotation) });
                    }

                    ejbRef.setRefType(EjbReference.Type.REMOTE);
                    annotatedApp.getEjbRef().add(ejbRef);
                }
                catch (Exception e) {
                    log.debug("EJBAnnotationHelper: Exception caught while processing <ejb-ref>", e);
                }
            }

            // injectionTarget
            if (method != null || field != null) {
                Set<InjectionTarget> targets = ejbRef.getInjectionTarget();
                if (!hasTarget(method, field, targets)) {
                    ejbRef.getInjectionTarget().add(configureInjectionTarget(method, field));
                }
            }
        }                                                                           // end if remote
        else {                                                                      // ambiguous

            //--------------------------------------------------------------------------------------
            // 3. <UNKNOWN>
            //--------------------------------------------------------------------------------------
            log.debug("addEJB(): <UNKNOWN> found");

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

            EjbRef ejbRef = annotatedApp.getEjbRefMap().get(getJndiName(remoteRefName));

            if (ejbRef == null) {
                try {

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

                    // Doesn't exist in deployment descriptor -- add as an <ejb-ref> to the
                    // ambiguous list so that it can be resolved later
                    ejbRef = new EjbRef();

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

                    // ejb-ref-name
                    ejbRef.setEjbRefName(remoteRefName);

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

                    // remote
                    if (interfce != null) {
                        String remoteAnnotation = interfce.getName();
                        if (!remoteAnnotation.isEmpty()) {
                            ejbRef.setRemote(remoteAnnotation);
                        }
                    }

                    // ejb-link
                    String beanName = annotation.beanName();
                    if (!beanName.isEmpty()) {
                        ejbRef.setEjbLink(beanName);
                    }

                    // mappedName
                    String mappdedNameAnnotation = annotation.mappedName();
                    if (!mappdedNameAnnotation.isEmpty()) {
                        ejbRef.setMappedName(mappdedNameAnnotation);
                    }

                    // lookup
                    String lookupName = annotation.lookup();
                    if (!lookupName.isEmpty()) {
                        ejbRef.setLookupName(lookupName);
                    }

                    // description
                    String descriptionAnnotation = annotation.description();
                    if (!descriptionAnnotation.isEmpty()) {
                        ejbRef.setDescriptions(new Text[] {new Text(null, descriptionAnnotation) });
                    }

                    ejbRef.setRefType(EjbReference.Type.UNKNOWN);
                    //openejb sorts out ambiguous ejb refs.
                    annotatedApp.getEjbRef().add(ejbRef);
View Full Code Here

            } else {
                //Add a new Servlet
                //create servlet element
                Servlet newServlet = new Servlet();
                if (!webServlet.displayName().isEmpty()) {
                    newServlet.addDisplayName(new Text(null, webServlet.displayName()));
                }
                newServlet.setServletClass(cls.getName());
                newServlet.setServletName(servletName);
                newServlet.setAsyncSupported(webServlet.asyncSupported());
                if (!webServlet.description().isEmpty()) {
                    newServlet.addDescription(new Text(null, webServlet.description()));
                }
                if (webServlet.loadOnStartup() != -1) {
                    newServlet.setLoadOnStartup(webServlet.loadOnStartup());
                }
                for (WebInitParam webInitParam : webServlet.initParams()) {
View Full Code Here

TOP

Related Classes of org.apache.openejb.jee.Text

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.