public static void getAnnotationCMCLockAccessTimeout(long[] timeouts,
                                                         Method[] ejbMethods,
                                                         long defaultTimeout,
                                                         boolean metadataComplete)
                    throws EJBConfigurationException // F743-1752CodRev
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
        {
            Tr.entry(tc, "getAnnotationCMCLockAccessTimeout: "
                         + " methods = " + Arrays.toString(ejbMethods)); //F743-7027.1
        }

        // For each of the business methods, determine the access timeout
        // value to use if not already set by the ejb-jar.xml processing.
        for (int i = 0; i < ejbMethods.length; i++)
        {
            Method beanMethod = ejbMethods[i];

            // Only use the value from annotations if it is not already set
            // from value in ejb-jar.xml (e.g. obtained via WCCM).
            if (timeouts[i] == -2)
            {
                // ejb-jar.xml did not contain the lock type for this method.
                // Only change if metadata complete is false.
                // EJB 2.1 remove method (null) has no annotation.        F743-22642
                if (metadataComplete == false && beanMethod != null)
                {
                    // metadata complete is false, so see if there is a @AccessTimeout
                    // annotation on this method.
                    AccessTimeout annotation = beanMethod.getAnnotation(AccessTimeout.class);
                    if (annotation == null)
                    {
                        // No @AccessTimeout annotation on method, see if there is one at class level of
                        // the class that declared this method object.
                        Class<?> c = beanMethod.getDeclaringClass();
                        annotation = c.getAnnotation(AccessTimeout.class);

                        if (isTraceOn && tc.isDebugEnabled() && annotation != null)
                        {
                            Tr.debug(tc, beanMethod.getName() + " from class " + c.getName());
                        }
                    }

                    // Did we find a @AccessTimeout annotation at method or class level?
                    if (annotation != null)
                    {
                        // F743-1752CodRev start
                        // Use value from @AccessTimeout annotation provided it is
                        // a valid value (must be -1 or greater).
                        long value = annotation.value(); // F743-7027
                        TimeUnit unit = annotation.unit(); // F743-7027

                        if (value < -1 || value == Long.MAX_VALUE) // F743-7027
                        {
                            // CNTR0192E: The access timeout value {0} is not valid for the enterprise
                            // bean {1} method of the {2} class. The value must be -1 or greater and
                            // less than java.lang.Long.MAX_VALUE (9223372036854775807).
                            Tr.error(tc, "SINGLETON_INVALID_ACCESS_TIMEOUT_CNTR0192E"
                                     , new Object[] { value, beanMethod.getName(), beanMethod.getDeclaringClass().getName() });

                            throw new EJBConfigurationException("CNTR0192E: @AccessTimeout annotation value " + value +
                                                                " is not valid for the enterprise bean " + beanMethod.getName() +
                                                                " method of the " + beanMethod.getDeclaringClass().getName() +
                                                                " class. The value must be -1 or greater and less than" +
                                                                " java.lang.Long.MAX_VALUE (9223372036854775807).");
                        }
                        else if (value > 0)
                        {
                            // Valid value, convert to milli-seconds if necessary.
                            if (unit == TimeUnit.MILLISECONDS) // F743-7027
                            {
                                timeouts[i] = value;
                            }
                            else
                            {
                                timeouts[i] = TimeUnit.MILLISECONDS.convert(value, unit); // F743-6605.1
                                // Throw exception if conversion resulted in an overflow. The assumption
                                // is pre-conditions are honored by caller of this method.
                                // begin F743-6605.1
                                if (timeouts[i] == Long.MAX_VALUE || timeouts[i] == Long.MIN_VALUE) {
                                    // CNTR0196E: The conversion of access timeout value {0} from {1} time
                                    // unit to
                                    // milli-seconds time unit resulted in an overflow.
                                    Tr.error(tc, "SINGLETON_ACCESS_TIMEOUT_OVERFLOW_CNTR0196E", new Object[] { value, unit });

                                    if (isTraceOn && tc.isEntryEnabled()) {
                                        Tr.exit(tc, "convertToMilliSeconds: " + value + unit + " overflow");
                                    }

                                    throw new EJBConfigurationException("Conversion of access timeout value of " + value + " " + unit
                                                                        + " to milliseconds resulted in overflow.");
                                }
                                // end F743-6605.1
                            }
                        } // F743-1752CodRev end
                        else
                        {
                            timeouts[i] = value; // special value -1 or 0  F743-21028.5
                        }
                    }
                    else
                    {
                        timeouts[i] = defaultTimeout; // set default  F743-21028.5 F743-22462
                    }
                } // if !metadataComplete
                else
                {
                    timeouts[i] = defaultTimeout; // set default     F743-21028.5 F743-22462
                }
            }
        }

        if (isTraceOn && tc.isEntryEnabled())
        {
            Tr.exit(tc, "getAnnotationCMCLockAccessTimeout", Arrays.toString(timeouts));
        }
    }
public static void getAnnotationCMCLockAccessTimeout ( long [ ] timeouts , Method [ ] ejbMethods , long defaultTimeout , boolean metadataComplete ) throws EJBConfigurationException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "getAnnotationCMCLockAccessTimeout: " + " methods = " + Arrays . toString ( ejbMethods ) ) ; } for ( int i = 0 ; i < ejbMethods . length ; i ++ ) { Method beanMethod = ejbMethods [ i ] ; if ( timeouts [ i ] == - 2 ) { if ( metadataComplete == false && beanMethod != null ) { AccessTimeout annotation = beanMethod . getAnnotation ( AccessTimeout . class ) ; if ( annotation == null ) { Class < ? > c = beanMethod . getDeclaringClass ( ) ; annotation = c . getAnnotation ( AccessTimeout . class ) ; if ( isTraceOn && tc . isDebugEnabled ( ) && annotation != null ) { Tr . debug ( tc , beanMethod . getName ( ) + " from class " + c . getName ( ) ) ; } } if ( annotation != null ) { long value = annotation . value ( ) ; TimeUnit unit = annotation . unit ( ) ; if ( value < - 1 || value == Long . MAX_VALUE ) { Tr . error ( tc , "SINGLETON_INVALID_ACCESS_TIMEOUT_CNTR0192E" , new Object [ ] { value , beanMethod . getName ( ) , beanMethod . getDeclaringClass ( ) . getName ( ) } ) ; throw new EJBConfigurationException ( "CNTR0192E: @AccessTimeout annotation value " + value + " is not valid for the enterprise bean " + beanMethod . getName ( ) + " method of the " + beanMethod . getDeclaringClass ( ) . getName ( ) + " class. The value must be -1 or greater and less than" + " java.lang.Long.MAX_VALUE (9223372036854775807)." ) ; } else if ( value > 0 ) { if ( unit == TimeUnit . MILLISECONDS ) { timeouts [ i ] = value ; } else { timeouts [ i ] = TimeUnit . MILLISECONDS . convert ( value , unit ) ; if ( timeouts [ i ] == Long . MAX_VALUE || timeouts [ i ] == Long . MIN_VALUE ) { Tr . error ( tc , "SINGLETON_ACCESS_TIMEOUT_OVERFLOW_CNTR0196E" , new Object [ ] { value , unit } ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "convertToMilliSeconds: " + value + unit + " overflow" ) ; } throw new EJBConfigurationException ( "Conversion of access timeout value of " + value + " " + unit + " to milliseconds resulted in overflow." ) ; } } } else { timeouts [ i ] = value ; } } else { timeouts [ i ] = defaultTimeout ; } } else { timeouts [ i ] = defaultTimeout ; } } } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "getAnnotationCMCLockAccessTimeout" , Arrays . toString ( timeouts ) ) ; } }
F743-1752.1 added entire method.