Package org.glassfish.ejb.deployment.descriptor

Examples of org.glassfish.ejb.deployment.descriptor.ContainerTransaction


       boolean lookForIt = false;
      
       for (int i = 0; i < componentInterfaceMethods.length; i++) {
               if (Arrays.binarySearch(EJBObjectMethods, componentInterfaceMethods[i].getName()) < 0) {
         try {
       ContainerTransaction containerTransaction = null;
       boolean resolved = false;
/*
                         // This flag is a workaround introduced by Harminder
                         // because currently methodDescriptor.getEjbClassSymbol() is
                         // returning NULL
                         //boolean allMethods = false;
                         boolean wildCardWasPresent = false;
*/
                        
       if (!descriptor.getMethodContainerTransactions().isEmpty()) {
           for (Enumeration ee = descriptor.getMethodContainerTransactions().keys(); ee.hasMoreElements();) {
        lookForIt = false;
        MethodDescriptor methodDescriptor = (MethodDescriptor) ee.nextElement();

    /*** Fixed the bug: 4883730. ejbClassSymbol is null when method-intf is not
     * defined in the xml, since it is an optional field. Removed the earlier
     * checks. A null method-intf indicates that the method is supposed to be
     * in both Local & Home interfaces. ***/                   
/*
                                // This code is a workaround introduced by Harminder
                                // because currently methodDescriptor.getEjbClassSymbol() is
                                // returning NULL
                                String methodIntf = null;
                                try {
                                    methodIntf = methodDescriptor.getEjbClassSymbol();
                                } catch ( Exception ex ) {}
                                if ( methodIntf == null ) { //|| methodIntf.equals("")
                                    //probably a wildcard was there
                                    wildCardWasPresent = true;
                                    continue;
                                }
                                 //allMethods = true;
                                 // end of workaround
*/
                                
         // here we have to check that each method descriptor
         // corresponds to a or some methods on the component interface
         // according to the six styles
         // style 1)
                 if (methodDescriptor.getName().equals(MethodDescriptor.ALL_METHODS)) {
             // if getEjbClassName() is Remote -> CARRY ON
             // if Remote - PASS
                     if (methodDescriptor.getEjbClassSymbol() == null) {
           lookForIt = true;
                     } else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_REMOTE)) {
           lookForIt = true;
           // if empty String PASS
             } else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCAL)) {
           lookForIt = true;
             }else if (methodDescriptor.getEjbClassSymbol().equals("")) {
           lookForIt = true;
             } else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_HOME)) {
           lookForIt = false;
             else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCALHOME)) {
           lookForIt = false;
             }else {
           // carry on & don't look for
           // container transaction
           lookForIt = false;
             }
            
            
         } else if (methodDescriptor.getParameterClassNames() == null) {
            
            
             // if (getEjbClassSybol() is Remote or is the empty String AND if componentInterfaceMethods[i].getName().equals(methodDescriptor.getName())
             if (((methodDescriptor.getEjbClassSymbol() == null) ||
            methodDescriptor.getEjbClassSymbol().equals("") ||
            methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_REMOTE)||
            methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCAL)) &&
           (componentInterfaceMethods[i].getName().equals(methodDescriptor.getName()))) {
           //  PASS
           lookForIt = true;
             } else {
           // carry on
           lookForIt = false;
             }
            
            
         } else {
            
             // if (getEjbClassSybol() is Remote or is the empty String AND if componentInterfaceMethods[i].getName().equals(methodDescriptor.getName()) AND
             // the parameters of the method[i] are the same as the parameters of the method descriptor )
            
             if (((methodDescriptor.getEjbClassSymbol() == null) ||
            methodDescriptor.getEjbClassSymbol().equals("") ||
            methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_REMOTE)||
            methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCAL))&&
           (componentInterfaceMethods[i].getName().equals(methodDescriptor.getName()))&&
           (MethodUtils.stringArrayEquals(methodDescriptor.getParameterClassNames(), (new MethodDescriptor(componentInterfaceMethods[i], methodIntf)).getParameterClassNames()))) {
           // PASS     
           lookForIt = true;
             } else {
           // CARRY ON
           lookForIt = false;
             }
            
         }
        
         if (lookForIt) {
             containerTransaction =
           (ContainerTransaction) descriptor.getMethodContainerTransactions().get(methodDescriptor);
             if (containerTransaction != null) {
           String transactionAttribute  =
               containerTransaction.getTransactionAttribute();
          
           // danny is doing this in the DOL, but is it possible to not have
           // any value for containerTransaction.getTransactionAttribute()
           // in the DOL? if it is possible to have blank value for this,
           // then this check is needed here, otherwise we are done and we
View Full Code Here


      boolean lookForIt = false;
     
      for (int i=0; i< methods.length; i++) {
    if (Arrays.binarySearch(EJBObjectMethods, methods[i].getName()) < 0) {
                    try {
      ContainerTransaction containerTransaction = null;
      boolean resolved = false;
/*
                        // This flag is a workaround introduced by Harminder
                        // because currently methodDescriptor.getEjbClassSymbol() is
                        // returning NULL
                        //boolean allMethods = false;
                        boolean wildCardWasPresent = false;
*/

      if (!descriptor.getMethodContainerTransactions().isEmpty()) {
          for (Enumeration ee = descriptor.getMethodContainerTransactions().keys(); ee.hasMoreElements();) {
        lookForIt = false;
       
        MethodDescriptor methodDescriptor = (MethodDescriptor) ee.nextElement();
    /*** Fixed the bug: 4883730. ejbClassSymbol is null when method-intf is not
     * defined in the xml, since it is an optional field. Removed the earlier
     * checks. A null method-intf indicates that the method is supposed to be
     * in both Local & Home interfaces. ***/                   
/*
                                // This code is a workaround introduced by Harminder
                                // because currently methodDescriptor.getEjbClassSymbol() is
                                // returning NULL
                                String methodIntf = null;
                                try {
                                    methodIntf = methodDescriptor.getEjbClassSymbol();
                                } catch ( Exception ex ) {}
                                if ( methodIntf == null ) { //|| methodIntf.equals("")
                                    //probably a wildcard was there
                                    wildCardWasPresent = true;
                                    continue;
                                }
                                 //allMethods = true;
                                 // end of workaround
*/
                               
       
        // here we have to check that each method descriptor
        // corresponds to a or some methods on the home interface
        // according to the six styles
        // style 1)
                 if (methodDescriptor.getName().equals(MethodDescriptor.ALL_METHODS)) {
            // if getEjbClassName() is Remote -> CARRY ON
            // if Home - PASS
                    if (methodDescriptor.getEjbClassSymbol() == null) {
          lookForIt = true;
                    } else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_HOME)) {
          lookForIt = true;
          // if empty String PASS
            } else if (methodDescriptor.getEjbClassSymbol().equals("")) {
          lookForIt = true;
            }else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCALHOME)) {
          lookForIt = true;
            } else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_REMOTE)) {
          lookForIt = false;
            } else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCAL)) {
          lookForIt = false;
          // else (Bogus)
            } else {
          // carry on & don't look for
          // container transaction
          lookForIt = false;
            }                       
        } else if (methodDescriptor.getParameterClassNames() == null) {
                       
            // if (getEjbClassSybol() is Home or is the empty String AND if methods[i].getName().equals(methodDescriptor.getName())
            if (((methodDescriptor.getEjbClassSymbol() == null) ||
           methodDescriptor.getEjbClassSymbol().equals("") ||
           methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_HOME)||
           methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCALHOME)) &&
          (methods[i].getName().equals(methodDescriptor.getName()))) {
          //  PASS
          lookForIt = true;
            } else {
          // carry on
          lookForIt = false;
            }                       
        } else {
           
            // if (getEjbClassSybol() is Home or is the empty String AND if methods[i].getName().equals(methodDescriptor.getName()) AND
            // the parameters of the method[i] are the same as the parameters of the method descriptor )
           
            if (((methodDescriptor.getEjbClassSymbol() == null) ||
           methodDescriptor.getEjbClassSymbol().equals("") ||
           methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_HOME)||
           methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCALHOME)) &&
          (methods[i].getName().equals(methodDescriptor.getName())) &&
          (MethodUtils.stringArrayEquals(methodDescriptor.getParameterClassNames(), (new MethodDescriptor(methods[i], methodIntf)).getParameterClassNames()))) {
          // PASS     
          lookForIt = true;
            } else {
          // CARRY ON
          lookForIt = false;
            }
           
        }
       
        if (lookForIt) {
            containerTransaction =
          (ContainerTransaction) descriptor.getMethodContainerTransactions().get(methodDescriptor);                       
            if (containerTransaction != null) {
          String transactionAttribute  =
              containerTransaction.getTransactionAttribute();
         
          // danny is doing this in the DOL, but is it possible to not have
          // any value for containerTransaction.getTransactionAttribute()
          // in the DOL? if it is possible to have blank value for this,
          // then this check is needed here, otherwise we are done and we
View Full Code Here

        // attribute for ejbTimeout

        if( descriptor.isTimedObject() &&
            (method.getName()).equals("ejbTimeout") )
          continue;
        ContainerTransaction txAttr = descriptor.
          getContainerTransactionFor(method);
        if(txAttr == null)
        {
            if(getVerifierContext().getJavaEEVersion().compareTo(SpecVersionMapper.JavaEEVersion_5)<0) {
          // transaction attribute is not specified for method.
          addErrorDetails(result, compName);
          result.failed(smh.getLocalString
              (getClass().getName()+".failed4",
               "Error : Message-driven bean [ {0} ] method definition [ {1} ] does not have a valid container transaction descriptor.",
               new Object[] {descriptor.getName(), method.getName()}));                                
            } // default transaction attr in EJB 3.0 is REQUIRED
          continue;
        }
        String ta = txAttr.getTransactionAttribute();
        if (ContainerTransaction.REQUIRED.equals(ta) ||
            ContainerTransaction.NOT_SUPPORTED.equals(ta)) {
          addGoodDetails(result, compName);
          result.passed(smh.getLocalString
              (getClass().getName()+".passed",
View Full Code Here

       boolean lookForIt = false;
      
       for (int i = 0; i < componentInterfaceMethods.length; i++) {
               if (Arrays.binarySearch(EJBObjectMethods, componentInterfaceMethods[i].getName()) < 0) {
         try {
       ContainerTransaction containerTransaction = null;
       boolean resolved = false;
/*
                         // This flag is a workaround introduced by Harminder
                         // because currently methodDescriptor.getEjbClassSymbol() is
                         // returning NULL
                         //boolean allMethods = false;
                         boolean wildCardWasPresent = false;
*/
                        
       if (!descriptor.getMethodContainerTransactions().isEmpty()) {
           for (Enumeration ee = descriptor.getMethodContainerTransactions().keys(); ee.hasMoreElements();) {
        lookForIt = false;
        MethodDescriptor methodDescriptor = (MethodDescriptor) ee.nextElement();

    /*** Fixed the bug: 4883730. ejbClassSymbol is null when method-intf is not
     * defined in the xml, since it is an optional field. Removed the earlier
     * checks. A null method-intf indicates that the method is supposed to be
     * in both Local & Home interfaces. ***/                   
/*
                                // This code is a workaround introduced by Harminder
                                // because currently methodDescriptor.getEjbClassSymbol() is
                                // returning NULL
                                String methodIntf = null;
                                try {
                                    methodIntf = methodDescriptor.getEjbClassSymbol();
                                } catch ( Exception ex ) {}
                                if ( methodIntf == null ) { //|| methodIntf.equals("")
                                    //probably a wildcard was there
                                    wildCardWasPresent = true;
                                    continue;
                                }
                                 //allMethods = true;
                                 // end of workaround
*/
                                
         // here we have to check that each method descriptor
         // corresponds to a or some methods on the component interface
         // according to the six styles
         // style 1)
                 if (methodDescriptor.getName().equals(MethodDescriptor.ALL_EJB_METHODS)) {
             // if getEjbClassName() is Remote -> CARRY ON
             // if Remote - PASS
                     if (methodDescriptor.getEjbClassSymbol() == null) {
           lookForIt = true;
                     } else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_REMOTE)) {
           lookForIt = true;
           // if empty String PASS
             } else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCAL)) {
           lookForIt = true;
             }else if (methodDescriptor.getEjbClassSymbol().equals("")) {
           lookForIt = true;
             } else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_HOME)) {
           lookForIt = false;
             else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCALHOME)) {
           lookForIt = false;
             }else {
           // carry on & don't look for
           // container transaction
           lookForIt = false;
             }
            
            
         } else if (methodDescriptor.getParameterClassNames() == null) {
            
            
             // if (getEjbClassSybol() is Remote or is the empty String AND if componentInterfaceMethods[i].getName().equals(methodDescriptor.getName())
             if (((methodDescriptor.getEjbClassSymbol() == null) ||
            methodDescriptor.getEjbClassSymbol().equals("") ||
            methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_REMOTE)||
            methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCAL)) &&
           (componentInterfaceMethods[i].getName().equals(methodDescriptor.getName()))) {
           //  PASS
           lookForIt = true;
             } else {
           // carry on
           lookForIt = false;
             }
            
            
         } else {
            
             // if (getEjbClassSybol() is Remote or is the empty String AND if componentInterfaceMethods[i].getName().equals(methodDescriptor.getName()) AND
             // the parameters of the method[i] are the same as the parameters of the method descriptor )
            
             if (((methodDescriptor.getEjbClassSymbol() == null) ||
            methodDescriptor.getEjbClassSymbol().equals("") ||
            methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_REMOTE)||
            methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCAL))&&
           (componentInterfaceMethods[i].getName().equals(methodDescriptor.getName()))&&
           (MethodUtils.stringArrayEquals(methodDescriptor.getParameterClassNames(), (new MethodDescriptor(componentInterfaceMethods[i], methodIntf)).getParameterClassNames()))) {
           // PASS     
           lookForIt = true;
             } else {
           // CARRY ON
           lookForIt = false;
             }
            
         }
        
         if (lookForIt) {
             containerTransaction =
           (ContainerTransaction) descriptor.getMethodContainerTransactions().get(methodDescriptor);
             if (containerTransaction != null) {
           String transactionAttribute  =
               containerTransaction.getTransactionAttribute();
          
           // danny is doing this in the DOL, but is it possible to not have
           // any value for containerTransaction.getTransactionAttribute()
           // in the DOL? if it is possible to have blank value for this,
           // then this check is needed here, otherwise we are done and we
View Full Code Here

      boolean lookForIt = false;
     
      for (int i=0; i< methods.length; i++) {
    if (Arrays.binarySearch(EJBObjectMethods, methods[i].getName()) < 0) {
                    try {
      ContainerTransaction containerTransaction = null;
      boolean resolved = false;
/*
                        // This flag is a workaround introduced by Harminder
                        // because currently methodDescriptor.getEjbClassSymbol() is
                        // returning NULL
                        //boolean allMethods = false;
                        boolean wildCardWasPresent = false;
*/

      if (!descriptor.getMethodContainerTransactions().isEmpty()) {
          for (Enumeration ee = descriptor.getMethodContainerTransactions().keys(); ee.hasMoreElements();) {
        lookForIt = false;
       
        MethodDescriptor methodDescriptor = (MethodDescriptor) ee.nextElement();
    /*** Fixed the bug: 4883730. ejbClassSymbol is null when method-intf is not
     * defined in the xml, since it is an optional field. Removed the earlier
     * checks. A null method-intf indicates that the method is supposed to be
     * in both Local & Home interfaces. ***/                   
/*
                                // This code is a workaround introduced by Harminder
                                // because currently methodDescriptor.getEjbClassSymbol() is
                                // returning NULL
                                String methodIntf = null;
                                try {
                                    methodIntf = methodDescriptor.getEjbClassSymbol();
                                } catch ( Exception ex ) {}
                                if ( methodIntf == null ) { //|| methodIntf.equals("")
                                    //probably a wildcard was there
                                    wildCardWasPresent = true;
                                    continue;
                                }
                                 //allMethods = true;
                                 // end of workaround
*/
                               
       
        // here we have to check that each method descriptor
        // corresponds to a or some methods on the home interface
        // according to the six styles
        // style 1)
                 if (methodDescriptor.getName().equals(MethodDescriptor.ALL_EJB_METHODS)) {
            // if getEjbClassName() is Remote -> CARRY ON
            // if Home - PASS
                    if (methodDescriptor.getEjbClassSymbol() == null) {
          lookForIt = true;
                    } else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_HOME)) {
          lookForIt = true;
          // if empty String PASS
            } else if (methodDescriptor.getEjbClassSymbol().equals("")) {
          lookForIt = true;
            }else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCALHOME)) {
          lookForIt = true;
            } else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_REMOTE)) {
          lookForIt = false;
            } else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCAL)) {
          lookForIt = false;
          // else (Bogus)
            } else {
          // carry on & don't look for
          // container transaction
          lookForIt = false;
            }                       
        } else if (methodDescriptor.getParameterClassNames() == null) {
                       
            // if (getEjbClassSybol() is Home or is the empty String AND if methods[i].getName().equals(methodDescriptor.getName())
            if (((methodDescriptor.getEjbClassSymbol() == null) ||
           methodDescriptor.getEjbClassSymbol().equals("") ||
           methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_HOME)||
           methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCALHOME)) &&
          (methods[i].getName().equals(methodDescriptor.getName()))) {
          //  PASS
          lookForIt = true;
            } else {
          // carry on
          lookForIt = false;
            }                       
        } else {
           
            // if (getEjbClassSybol() is Home or is the empty String AND if methods[i].getName().equals(methodDescriptor.getName()) AND
            // the parameters of the method[i] are the same as the parameters of the method descriptor )
           
            if (((methodDescriptor.getEjbClassSymbol() == null) ||
           methodDescriptor.getEjbClassSymbol().equals("") ||
           methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_HOME)||
           methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCALHOME)) &&
          (methods[i].getName().equals(methodDescriptor.getName())) &&
          (MethodUtils.stringArrayEquals(methodDescriptor.getParameterClassNames(), (new MethodDescriptor(methods[i], methodIntf)).getParameterClassNames()))) {
          // PASS     
          lookForIt = true;
            } else {
          // CARRY ON
          lookForIt = false;
            }
           
        }
       
        if (lookForIt) {
            containerTransaction =
          (ContainerTransaction) descriptor.getMethodContainerTransactions().get(methodDescriptor);                       
            if (containerTransaction != null) {
          String transactionAttribute  =
              containerTransaction.getTransactionAttribute();
         
          // danny is doing this in the DOL, but is it possible to not have
          // any value for containerTransaction.getTransactionAttribute()
          // in the DOL? if it is possible to have blank value for this,
          // then this check is needed here, otherwise we are done and we
View Full Code Here

      boolean lookForIt = false;
      for (int i = 0; i < componentInterfaceMethods.length; i++) {
    if (Arrays.binarySearch(EJBObjectMethods, componentInterfaceMethods[i].getName()) < 0) {
       
        try  {
      ContainerTransaction containerTransaction = null;
      boolean resolved = false;
/*
                        // This flag is a workaround introduced by Harminder
                        // because currently methodDescriptor.getEjbClassSymbol() is
                        // returning NULL
                        //boolean allMethods = false;
                        boolean wildCardWasPresent = false;
*/
                       
      if (!descriptor.getMethodContainerTransactions().isEmpty()) {
         
          for (Enumeration ee = descriptor.getMethodContainerTransactions().keys(); ee.hasMoreElements();) {
        lookForIt = false;
                               
        MethodDescriptor methodDescriptor = (MethodDescriptor) ee.nextElement();

    /*** Fixed the bug: 4883730. ejbClassSymbol is null when method-intf is not
     * defined in the xml, since it is an optional field. Removed the earlier
     * checks. A null method-intf indicates that the method is supposed to be
     * in both Local & Home interfaces. ***/                   
/*
                                String methodIntf = null;
                                try {
                                    methodIntf = methodDescriptor.getEjbClassSymbol();
                                } catch ( Exception ex ) {}
                                if ( methodIntf == null ) { //|| methodIntf.equals("")
                                    //probably a wildcard was there
                                    wildCardWasPresent = true;
                                    continue;
                                }
                                //allMethods = true;
                                // end of workaround
*/
                               
        // here we have to check that each method descriptor
        // corresponds to a or some methods on the component interface
        // according to the six styles
        // style 1)
        if (methodDescriptor.getName().equals(MethodDescriptor.ALL_EJB_METHODS)) {
            // if getEjbClassName() is Remote -> CARRY ON
            // if Remote - PASS
            if (methodDescriptor.getEjbClassSymbol() == null) {
                        lookForIt = true;
                    } else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_REMOTE)||
          methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCAL)) {
          lookForIt = true;
          // if empty String PASS
            } else if (methodDescriptor.getEjbClassSymbol().equals("")) {
          lookForIt = true;
            } else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_HOME)||
                 methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCALHOME)) {
          lookForIt = false;
          // else (Bogus)
            } else {
          // carry on & don't look for
          // container transaction
          lookForIt = false;
            }
           
           
        } else if (methodDescriptor.getParameterClassNames() == null) {
           
           
            // if (getEjbClassSybol() is Remote or is the empty String AND if componentInterfaceMethods[i].getName().equals(methodDescriptor.getName())
            if (((methodDescriptor.getEjbClassSymbol() == null) ||
             methodDescriptor.getEjbClassSymbol().equals("") ||
           methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_REMOTE) ||
           methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCAL)) &&
          (componentInterfaceMethods[i].getName().equals(methodDescriptor.getName()))) {
          //  PASS
          lookForIt = true;
            } else {
          // carry on
          lookForIt = false;
            }
           
           
        } else {
           
            // if (getEjbClassSybol() is Remote or is the empty String AND if componentInterfaceMethods[i].getName().equals(methodDescriptor.getName()) AND
            // the parameters of the method[i] are the same as the parameters of the method descriptor )
           
            if (((methodDescriptor.getEjbClassSymbol() == null) ||
             methodDescriptor.getEjbClassSymbol().equals("") ||
           methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_REMOTE)||
           methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCAL)) &&
          (componentInterfaceMethods[i].getName().equals(methodDescriptor.getName())) &&
          (MethodUtils.stringArrayEquals(methodDescriptor.getParameterClassNames(), (new MethodDescriptor(componentInterfaceMethods[i], methodIntf)).getParameterClassNames()))) {
          // PASS     
          lookForIt = true;
            } else {
          // CARRY ON
          lookForIt = false;
            }
           
        }
       
        if (lookForIt) {
            containerTransaction =
          (ContainerTransaction) descriptor.getMethodContainerTransactions().get(methodDescriptor);                                  
            if (containerTransaction != null) {
          String transactionAttribute  =
              containerTransaction.getTransactionAttribute();
         
          // danny is doing this in the DOL, but is it possible to not have
          // any value for containerTransaction.getTransactionAttribute()
          // in the DOL? if it is possible to have blank value for this,
          // then this check is needed here, otherwise we are done and we
View Full Code Here

      Class c = Class.forName(home, false, getVerifierContext().getClassLoader());
      Method methods[] = c.getDeclaredMethods();
      boolean lookForIt = false;
      for (int i=0; i< methods.length; i++) {
    try  {
        ContainerTransaction containerTransaction = null;
        boolean resolved = true;
/*
                     // This flag is a workaround introduced by Harminder
                     // because currently methodDescriptor.getEjbClassSymbol() is
                     // returning NULL
                     //boolean allMethods = false;
                     boolean wildCardWasPresent = false;
*/

        if (!descriptor.getMethodContainerTransactions().isEmpty()) {
      for (Enumeration ee = descriptor.getMethodContainerTransactions().keys(); ee.hasMoreElements();) {
          lookForIt = false;
          MethodDescriptor methodDescriptor = (MethodDescriptor) ee.nextElement();

    /*** Fixed the bug: 4883730. ejbClassSymbol is null when method-intf is not
     * defined in the xml, since it is an optional field. Removed the earlier
     * checks. A null method-intf indicates that the method is supposed to be
     * in both Local & Home interfaces. ***/                   
/*
                            String methodIntf = null;
                            try {
                                methodIntf = methodDescriptor.getEjbClassSymbol();
                            } catch ( Exception ex ) {}
                            if ( methodIntf == null ) { //|| methodIntf.equals("")
                                //probably a wildcard was there
                                wildCardWasPresent = true;
                                continue;
                            }
                            //allMethods = true;
                            // end of workaround
*/

                           
          // here we have to check that each method descriptor
          // corresponds to a or some methods on the home interface
          // according to the six styles
          // style 1)
          if (methodDescriptor.getName().equals(MethodDescriptor.ALL_EJB_METHODS)) {
        // if getEjbClassName() is Remote -> CARRY ON
        // if Home - PASS
        if (methodDescriptor.getEjbClassSymbol() == null) {
                    lookForIt = true;
                } else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_HOME)) {
            lookForIt = true;
            // if empty String PASS
        } else if (methodDescriptor.getEjbClassSymbol().equals("")) {
            lookForIt = true;
        } else if (methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_REMOTE)) {
            lookForIt = false;
            // else (Bogus)
        } else {
            // carry on & don't look for
            // container transaction
            lookForIt = false;
        }               
          } else if (methodDescriptor.getParameterClassNames() == null) {
        // if (getEjbClassSybol() is Home or is the empty String AND if methods[i].getName().equals(methodDescriptor.getName())
        if (((methodDescriptor.getEjbClassSymbol() == null) ||
             methodDescriptor.getEjbClassSymbol().equals("") ||
             methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_HOME)||
             methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCALHOME)) &&
            (methods[i].getName().equals(methodDescriptor.getName()))) {
            //  PASS
            lookForIt = true;
        } else {
            // carry on
            lookForIt = false;
        }               
          } else {       
        // if (getEjbClassSybol() is Home or is the empty String AND if methods[i].getName().equals(methodDescriptor.getName()) AND
        // the parameters of the method[i] are the same as the parameters of the method descriptor )        
        if (((methodDescriptor.getEjbClassSymbol() == null) ||
             methodDescriptor.getEjbClassSymbol().equals("") ||
             methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_HOME)||
             methodDescriptor.getEjbClassSymbol().equals(MethodDescriptor.EJB_LOCALHOME)) &&
            (methods[i].getName().equals(methodDescriptor.getName())) &&
            (MethodUtils.stringArrayEquals(methodDescriptor.getParameterClassNames(), (new MethodDescriptor(methods[i], methodIntf)).getParameterClassNames()))) {
            // PASS     
            lookForIt = true;
        } else {
            // CARRY ON
            lookForIt = false;
        }       
          }
         
          if (lookForIt) {
        containerTransaction =
            (ContainerTransaction) descriptor.getMethodContainerTransactions().get(methodDescriptor);       
       
        if (containerTransaction != null) {
            String transactionAttribute  =
          containerTransaction.getTransactionAttribute();
           
            // danny is doing this in the DOL, but is it possible to not have
            // any value for containerTransaction.getTransactionAttribute()
            // in the DOL? if it is possible to have blank value for this,
            // then this check is needed here, otherwise we are done and we
View Full Code Here

        if (wsdescriptor.implementedByEjbComponent()) {

          EjbDescriptor descriptor = (EjbDescriptor) wsdescriptor.getEjbComponentImpl();

    try  {
             ContainerTransaction ctx = descriptor.getContainerTransaction();

             if ((ctx != null) &&
                 (ContainerTransaction.MANDATORY.equals(ctx.getTransactionAttribute()))) {
                 // Call result.failed here : All methods are having Mandatory TX
                  result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor",
                                   "For [ {0} ]", new Object[] {compName.toString()}));
                  result.failed(smh.getLocalString (getClass().getName() + ".failed",
                  "[{0}] of this WebService [{1}] have Mandatory Transaction Attribute.",
                  new Object[] {"All the methods", compName.toString()}));

                 return result;
             }

             Collection txMethDescs = descriptor.getTransactionMethodDescriptors();

             // get hold of the SEI Class
             String s = descriptor.getWebServiceEndpointInterfaceName();

             if (s == null) {
               // internal error, should never happen
                result.addErrorDetails(smh.getLocalString
               ("com.sun.enterprise.tools.verifier.tests.webservices.Error",
                "Error: Unexpected error occurred [ {0} ]",
                new Object[] {"Service Endpoint Interface Class Name Null"}));
                pass = false;
            
             ClassLoader cl = getVerifierContext().getClassLoader();
             Class sei = null;

             try {
                sei = Class.forName(s, false, cl);
             }catch(ClassNotFoundException e) {
               result.addErrorDetails(smh.getLocalString
               ("com.sun.enterprise.tools.verifier.tests.webservices.Error",
                "Error: Unexpected error occurred [ {0} ]",
                new Object[] {"Could not Load Service Endpoint Interface Class"}));
                pass = false;
             }

             Iterator it = txMethDescs.iterator();
             while (it.hasNext()) {
               // need to check if this method is part of SEI
               MethodDescriptor methdesc =(MethodDescriptor)it.next();
              if (isSEIMethod(methdesc, descriptor, sei, cl)) {
                  ctx = descriptor.getContainerTransactionFor(methdesc);
                  if ((ctx != null) &&
                     (ContainerTransaction.MANDATORY.equals(ctx.getTransactionAttribute()))) {
                     // Call result.failed here with Method details here
                     result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor",
                                   "For [ {0} ]", new Object[] {compName.toString()}));
                     result.failed(smh.getLocalString (getClass().getName() + ".failed",
                     "[{0}] of this WebService [{1}] have Mandatory Transaction Attribute.",
View Full Code Here

                boolean oneFailed = false;
    String transactionType = descriptor.getTransactionType();
    if (EjbDescriptor.CONTAINER_TRANSACTION_TYPE.equals(transactionType)) {
        try  {
                        Arrays.sort(EJBObjectMethods);
      ContainerTransaction containerTransaction = null;
                        if (!descriptor.getMethodContainerTransactions().isEmpty()) {
                            for (Enumeration ee = descriptor.getMethodContainerTransactions().keys(); ee.hasMoreElements();) {
                                MethodDescriptor methodDescriptor = (MethodDescriptor) ee.nextElement();
        if (Arrays.binarySearch(EJBObjectMethods, methodDescriptor.getName()) < 0) {
            containerTransaction =
                                                (ContainerTransaction) descriptor.getMethodContainerTransactions().get(methodDescriptor);
               
                    if (containerTransaction != null &&
                            containerTransaction.getTransactionAttribute()!=null) {
              String transactionAttribute  =
                  containerTransaction.getTransactionAttribute();
         
              // danny is doing this in the DOL, but is it possible to not have
              // any value for containerTransaction.getTransactionAttribute()
              // in the DOL? if it is possible to have blank value for this,
              // then this check is needed here, otherwise we are done and we
View Full Code Here

      // enterprise bean with bean-managed transaction demarcation.
      if ((descriptor instanceof EjbSessionDescriptor) ||
    (descriptor instanceof EjbEntityDescriptor)) {
    String transactionType = descriptor.getTransactionType();
    if (EjbDescriptor.BEAN_TRANSACTION_TYPE.equals(transactionType)) {
        ContainerTransaction containerTransaction = null;
                    if (!descriptor.getMethodContainerTransactions().isEmpty()) {
                        for (Enumeration ee = descriptor.getMethodContainerTransactions().keys(); ee.hasMoreElements();) {
          MethodDescriptor methodDescriptor = (MethodDescriptor) ee.nextElement();
                            containerTransaction =
                                                (ContainerTransaction) descriptor.getMethodContainerTransactions().get(methodDescriptor);
         
          try {
        String transactionAttribute  =
            containerTransaction.getTransactionAttribute();
   
        // danny is doing this in the DOL, but is it possible to not have
        // any value for containerTransaction.getTransactionAttribute()
        // in the DOL? if it is possible to have blank value for this,
        // then this check is needed here, otherwise we are done and we
View Full Code Here

TOP

Related Classes of org.glassfish.ejb.deployment.descriptor.ContainerTransaction

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.