/** * Returns true if the passed <code>mdbClass</code> meets the requirements set by the EJB3 spec about bean implementation * classes. The passed <code>mdbClass</code> must not be an interface and must be public and not final and not abstract. If * it passes these requirements then this method returns true. Else it returns false. * * @param mdbClass The MDB class * @return * @throws DeploymentUnitProcessingException */ public static Collection<MdbValidityStatus> assertEjbClassValidity(final ClassInfo mdbClass) throws DeploymentUnitProcessingException { Collection<MdbValidityStatus> mdbComplianceIssueList = new ArrayList<>(MdbValidityStatus.values().length); final String className = mdbClass.name().toString(); verifyModifiers(className, mdbClass.flags(), mdbComplianceIssueList); for (MethodInfo method : mdbClass.methods()) { if ("onMessage".equals(method.name())) { verifyOnMessageMethod(className, method.flags(), mdbComplianceIssueList); } if ("finalize".equals(method.name())) { EjbLogger.DEPLOYMENT_LOGGER.mdbCantHaveFinalizeMethod(className); mdbComplianceIssueList.add(MdbValidityStatus.MDB_SHOULD_NOT_HAVE_FINALIZE_METHOD); } } return mdbComplianceIssueList; }
private boolean isNonAbstractPublicInstanceMethod(MethodInfo method) { return (method.flags() & (Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC)) == Modifier.PUBLIC; }
@Override public int getFlags() { return method.flags(); }
private boolean isNonAbstractPublicInstanceMethod(MethodInfo method) { return (method.flags() & (Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC)) == Modifier.PUBLIC; }
private boolean isNonAbstractPublicInstanceMethod(MethodInfo method) { return (method.flags() & (Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC)) == Modifier.PUBLIC; }
private boolean isNonAbstractPublicInstanceMethod(MethodInfo method) { return (method.flags() & (Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC)) == Modifier.PUBLIC; }
private boolean isNonAbstractPublicInstanceMethod(MethodInfo method) { return (method.flags() & (Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC)) == Modifier.PUBLIC; }
private boolean isNonAbstractPublicInstanceMethod(MethodInfo method) { return (method.flags() & (Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC)) == Modifier.PUBLIC; }
throw new PersistenceException( "Callback method " + methodInfo.name() + " must have a void return type in " ); if ( Modifier.isStatic( methodInfo.flags() ) || Modifier.isFinal( methodInfo.flags() ) ) { throw new PersistenceException( "Callback method " + methodInfo.name() + " must not be static or final in " );
throw new PersistenceException( "Callback method " + methodInfo.name() + " must have a void return type in " ); if ( Modifier.isStatic( methodInfo.flags() ) || Modifier.isFinal( methodInfo.flags() ) ) { throw new PersistenceException( "Callback method " + methodInfo.name() + " must not be static or final in " );
if ( ( methodInfo.flags() & Modifier.PUBLIC ) == 0 ) { continue;
if (!Modifier.isStatic(each.flags())) { throw new RuntimeException("Method marked @Default must be static");