Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.MethodDescriptor


      PrefetchDisabledDescriptor pdDescriptor =
        cmpDescriptor.getPrefetchDisabledDescriptor();

      if (pdDescriptor != null)
      {
        MethodDescriptor methodDescriptor =
          queryDescriptor.getQueryMethodDescriptor();

        enabled = !pdDescriptor.isPrefetchDisabledFor(
          methodDescriptor);
      }
View Full Code Here


    }

    private void convertStyleCheckpointedMethods() {
        Set allMethods = ejbDescriptor.getMethodDescriptors();
        for (Iterator mdItr = methodDescs.iterator(); mdItr.hasNext();) {
            MethodDescriptor methodDesc = (MethodDescriptor) mdItr.next();

            // the ejb-name element defined in the method element will
            // be always ignored and overriden by the one defined in
            // ejb element
            methodDesc.setEjbName(ejbDescriptor.getName());

            // Convert to style 3 method descriptors
            Vector mds =
                methodDesc.doStyleConversion(ejbDescriptor, allMethods);
            convertedMethodDescs.addAll(mds);
        }
    }
View Full Code Here

    }

    private void convertStylePrefetchDisabledMethods() {
        Set allMethods = ejbDescriptor.getMethodDescriptors();
        for (Iterator mdItr = methodDescs.iterator(); mdItr.hasNext();) {
            MethodDescriptor methodDesc = (MethodDescriptor) mdItr.next();
            // the ejb-name element defined in the method element will
            // be always ignored and overriden by the one defined in
            // ejb element
            methodDesc.setEjbName(ejbDescriptor.getName());

            // Convert to style 3 method descriptors
            Vector mds = methodDesc.doStyleConversion(ejbDescriptor, allMethods);
            convertedMethodDescs.addAll(mds);
        }
    }
View Full Code Here

    }

    private void convertStyleFlushedMethods() {
        Set allMethods = ejbDescriptor.getMethodDescriptors();
        for (Iterator mdItr = methodDescs.iterator(); mdItr.hasNext();) {
            MethodDescriptor methodDesc = (MethodDescriptor) mdItr.next();
            // the ejb-name element defined in the method element will
            // be always ignored and overriden by the one defined in
            // ejb element
            methodDesc.setEjbName(ejbDescriptor.getName());

            // Convert to style 3 method descriptors
            Vector mds = methodDesc.doStyleConversion(ejbDescriptor, allMethods);
            convertedMethodDescs.addAll(mds);
        }
    }
View Full Code Here

            Class c = classLoader.loadClass(serviceInterfaceName);
            Method[] methods = c.getMethods();
            for (int i = 0; i < methods.length; i++) {
                // empty message or message name is *
                if (methodName.equals(ALL_METHODS)) {
                    allMethodsInSEI.add(new MethodDescriptor(methods[i]));
                // overloading methods with same method name
                } else if (methodName.equals(methods[i].getName())) {
                    allMethodsInSEI.add(new MethodDescriptor(methods[i]));
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            // if there is exception in the class loading
View Full Code Here

      ArrayList mDs = msd.getMessageDescriptors();

      for (int j=0; mDs != null && j < mDs.size(); j++) {
   
    MessageDescriptor mD = (MessageDescriptor) mDs.get(j);
    MethodDescriptor methD = mD.getMethodDescriptor();

    // if any msd covers all methods and operations.
    if ((mD.getOperationName() == null && methD == null) ||
                        (methD != null && methD.getStyle() == 1)) {

        if (onePolicy_) {
      // if there is only one policy make it the default.
      defaultContext_ = contexts_.get(i);
      if (defaultContext_ == null) {
View Full Code Here

  }

  for (int i=0; i<messageDescriptors.size(); i++) {
      MessageDescriptor nextMD =
    (MessageDescriptor) messageDescriptors.get(i);
      MethodDescriptor mD = nextMD.getMethodDescriptor();
      String opName = nextMD.getOperationName();

      if (opName == null && (mD == null || mD.implies(targetMD))){
    return true;
      }
  }

  return false;
View Full Code Here

    return rvalue;
      }
  }
  if (m != null) {
      int match = -1;
      MethodDescriptor targetMD = new MethodDescriptor(m);
      for (int i = 0; i < messageSecurityDescriptors_.size(); i++) {
    if (isMatchingMSD(targetMD,(MessageSecurityDescriptor)
          messageSecurityDescriptors_.get(i))) {
        if (match < 0) {
      match = i;
View Full Code Here

     */
    public void createSchedulesOnServer(EjbDescriptor ejbDescriptor, String server_name) {
        Map<MethodDescriptor, List<ScheduledTimerDescriptor>> schedules =
                new HashMap<MethodDescriptor, List<ScheduledTimerDescriptor>>();
        for (ScheduledTimerDescriptor schd : ejbDescriptor.getScheduledTimerDescriptors()) {
            MethodDescriptor method = schd.getTimeoutMethod();
            if (method != null && schd.getPersistent()) {
                if( logger.isLoggable(Level.FINE) ) {
                    logger.log(Level.FINE, "... processing " + method );
                }

View Full Code Here

*/
                        
       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
           // don't need this check here
           if (ContainerTransaction.NOT_SUPPORTED.equals(transactionAttribute)
               || ContainerTransaction.SUPPORTS.equals(transactionAttribute)
               || ContainerTransaction.REQUIRED.equals(transactionAttribute)
               || ContainerTransaction.REQUIRES_NEW.equals(transactionAttribute)
               || ContainerTransaction.MANDATORY.equals(transactionAttribute)
               || ContainerTransaction.NEVER.equals(transactionAttribute)
               || (!transactionAttribute.equals(""))) {
               addGoodDetails(result, compName);
               result.addGoodDetails(smh.getLocalString
                   (getClass().getName() + ".passed",
                    "Valid: [ {0} ] TransactionAttribute [ {1} ] for method [ {2} ] is valid. Transaction attributes must be defined for all methods except getEJBHome, getHandle, getPrimaryKey, and isIdentical methods of component interface [ {3} ].",
                    new Object[] {componentInterfaceMethods[i].getName(), transactionAttribute, methodDescriptor.getName(),component}));
               resolved = true;
           } else {
               oneFailed = true;
               addErrorDetails(result, compName);
               result.addErrorDetails(smh.getLocalString
                    (getClass().getName() + ".failed",
                     "Error: [ {0} ] TransactionAttribute [ {1} ] for method [ {2} ] is not valid.   Transaction attributes must be defined for all methods except getEJBHome, getHandle, getPrimaryKey, and isIdentical methods of component interface [ {3} ]",
                     new Object[] {componentInterfaceMethods[i].getName(), transactionAttribute, methodDescriptor.getName(),component}));
           }
             } else {
           oneFailed = true;
           addErrorDetails(result, compName);
           result.addErrorDetails(smh.getLocalString
                (getClass().getName() + ".failedException",
                 "Error: TransactionAttribute is null for method [ {0} ]",
                 new Object[] {methodDescriptor.getName()}));
             }      
         }
           }
           // before you go on to the next method,
           // did you resolve the last one okay?
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.MethodDescriptor

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.