protected Method findEjbMethod(Method controlBeanMethod, Class ejbInterface) {
        final String cbMethodName = controlBeanMethod.getName();
        final Class cbMethodReturnType = controlBeanMethod.getReturnType();
        final Class[] cbMethodParams = controlBeanMethod.getParameterTypes();

        Method[] ejbMethods = ejbInterface.getMethods();
        for (Method m : ejbMethods) {
            if (!cbMethodName.equals(m.getName())
                    || !cbMethodReturnType.equals(m.getReturnType())) {
                continue;
            }

            Class[] params = m.getParameterTypes();
            if (cbMethodParams.length == params.length) {
                int i;
                for (i = 0; i < cbMethodParams.length; i++) {
                    if (cbMethodParams[i] != params[i]) break;
                }
                if (i == cbMethodParams.length)
                    return m;
            }
        }
        return null;
    }
protected Method findEjbMethod ( Method controlBeanMethod , Class ejbInterface ) { final String cbMethodName = controlBeanMethod . getName ( ) ; final Class cbMethodReturnType = controlBeanMethod . getReturnType ( ) ; final Class [ ] cbMethodParams = controlBeanMethod . getParameterTypes ( ) ; Method [ ] ejbMethods = ejbInterface . getMethods ( ) ; for ( Method m : ejbMethods ) { if ( ! cbMethodName . equals ( m . getName ( ) ) || ! cbMethodReturnType . equals ( m . getReturnType ( ) ) ) { continue ; } Class [ ] params = m . getParameterTypes ( ) ; if ( cbMethodParams . length == params . length ) { int i ; for ( i = 0 ; i < cbMethodParams . length ; i ++ ) { if ( cbMethodParams [ i ] != params [ i ] ) break ; } if ( i == cbMethodParams . length ) return m ; } } return null ; }
Find the method which has the same signature in the specified class.

@param controlBeanMethod Method signature find.
@param ejbInterface Class to search for method signature.
@return Method from ejbInterface if found, null if not found.