@Nullable
    private MethodInfo newMethodInfo(Method method, Entry entry,
                                     DocServiceFilter filter) {
        // Get the function name in thrift IDL
        final String thriftFunctionName;
        if (entry.thriftServiceEntry != null) {
            thriftFunctionName = entry.thriftServiceEntry.functionName(method.getName());
        } else {
            // entry.thriftServiceEntry can be null for tests
            thriftFunctionName = method.getName();
        }

        final Class<?> serviceClass = method.getDeclaringClass().getDeclaringClass();
        final String serviceName = serviceClass.getName();
        if (!filter.test(name(), serviceName, thriftFunctionName)) {
            return null;
        }
        final ClassLoader classLoader = serviceClass.getClassLoader();

        final String argsClassName = serviceName + '$' + thriftFunctionName + "_args";
        final Class<? extends TBase<?, ?>> argsClass;
        try {
            @SuppressWarnings("unchecked")
            final Class<? extends TBase<?, ?>> argsClass0 =
                    (Class<? extends TBase<?, ?>>) Class.forName(argsClassName, false, classLoader);
            argsClass = argsClass0;
        } catch (ClassNotFoundException e) {
            throw new IllegalStateException("failed to find a class: " + argsClassName, e);
        }

        Class<?> resultClass;
        try {
            resultClass = Class.forName(serviceName + '$' + thriftFunctionName + "_result", false, classLoader);
        } catch (ClassNotFoundException ignored) {
            // Oneway function does not have a result type.
            resultClass = null;
        }

        @SuppressWarnings("unchecked")
        final MethodInfo methodInfo =
                newMethodInfo(serviceName, thriftFunctionName, argsClass,
                              (Class<? extends TBase<?, ?>>) resultClass,
                              (Class<? extends TException>[]) method.getExceptionTypes(),
                              entry.endpointInfos);
        return methodInfo;
    }
{@link DocServicePlugin} implementation that supports {@link THttpService}s.
thrift/thrift0.13/src/main/java/com/linecorp/armeria/internal/server/thrift/ThriftDocServicePlugin.java