Package org.jboss.verifier

Examples of org.jboss.verifier.Section


/*      */   {
/* 2003 */     boolean status = true;
/*      */
/* 2010 */     if (!hasEntityBeanInterface(this.bean))
/*      */     {
/* 2012 */       fireSpecViolationEvent(entity, new Section("12.2.2.a"));
/* 2013 */       status = false;
/*      */     }
/*      */
/* 2020 */     if ((!isPublic(this.bean)) || (isAbstract(this.bean)))
/*      */     {
/* 2022 */       fireSpecViolationEvent(entity, new Section("12.2.2.b"));
/* 2023 */       status = false;
/*      */     }
/*      */
/* 2030 */     if (isFinal(this.bean))
/*      */     {
/* 2032 */       fireSpecViolationEvent(entity, new Section("12.2.2.c"));
/* 2033 */       status = false;
/*      */     }
/*      */
/* 2041 */     if (!hasDefaultConstructor(this.bean))
/*      */     {
/* 2043 */       fireSpecViolationEvent(entity, new Section("12.2.2.d"));
/* 2044 */       status = false;
/*      */     }
/*      */
/* 2051 */     if (hasFinalizer(this.bean))
/*      */     {
/* 2053 */       fireSpecViolationEvent(entity, new Section("12.2.2.e"));
/* 2054 */       status = false;
/*      */     }
/*      */
/* 2069 */     if (hasEJBCreateMethod(this.bean, false))
/*      */     {
/* 2071 */       Iterator it = getEJBCreateMethods(this.bean);
/* 2072 */       while (it.hasNext())
/*      */       {
/* 2074 */         Method ejbCreate = (Method)it.next();
/* 2075 */         if (!isPublic(ejbCreate))
/*      */         {
/* 2077 */           fireSpecViolationEvent(entity, ejbCreate, new Section("12.2.3.a"));
/*      */
/* 2079 */           status = false;
/*      */         }
/*      */
/* 2082 */         if ((isFinal(ejbCreate)) || (isStatic(ejbCreate)))
/*      */         {
/* 2084 */           fireSpecViolationEvent(entity, ejbCreate, new Section("12.2.3.b"));
/*      */
/* 2086 */           status = false;
/*      */         }
/*      */
/* 2089 */         if (!hasPrimaryKeyReturnType(entity, ejbCreate))
/*      */         {
/* 2091 */           fireSpecViolationEvent(entity, ejbCreate, new Section("12.2.3.c"));
/*      */
/* 2093 */           status = false;
/*      */         }
/*      */
/*      */       }
/*      */
/*      */     }
/*      */
/* 2124 */     if (hasEJBCreateMethod(this.bean, false))
/*      */     {
/* 2126 */       Iterator it = getEJBCreateMethods(this.bean);
/* 2127 */       while (it.hasNext())
/*      */       {
/* 2129 */         Method ejbCreate = (Method)it.next();
/*      */
/* 2131 */         if (!hasMatchingEJBPostCreate(this.bean, ejbCreate))
/*      */         {
/* 2133 */           fireSpecViolationEvent(entity, ejbCreate, new Section("12.2.4.a"));
/*      */
/* 2135 */           status = false;
/*      */         }
/*      */
/* 2138 */         if (hasMatchingEJBPostCreate(this.bean, ejbCreate))
/*      */         {
/* 2140 */           Method ejbPostCreate = getMatchingEJBPostCreate(this.bean, ejbCreate);
/*      */
/* 2143 */           if (!isPublic(ejbPostCreate))
/*      */           {
/* 2145 */             fireSpecViolationEvent(entity, ejbPostCreate, new Section("12.2.4.b"));
/*      */
/* 2147 */             status = false;
/*      */           }
/*      */
/* 2150 */           if ((isStatic(ejbPostCreate)) || (isFinal(ejbPostCreate)))
/*      */           {
/* 2152 */             fireSpecViolationEvent(entity, ejbPostCreate, new Section("12.2.4.c"));
/*      */
/* 2154 */             status = false;
/*      */           }
/*      */
/* 2157 */           if (!hasVoidReturnType(ejbPostCreate))
/*      */           {
/* 2159 */             fireSpecViolationEvent(entity, ejbPostCreate, new Section("12.2.4.d"));
/*      */
/* 2161 */             status = false;
/*      */           }
/*      */
/*      */         }
/*      */
/*      */       }
/*      */
/*      */     }
/*      */
/* 2176 */     if (!hasEJBFindByPrimaryKey(this.bean))
/*      */     {
/* 2178 */       fireSpecViolationEvent(entity, new Section("12.2.5.e"));
/* 2179 */       status = false;
/*      */     }
/*      */
/* 2182 */     if (hasEJBFindByPrimaryKey(this.bean))
/*      */     {
/* 2184 */       Method ejbFindByPrimaryKey = getEJBFindByPrimaryKey(this.bean);
/*      */
/* 2186 */       if (!hasPrimaryKeyReturnType(entity, ejbFindByPrimaryKey))
/*      */       {
/* 2188 */         fireSpecViolationEvent(entity, ejbFindByPrimaryKey, new Section("12.2.5.e1"));
/*      */
/* 2190 */         status = false;
/*      */       }
/*      */
/* 2193 */       if (!isSingleObjectFinder(entity, ejbFindByPrimaryKey))
/*      */       {
/* 2195 */         fireSpecViolationEvent(entity, ejbFindByPrimaryKey, new Section("12.2.5.e2"));
/*      */
/* 2197 */         status = false;
/*      */       }
/*      */
/*      */     }
/*      */
/* 2216 */     if (hasFinderMethod(this.bean))
/*      */     {
/* 2218 */       Iterator it = getEJBFindMethods(this.bean);
/* 2219 */       while (it.hasNext())
/*      */       {
/* 2221 */         Method finder = (Method)it.next();
/*      */
/* 2223 */         if (!isPublic(finder))
/*      */         {
/* 2225 */           fireSpecViolationEvent(entity, finder, new Section("12.2.5.a"));
/* 2226 */           status = false;
/*      */         }
/*      */
/* 2229 */         if ((isFinal(finder)) || (isStatic(finder)))
/*      */         {
/* 2231 */           fireSpecViolationEvent(entity, finder, new Section("12.2.5.b"));
/* 2232 */           status = false;
/*      */         }
/*      */
/* 2244 */         if ((!isSingleObjectFinder(entity, finder)) && (!isMultiObjectFinder(finder)))
/*      */         {
/* 2247 */           fireSpecViolationEvent(entity, finder, new Section("12.2.5.d"));
/* 2248 */           status = false;
/*      */         }
/*      */
/*      */       }
/*      */
/*      */     }
/*      */
/* 2262 */     Iterator it = getEjbHomeMethods(this.bean);
/* 2263 */     while (it.hasNext())
/*      */     {
/* 2265 */       Method ejbHome = (Method)it.next();
/*      */
/* 2267 */       if (!isPublic(ejbHome))
/*      */       {
/* 2269 */         fireSpecViolationEvent(entity, ejbHome, new Section("10.6.6.a"));
/* 2270 */         status = false;
/*      */       }
/*      */
/* 2273 */       if (isStatic(ejbHome))
/*      */       {
/* 2275 */         fireSpecViolationEvent(entity, ejbHome, new Section("10.6.6.b"));
/* 2276 */         status = false;
/*      */       }
/*      */
/* 2279 */       if (throwsRemoteException(ejbHome))
/*      */       {
/* 2281 */         fireSpecViolationEvent(entity, ejbHome, new Section("10.6.6.c"));
/* 2282 */         status = false;
/*      */       }
/*      */     }
/*      */
/* 2286 */     return status;
View Full Code Here


/* 2295 */     boolean cmp = entity.isCMP();
/*      */
/* 2297 */     if ((entity.getPrimaryKeyClass() == null) || (entity.getPrimaryKeyClass().length() == 0))
/*      */     {
/* 2300 */       if (cmp)
/* 2301 */         fireSpecViolationEvent(entity, new Section("10.6.1.a"));
/*      */       else {
/* 2303 */         fireSpecViolationEvent(entity, new Section("12.2.1.a"));
/*      */       }
/*      */
/* 2306 */       return false;
/*      */     }
/*      */
/* 2314 */     Class cls = null;
/*      */     try
/*      */     {
/* 2317 */       cls = this.classloader.loadClass(entity.getPrimaryKeyClass());
/*      */     }
/*      */     catch (ClassNotFoundException e)
/*      */     {
/* 2321 */       if (cmp)
/* 2322 */         fireSpecViolationEvent(entity, new Section("10.6.13.a"));
/*      */       else {
/* 2324 */         fireSpecViolationEvent(entity, new Section("12.2.12.a"));
/*      */       }
/*      */
/* 2327 */       return false;
/*      */     }
/*      */
/* 2334 */     if (!isRMIIDLValueType(cls))
/*      */     {
/* 2336 */       if (cmp)
/* 2337 */         fireSpecViolationEvent(entity, new Section("10.6.13.b"));
/*      */       else
/* 2339 */         fireSpecViolationEvent(entity, new Section("12.2.12.b"));
/* 2340 */       status = false;
/*      */     }
/*      */
/* 2344 */     if ((entity.getPrimKeyField() == null) || (entity.getPrimKeyField().length() == 0))
/*      */     {
/* 2351 */       if (!cls.getName().equals("java.lang.Object"))
/*      */       {
/*      */         try
/*      */         {
/* 2357 */           Object one = cls.newInstance();
/* 2358 */           Object two = cls.newInstance();
/*      */           try
/*      */           {
/* 2361 */             if (!one.equals(two))
/*      */             {
/* 2363 */               if (cmp)
/*      */               {
/* 2366 */                 log.warn("Default instances of primary key: " + cls + " do not equate, check your equals method");
/*      */               }
/*      */               else
/*      */               {
/* 2372 */                 log.warn("Default instances of primary key: " + cls + " do not equate, check your equals method");
/*      */               }
/*      */
/* 2375 */               status = true;
/*      */             }
/*      */
/*      */           }
/*      */           catch (NullPointerException e)
/*      */           {
/*      */           }
/*      */
/*      */           try
/*      */           {
/* 2386 */             if (one.hashCode() != two.hashCode())
/*      */             {
/* 2388 */               if (cmp)
/*      */               {
/* 2391 */                 log.warn("Default instances of primary key: " + cls + " do not have the same hash, check your hashCode method");
/*      */               }
/*      */               else
/*      */               {
/* 2397 */                 log.warn("Default instances of primary key: " + cls + " do not have the same hash, check your hashCode method");
/*      */               }
/*      */
/* 2400 */               status = true;
/*      */             }
/*      */
/*      */           }
/*      */           catch (NullPointerException e)
/*      */           {
/*      */           }
/*      */
/*      */         }
/*      */         catch (IllegalAccessException e)
/*      */         {
/* 2413 */           if (cmp)
/*      */           {
/* 2415 */             fireSpecViolationEvent(entity, new Section("10.8.2.a"));
/* 2416 */             status = false;
/*      */           }
/*      */
/*      */         }
/*      */         catch (InstantiationException e)
/*      */         {
/*      */         }
/*      */
/*      */       }
/*      */
/*      */     }
/*      */     else
/*      */     {
/* 2432 */       if (entity.isBMP())
/*      */       {
/* 2434 */         fireSpecViolationEvent(entity, new Section("dd.a"));
/* 2435 */         status = false;
/*      */       }
/*      */
/* 2443 */       boolean found = false;
/* 2444 */       Iterator it = entity.getCMPFields();
/* 2445 */       while (it.hasNext())
/*      */       {
/* 2447 */         String fieldName = (String)it.next();
/* 2448 */         if (fieldName.equals(entity.getPrimKeyField()))
/*      */         {
/* 2450 */           found = true;
/* 2451 */           break;
/*      */         }
/*      */       }
/*      */
/* 2455 */       if (!found)
/*      */       {
/* 2457 */         status = false;
/* 2458 */         fireSpecViolationEvent(entity, new Section("10.8.1.b"));
/*      */       }
/*      */
/*      */       try
/*      */       {
/* 2470 */         String pkField = entity.getPrimKeyField();
/* 2471 */         String methodName = "get" + pkField.substring(0, 1).toUpperCase() + pkField.substring(1);
/*      */
/* 2474 */         Method method = this.bean.getMethod(methodName, new Class[0]);
/* 2475 */         if (!entity.getPrimaryKeyClass().equals(method.getReturnType().getName()))
/*      */         {
/* 2478 */           status = false;
/* 2479 */           fireSpecViolationEvent(entity, new Section("10.8.1.a"));
/*      */         }
/*      */
/*      */       }
/*      */       catch (NoSuchMethodException e)
/*      */       {
/* 2490 */         status = false;
/* 2491 */         fireSpecViolationEvent(entity, new Section("10.8.1.b"));
/*      */       }
/*      */     }
/*      */
/* 2495 */     return status;
/*      */   }
View Full Code Here

/*      */   {
/* 2503 */     boolean status = true;
/*      */
/* 2510 */     if (!hasMessageDrivenBeanInterface(this.bean))
/*      */     {
/* 2512 */       fireSpecViolationEvent(mdBean, new Section("15.7.2.a"));
/* 2513 */       status = false;
/*      */     }
/*      */
/* 2521 */     if (!isAssignableFrom(mdBean.getMessagingType(), this.bean))
/*      */     {
/* 2523 */       fireSpecViolationEvent(mdBean, new Section("15.7.2.b"));
/* 2524 */       status = false;
/*      */     }
/*      */
/* 2531 */     if (!isPublic(this.bean))
/*      */     {
/* 2533 */       fireSpecViolationEvent(mdBean, new Section("15.7.2.c1"));
/* 2534 */       status = false;
/*      */     }
/*      */
/* 2541 */     if (isFinal(this.bean))
/*      */     {
/* 2543 */       fireSpecViolationEvent(mdBean, new Section("15.7.2.c2"));
/* 2544 */       status = false;
/*      */     }
/*      */
/* 2551 */     if (isAbstract(this.bean))
/*      */     {
/* 2553 */       fireSpecViolationEvent(mdBean, new Section("15.7.2.c3"));
/* 2554 */       status = false;
/*      */     }
/*      */
/* 2562 */     if (!hasDefaultConstructor(this.bean))
/*      */     {
/* 2564 */       fireSpecViolationEvent(mdBean, new Section("15.7.2.d"));
/* 2565 */       status = false;
/*      */     }
/*      */
/* 2572 */     if (hasFinalizer(this.bean))
/*      */     {
/* 2574 */       fireSpecViolationEvent(mdBean, new Section("15.7.2.e"));
/* 2575 */       status = false;
/*      */     }
/*      */
/* 2590 */     if (hasEJBCreateMethod(this.bean, false))
/*      */     {
/* 2592 */       Iterator it = getEJBCreateMethods(this.bean);
/* 2593 */       Method ejbCreate = (Method)it.next();
/*      */
/* 2595 */       if (!isPublic(ejbCreate))
/*      */       {
/* 2597 */         fireSpecViolationEvent(mdBean, ejbCreate, new Section("15.7.3.b"));
/* 2598 */         status = false;
/*      */       }
/*      */
/* 2601 */       if ((isFinal(ejbCreate)) || (isStatic(ejbCreate)))
/*      */       {
/* 2603 */         fireSpecViolationEvent(mdBean, ejbCreate, new Section("15.7.3.c"));
/* 2604 */         status = false;
/*      */       }
/*      */
/* 2607 */       if (!hasVoidReturnType(ejbCreate))
/*      */       {
/* 2609 */         fireSpecViolationEvent(mdBean, ejbCreate, new Section("15.7.3.d"));
/* 2610 */         status = false;
/*      */       }
/*      */
/* 2613 */       if (!hasNoArguments(ejbCreate))
/*      */       {
/* 2615 */         fireSpecViolationEvent(mdBean, ejbCreate, new Section("15.7.3.e"));
/* 2616 */         status = false;
/*      */       }
/*      */
/* 2619 */       if (!throwsNoException(ejbCreate))
/*      */       {
/* 2621 */         fireSpecViolationEvent(mdBean, ejbCreate, new Section("15.7.3.f"));
/* 2622 */         status = false;
/*      */       }
/*      */
/* 2625 */       if (it.hasNext())
/*      */       {
/* 2627 */         fireSpecViolationEvent(mdBean, new Section("15.7.3.a"));
/* 2628 */         status = false;
/*      */       }
/*      */     }
/*      */     else
/*      */     {
/* 2633 */       fireSpecViolationEvent(mdBean, new Section("15.7.3.a"));
/* 2634 */       status = false;
/*      */     }
/*      */
/* 2646 */     Class messageListener = null;
/*      */     try
/*      */     {
/* 2649 */       messageListener = this.classloader.loadClass(mdBean.getMessagingType());
/*      */     }
/*      */     catch (ClassNotFoundException cnfe)
/*      */     {
/* 2653 */       fireSpecViolationEvent(mdBean, new Section("15.7.2.b", "Class not found on '" + mdBean.getMessagingType() + "': " + cnfe.getMessage()));
/*      */
/* 2656 */       status = false;
/*      */     }
/*      */
/* 2660 */     if (messageListener != null)
/*      */     {
/* 2662 */       Method[] methods = this.bean.getMethods();
/* 2663 */       for (int i = 0; i < methods.length; i++)
/*      */       {
/* 2665 */         if (!methods[i].getDeclaringClass().equals(messageListener))
/*      */           continue;
/* 2667 */         if (!isPublic(methods[i]))
/*      */         {
/* 2669 */           fireSpecViolationEvent(mdBean, methods[i], new Section("15.7.4.b"));
/* 2670 */           status = false;
/*      */         }
/*      */
/* 2673 */         if ((!isFinal(methods[i])) && (!isStatic(methods[i])))
/*      */           continue;
/* 2675 */         fireSpecViolationEvent(mdBean, methods[i], new Section("15.7.4.c"));
/* 2676 */         status = false;
/*      */       }
/*      */
/*      */     }
/*      */
/* 2694 */     if (hasEJBRemoveMethod(this.bean))
/*      */     {
/* 2696 */       Iterator it = getEJBRemoveMethods(this.bean);
/* 2697 */       Method ejbRemove = (Method)it.next();
/*      */
/* 2699 */       if (!isPublic(ejbRemove))
/*      */       {
/* 2701 */         fireSpecViolationEvent(mdBean, ejbRemove, new Section("15.7.5.b"));
/* 2702 */         status = false;
/*      */       }
/*      */
/* 2705 */       if ((isFinal(ejbRemove)) || (isStatic(ejbRemove)))
/*      */       {
/* 2707 */         fireSpecViolationEvent(mdBean, ejbRemove, new Section("15.7.5.c"));
/* 2708 */         status = false;
/*      */       }
/*      */
/* 2711 */       if (!hasVoidReturnType(ejbRemove))
/*      */       {
/* 2713 */         fireSpecViolationEvent(mdBean, ejbRemove, new Section("15.7.5.d"));
/* 2714 */         status = false;
/*      */       }
/*      */
/* 2717 */       if (!hasNoArguments(ejbRemove))
/*      */       {
/* 2719 */         fireSpecViolationEvent(mdBean, ejbRemove, new Section("15.7.5.e"));
/* 2720 */         status = false;
/*      */       }
/*      */
/* 2723 */       if (!throwsNoException(ejbRemove))
/*      */       {
/* 2725 */         fireSpecViolationEvent(mdBean, ejbRemove, new Section("15.7.5.f"));
/* 2726 */         status = false;
/*      */       }
/*      */
/* 2729 */       if (it.hasNext())
/*      */       {
/* 2731 */         fireSpecViolationEvent(mdBean, new Section("15.7.5.a"));
/* 2732 */         status = false;
/*      */       }
/*      */     }
/*      */     else
/*      */     {
/* 2737 */       fireSpecViolationEvent(mdBean, new Section("15.7.5.a"));
/* 2738 */       status = false;
/*      */     }
/*      */
/* 2741 */     return status;
/*      */   }
View Full Code Here

/*      */   {
/* 2751 */     boolean status = true;
/*      */
/* 2758 */     if (!hasRemoteInterface(this.serviceEndpointInterface))
/*      */     {
/* 2760 */       fireSpecViolationEvent(session, new Section("7.11.9.a"));
/* 2761 */       status = false;
/*      */     }
/*      */
/* 2775 */     Iterator it = Arrays.asList(this.serviceEndpointInterface.getMethods()).iterator();
/* 2776 */     while (it.hasNext())
/*      */     {
/* 2778 */       Method method = (Method)it.next();
/*      */
/* 2780 */       if (!hasLegalJAXRPCArguments(method))
/*      */       {
/* 2782 */         fireSpecViolationEvent(session, method, new Section("7.11.9.b1"));
/* 2783 */         status = false;
/*      */       }
/*      */
/* 2786 */       if (!hasLegalJAXRPCReturnType(method))
/*      */       {
/* 2788 */         fireSpecViolationEvent(session, method, new Section("7.11.9.b2"));
/* 2789 */         status = false;
/*      */       }
/*      */
/* 2792 */       if (!throwsRemoteException(method))
/*      */       {
/* 2794 */         fireSpecViolationEvent(session, method, new Section("7.11.9.b3"));
/* 2795 */         status = false;
/*      */       }
/*      */
/*      */     }
/*      */
/* 2812 */     it = Arrays.asList(this.serviceEndpointInterface.getDeclaredMethods()).iterator();
/* 2813 */     while (it.hasNext())
/*      */     {
/* 2815 */       Method seiMethod = (Method)it.next();
/*      */
/* 2817 */       if (!hasMatchingMethod(this.bean, seiMethod))
/*      */       {
/* 2819 */         fireSpecViolationEvent(session, seiMethod, new Section("7.11.9.c"));
/* 2820 */         status = false;
/*      */       }
/*      */       else
/*      */       {
/*      */         try
/*      */         {
/* 2826 */           Method beanMethod = this.bean.getMethod(seiMethod.getName(), seiMethod.getParameterTypes());
/* 2827 */           if (!hasMatchingReturnType(seiMethod, beanMethod))
/*      */           {
/* 2829 */             fireSpecViolationEvent(session, seiMethod, new Section("7.11.9.c1"));
/* 2830 */             status = false;
/*      */           }
/*      */
/* 2833 */           if (!hasMatchingExceptions(beanMethod, seiMethod))
/*      */           {
/* 2835 */             fireSpecViolationEvent(session, seiMethod, new Section("7.11.59.c2"));
/* 2836 */             status = false;
/*      */           }
/*      */         }
/*      */         catch (NoSuchMethodException ignored)
/*      */         {
View Full Code Here

/*      */     {
/* 2901 */       this.serviceEndpointInterface = this.classloader.loadClass(seiName);
/*      */     }
/*      */     catch (ClassNotFoundException cnfe)
/*      */     {
/* 2905 */       fireSpecViolationEvent(bean, new Section("23.2", "Class not found on '" + seiName + "': " + cnfe.getMessage()));
/*      */
/* 2907 */       status = false;
/*      */     }
/*      */
/* 2910 */     return status;
View Full Code Here

/*      */
/*  184 */       if (session.isStateless())
/*      */       {
/*  186 */         if (!hasDefaultCreateMethod(home))
/*      */         {
/*  188 */           fireSpecViolationEvent(session, new Section("6.8.a"));
/*  189 */           status = false;
/*      */         }
/*      */         else
/*      */         {
/*  193 */           Method create = getDefaultCreateMethod(home);
/*      */
/*  195 */           if (!hasRemoteReturnType(session, create))
/*      */           {
/*  197 */             fireSpecViolationEvent(session, create, new Section("6.8.b"));
/*      */
/*  199 */             status = false;
/*      */           }
/*      */
/*  202 */           if (hasMoreThanOneCreateMethods(home))
/*      */           {
/*  204 */             fireSpecViolationEvent(session, new Section("6.8.c"));
/*  205 */             status = false;
/*      */           }
/*      */
/*      */         }
/*      */
/*      */       }
/*      */
/*  216 */       if (!hasEJBHomeInterface(home))
/*      */       {
/*  218 */         fireSpecViolationEvent(session, new Section("6.10.6.a"));
/*  219 */         status = false;
/*      */       }
/*      */
/*  234 */       Iterator it = Arrays.asList(home.getMethods()).iterator();
/*  235 */       while (it.hasNext())
/*      */       {
/*  237 */         Method method = (Method)it.next();
/*      */
/*  239 */         if (!hasLegalRMIIIOPArguments(method))
/*      */         {
/*  241 */           fireSpecViolationEvent(session, method, new Section("6.10.6.b"));
/*  242 */           status = false;
/*      */         }
/*      */
/*  245 */         if (!hasLegalRMIIIOPReturnType(method))
/*      */         {
/*  247 */           fireSpecViolationEvent(session, method, new Section("6.10.6.c"));
/*  248 */           status = false;
/*      */         }
/*      */
/*  251 */         if (!throwsRemoteException(method))
/*      */         {
/*  253 */           fireSpecViolationEvent(session, method, new Section("6.10.6.d"));
/*  254 */           status = false;
/*      */         }
/*      */
/*      */       }
/*      */
/*  264 */       if (!hasCreateMethod(home))
/*      */       {
/*  266 */         fireSpecViolationEvent(session, new Section("6.10.6.e"));
/*  267 */         status = false;
/*      */       }
/*      */
/*  290 */       Iterator createMethods = getCreateMethods(home);
/*      */       try
/*      */       {
/*  293 */         String beanClass = session.getEjbClass();
/*  294 */         Class bean = this.classloader.loadClass(beanClass);
/*      */
/*  296 */         while (createMethods.hasNext())
/*      */         {
/*  298 */           Method create = (Method)createMethods.next();
/*      */
/*  300 */           if (!hasMatchingEJBCreate(bean, create))
/*      */           {
/*  302 */             fireSpecViolationEvent(session, create, new Section("6.10.6.f"));
/*  303 */             status = false;
/*      */           }
/*      */
/*  306 */           if (!hasRemoteReturnType(session, create))
/*      */           {
/*  308 */             fireSpecViolationEvent(session, create, new Section("6.10.6.g"));
/*  309 */             status = false;
/*      */           }
/*      */
/*  312 */           if (hasMatchingEJBCreate(bean, create))
/*      */           {
/*  314 */             Method ejbCreate = getMatchingEJBCreate(bean, create);
/*      */
/*  316 */             if (!hasMatchingExceptions(ejbCreate, create))
/*      */             {
/*  318 */               fireSpecViolationEvent(session, create, new Section("6.10.6.h"));
/*  319 */               status = false;
/*      */             }
/*      */           }
/*      */
/*  323 */           if (!throwsCreateException(create))
/*      */           {
/*  325 */             fireSpecViolationEvent(session, create, new Section("6.10.6.i"));
/*  326 */             status = false;
/*      */           }
/*      */
/*      */         }
/*      */
/*      */       }
/*      */       catch (ClassNotFoundException ignored)
/*      */       {
/*      */       }
/*      */
/*      */     }
/*      */     catch (ClassNotFoundException e)
/*      */     {
/*  342 */       fireSpecViolationEvent(session, new Section("16.2.c"));
/*  343 */       status = false;
/*      */     }
/*      */
/*  346 */     return status;
/*      */   }
View Full Code Here

/*      */     {
/*  370 */       Class remote = this.classloader.loadClass(name);
/*      */
/*  378 */       if (!hasEJBObjectInterface(remote))
/*      */       {
/*  380 */         fireSpecViolationEvent(session, new Section("6.10.5.a"));
/*  381 */         status = false;
/*      */       }
/*      */
/*  396 */       Iterator it = Arrays.asList(remote.getMethods()).iterator();
/*  397 */       while (it.hasNext())
/*      */       {
/*  399 */         Method method = (Method)it.next();
/*      */
/*  401 */         if (!hasLegalRMIIIOPArguments(method))
/*      */         {
/*  403 */           fireSpecViolationEvent(session, method, new Section("6.10.5.b"));
/*  404 */           status = false;
/*      */         }
/*      */
/*  407 */         if (!hasLegalRMIIIOPReturnType(method))
/*      */         {
/*  409 */           fireSpecViolationEvent(session, method, new Section("6.10.5.c"));
/*  410 */           status = false;
/*      */         }
/*      */
/*  413 */         if (!throwsRemoteException(method))
/*      */         {
/*  415 */           fireSpecViolationEvent(session, method, new Section("6.10.5.d"));
/*  416 */           status = false;
/*      */         }
/*      */
/*      */       }
/*      */
/*  434 */       String beanName = session.getEjbClass();
/*  435 */       Class bean = this.classloader.loadClass(beanName);
/*      */
/*  437 */       Iterator iterator = Arrays.asList(remote.getDeclaredMethods()).iterator();
/*  438 */       while (iterator.hasNext())
/*      */       {
/*  440 */         Method remoteMethod = (Method)iterator.next();
/*      */
/*  442 */         if (!hasMatchingMethod(bean, remoteMethod))
/*      */         {
/*  444 */           fireSpecViolationEvent(session, remoteMethod, new Section("6.10.5.e"));
/*  445 */           status = false;
/*      */         }
/*      */
/*  448 */         if (hasMatchingMethod(bean, remoteMethod))
/*      */         {
/*      */           try
/*      */           {
/*  452 */             Method beanMethod = bean.getMethod(remoteMethod.getName(), remoteMethod.getParameterTypes());
/*      */
/*  454 */             if (!hasMatchingReturnType(remoteMethod, beanMethod))
/*      */             {
/*  456 */               fireSpecViolationEvent(session, remoteMethod, new Section("6.10.5.f"));
/*  457 */               status = false;
/*      */             }
/*      */
/*  460 */             if (!hasMatchingExceptions(beanMethod, remoteMethod))
/*      */             {
/*  462 */               fireSpecViolationEvent(session, remoteMethod, new Section("6.10.5.g"));
/*  463 */               status = false;
/*      */             }
/*      */
/*      */           }
/*      */           catch (NoSuchMethodException ignored)
/*      */           {
/*      */           }
/*      */
/*      */         }
/*      */
/*      */       }
/*      */
/*      */     }
/*      */     catch (ClassNotFoundException e)
/*      */     {
/*  480 */       fireSpecViolationEvent(session, new Section("16.2.d"));
/*  481 */       status = false;
/*      */     }
/*      */
/*  484 */     return status;
/*      */   }
View Full Code Here

/*      */     {
/*  502 */       Class bean = this.classloader.loadClass(name);
/*      */
/*  511 */       if (!hasSessionBeanInterface(bean))
/*      */       {
/*  513 */         fireSpecViolationEvent(session, new Section("6.5.1"));
/*  514 */         status = false;
/*      */       }
/*      */
/*  526 */       if (hasSessionSynchronizationInterface(bean))
/*      */       {
/*  528 */         if (session.isStateless())
/*      */         {
/*  530 */           fireSpecViolationEvent(session, new Section("6.5.3.a"));
/*  531 */           status = false;
/*      */         }
/*      */
/*  534 */         if (session.isBeanManagedTx())
/*      */         {
/*  536 */           fireSpecViolationEvent(session, new Section("6.5.3.b"));
/*  537 */           status = false;
/*      */         }
/*      */
/*      */       }
/*      */
/*  546 */       if (!hasEJBCreateMethod(bean, true))
/*      */       {
/*  548 */         fireSpecViolationEvent(session, new Section("6.5.5"));
/*  549 */         status = false;
/*      */       }
/*      */
/*  558 */       if ((hasSessionSynchronizationInterface(bean)) && (session.isBeanManagedTx()))
/*      */       {
/*  561 */         fireSpecViolationEvent(session, new Section("6.6.1"));
/*  562 */         status = false;
/*      */       }
/*      */
/*  570 */       if (!isPublic(bean))
/*      */       {
/*  572 */         fireSpecViolationEvent(session, new Section("6.10.2.a"));
/*  573 */         status = false;
/*      */       }
/*      */
/*  581 */       if (isFinal(bean))
/*      */       {
/*  583 */         fireSpecViolationEvent(session, new Section("6.10.2.b"));
/*  584 */         status = false;
/*      */       }
/*      */
/*  592 */       if (isAbstract(bean))
/*      */       {
/*  594 */         fireSpecViolationEvent(session, new Section("6.10.2.c"));
/*  595 */         status = false;
/*      */       }
/*      */
/*  604 */       if (!hasDefaultConstructor(bean))
/*      */       {
/*  606 */         fireSpecViolationEvent(session, new Section("6.10.2.d"));
/*  607 */         status = false;
/*      */       }
/*      */
/*  615 */       if (hasFinalizer(bean))
/*      */       {
/*  617 */         fireSpecViolationEvent(session, new Section("6.10.2.e"));
/*  618 */         status = false;
/*      */       }
/*      */
/*  631 */       if (hasEJBCreateMethod(bean, true))
/*      */       {
/*  633 */         Iterator it = getEJBCreateMethods(bean);
/*  634 */         while (it.hasNext())
/*      */         {
/*  636 */           Method ejbCreate = (Method)it.next();
/*      */
/*  638 */           if (!isPublic(ejbCreate))
/*      */           {
/*  640 */             fireSpecViolationEvent(session, ejbCreate, new Section("6.10.3.a"));
/*  641 */             status = false;
/*      */           }
/*      */
/*  644 */           if ((isFinal(ejbCreate)) || (isStatic(ejbCreate)))
/*      */           {
/*  646 */             fireSpecViolationEvent(session, ejbCreate, new Section("6.10.3.b"));
/*  647 */             status = false;
/*      */           }
/*      */
/*  650 */           if (!hasVoidReturnType(ejbCreate))
/*      */           {
/*  652 */             fireSpecViolationEvent(session, ejbCreate, new Section("6.10.3.c"));
/*  653 */             status = false;
/*      */           }
/*      */
/*  656 */           if (!hasLegalRMIIIOPArguments(ejbCreate))
/*      */           {
/*  658 */             fireSpecViolationEvent(session, ejbCreate, new Section("6.10.3.d"));
/*  659 */             status = false;
/*      */           }
/*      */
/*      */         }
/*      */
/*      */       }
/*      */
/*      */     }
/*      */     catch (ClassNotFoundException e)
/*      */     {
/*  673 */       fireSpecViolationEvent(session, new Section("16.2.b"));
/*  674 */       status = false;
/*      */     }
/*      */
/*  677 */     return status;
/*      */   }
View Full Code Here

/*      */     {
/*  699 */       Class home = this.classloader.loadClass(name);
/*      */
/*  707 */       if (!hasEJBHomeInterface(home))
/*      */       {
/*  709 */         fireSpecViolationEvent(entity, new Section("9.2.8.a"));
/*  710 */         status = false;
/*      */       }
/*      */
/*  725 */       Iterator homeMethods = Arrays.asList(home.getMethods()).iterator();
/*  726 */       while (homeMethods.hasNext())
/*      */       {
/*  728 */         Method method = (Method)homeMethods.next();
/*      */
/*  730 */         if (!hasLegalRMIIIOPArguments(method))
/*      */         {
/*  732 */           fireSpecViolationEvent(entity, method, new Section("9.2.8.b"));
/*      */
/*  734 */           status = false;
/*      */         }
/*      */
/*  737 */         if (!hasLegalRMIIIOPReturnType(method))
/*      */         {
/*  739 */           fireSpecViolationEvent(entity, method, new Section("9.2.8.c"));
/*  740 */           status = false;
/*      */         }
/*      */
/*  743 */         if (!throwsRemoteException(method))
/*      */         {
/*  745 */           fireSpecViolationEvent(entity, method, new Section("9.2.8.d"));
/*  746 */           status = false;
/*      */         }
/*      */
/*      */       }
/*      */
/*  759 */       homeMethods = Arrays.asList(home.getMethods()).iterator();
/*  760 */       while (homeMethods.hasNext())
/*      */       {
/*  762 */         Method method = (Method)homeMethods.next();
/*      */
/*  765 */         if (method.getDeclaringClass().getName().equals("javax.ejb.EJBHome")) {
/*      */           continue;
/*      */         }
/*  768 */         if ((!isCreateMethod(method)) && (!isFinderMethod(method)))
/*      */         {
/*  770 */           fireSpecViolationEvent(entity, method, new Section("9.2.8.e"));
/*  771 */           status = false;
/*      */         }
/*      */
/*      */       }
/*      */
/*      */       try
/*      */       {
/*  799 */         String beanClass = entity.getEjbClass();
/*  800 */         Class bean = this.classloader.loadClass(beanClass);
/*      */
/*  802 */         Iterator createMethods = getCreateMethods(home);
/*  803 */         while (createMethods.hasNext())
/*      */         {
/*  805 */           Method create = (Method)createMethods.next();
/*      */
/*  807 */           if (!hasMatchingEJBCreate(bean, create))
/*      */           {
/*  809 */             fireSpecViolationEvent(entity, create, new Section("9.2.8.f"));
/*  810 */             status = false;
/*      */           }
/*      */
/*  813 */           if (!hasRemoteReturnType(entity, create))
/*      */           {
/*  815 */             fireSpecViolationEvent(entity, create, new Section("9.2.8.g"));
/*  816 */             status = false;
/*      */           }
/*      */
/*  819 */           if ((hasMatchingEJBCreate(bean, create)) && (hasMatchingEJBPostCreate(bean, create)))
/*      */           {
/*  822 */             Method ejbCreate = getMatchingEJBCreate(bean, create);
/*  823 */             Method ejbPostCreate = getMatchingEJBPostCreate(bean, create);
/*      */
/*  825 */             if ((!hasMatchingExceptions(ejbCreate, create)) || (!hasMatchingExceptions(ejbPostCreate, create)))
/*      */             {
/*  828 */               fireSpecViolationEvent(entity, create, new Section("9.2.8.h"));
/*  829 */               status = false;
/*      */             }
/*      */           }
/*      */
/*  833 */           if (!throwsCreateException(create))
/*      */           {
/*  835 */             fireSpecViolationEvent(entity, create, new Section("9.2.8.i"));
/*  836 */             status = false;
/*      */           }
/*      */
/*      */         }
/*      */
/*      */       }
/*      */       catch (ClassNotFoundException ignored)
/*      */       {
/*      */       }
/*      */
/*      */       try
/*      */       {
/*  866 */         String beanClass = entity.getEjbClass();
/*  867 */         Class bean = this.classloader.loadClass(beanClass);
/*      */
/*  869 */         Iterator finderMethods = getFinderMethods(home);
/*  870 */         while (finderMethods.hasNext())
/*      */         {
/*  872 */           Method finder = (Method)finderMethods.next();
/*      */
/*  874 */           if ((entity.isBMP()) && (!hasMatchingEJBFind(bean, finder)))
/*      */           {
/*  876 */             fireSpecViolationEvent(entity, finder, new Section("9.2.8.j"));
/*  877 */             status = false;
/*      */           }
/*      */
/*  880 */           if ((!hasRemoteReturnType(entity, finder)) && (!isMultiObjectFinder(finder)))
/*      */           {
/*  883 */             fireSpecViolationEvent(entity, finder, new Section("9.2.8.k"));
/*  884 */             status = false;
/*      */           }
/*      */
/*  887 */           if ((entity.isBMP()) && (hasMatchingEJBFind(bean, finder)))
/*      */           {
/*  889 */             Method ejbFind = getMatchingEJBFind(bean, finder);
/*  890 */             if (!hasMatchingExceptions(ejbFind, finder))
/*      */             {
/*  892 */               fireSpecViolationEvent(entity, finder, new Section("9.2.8.l"));
/*  893 */               status = false;
/*      */             }
/*      */           }
/*      */
/*  897 */           if (!throwsFinderException(finder))
/*      */           {
/*  899 */             fireSpecViolationEvent(entity, finder, new Section("9.2.8.m"));
/*  900 */             status = false;
/*      */           }
/*      */
/*      */         }
/*      */
/*      */       }
/*      */       catch (ClassNotFoundException ignored)
/*      */       {
/*      */       }
/*      */
/*      */     }
/*      */     catch (ClassNotFoundException e)
/*      */     {
/*  916 */       fireSpecViolationEvent(entity, new Section("16.2.c"));
/*  917 */       status = false;
/*      */     }
/*      */
/*  920 */     return status;
/*      */   }
View Full Code Here

/*      */     {
/*  942 */       Class remote = this.classloader.loadClass(name);
/*      */
/*  950 */       if (!hasEJBObjectInterface(remote))
/*      */       {
/*  952 */         fireSpecViolationEvent(entity, new Section("9.2.7.a"));
/*  953 */         status = false;
/*      */       }
/*      */
/*  968 */       Iterator remoteMethods = Arrays.asList(remote.getMethods()).iterator();
/*  969 */       while (remoteMethods.hasNext())
/*      */       {
/*  971 */         Method method = (Method)remoteMethods.next();
/*      */
/*  973 */         if (!hasLegalRMIIIOPArguments(method))
/*      */         {
/*  975 */           fireSpecViolationEvent(entity, method, new Section("9.2.7.b"));
/*  976 */           status = false;
/*      */         }
/*      */
/*  979 */         if (!hasLegalRMIIIOPReturnType(method))
/*      */         {
/*  981 */           fireSpecViolationEvent(entity, method, new Section("9.2.7.c"));
/*  982 */           status = false;
/*      */         }
/*      */
/*  985 */         if (!hasLegalRMIIIOPExceptionTypes(method))
/*      */         {
/*  987 */           fireSpecViolationEvent(entity, method, new Section("9.2.7.h"));
/*  988 */           status = false;
/*      */         }
/*      */
/*  991 */         if (!throwsRemoteException(method))
/*      */         {
/*  993 */           fireSpecViolationEvent(entity, method, new Section("9.2.7.d"));
/*  994 */           status = false;
/*      */         }
/*      */
/*      */       }
/*      */
/*      */       try
/*      */       {
/* 1016 */         String beanClass = entity.getEjbClass();
/* 1017 */         Class bean = this.classloader.loadClass(beanClass);
/*      */
/* 1019 */         remoteMethods = Arrays.asList(remote.getMethods()).iterator();
/* 1020 */         while (remoteMethods.hasNext())
/*      */         {
/* 1022 */           Method method = (Method)remoteMethods.next();
/*      */
/* 1025 */           if (method.getDeclaringClass().getName().equals("javax.ejb.EJBObject")) {
/*      */             continue;
/*      */           }
/* 1028 */           if (!hasMatchingMethod(bean, method))
/*      */           {
/* 1030 */             fireSpecViolationEvent(entity, method, new Section("9.2.7.e"));
/* 1031 */             status = false;
/*      */           }
/*      */
/* 1034 */           if (hasMatchingMethod(bean, method))
/*      */           {
/*      */             try
/*      */             {
/* 1038 */               Method beanMethod = bean.getMethod(method.getName(), method.getParameterTypes());
/*      */
/* 1040 */               if (!hasMatchingReturnType(beanMethod, method))
/*      */               {
/* 1042 */                 fireSpecViolationEvent(entity, method, new Section("9.2.7.f"));
/* 1043 */                 status = false;
/*      */               }
/*      */
/* 1046 */               if (!hasMatchingExceptions(beanMethod, method))
/*      */               {
/* 1048 */                 fireSpecViolationEvent(entity, method, new Section("9.2.7.g"));
/* 1049 */                 status = false;
/*      */               }
/*      */
/*      */             }
/*      */             catch (NoSuchMethodException ignored)
/*      */             {
/*      */             }
/*      */
/*      */           }
/*      */
/*      */         }
/*      */
/*      */       }
/*      */       catch (ClassNotFoundException ignored)
/*      */       {
/*      */       }
/*      */
/*      */     }
/*      */     catch (ClassNotFoundException e)
/*      */     {
/* 1070 */       fireSpecViolationEvent(entity, new Section("16.2.d"));
/* 1071 */       status = false;
/*      */     }
/*      */
/* 1074 */     return status;
/*      */   }
View Full Code Here

TOP

Related Classes of org.jboss.verifier.Section

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.