@SuppressWarnings("rawtypes")
    private void registerFunction(Class<?> iface, String name, @Nullable String camelName,
                                  Object func, @Nullable Object implementation) {
        if (functions.containsKey(name)) {
            logger.warn("duplicate Thrift method name: " + name);
            return;
        }

        try {
            final ThriftFunction f;
            if (func instanceof ProcessFunction) {
                f = new ThriftFunction(iface, (ProcessFunction) func, implementation);
            } else {
                f = new ThriftFunction(iface, (AsyncProcessFunction) func, implementation);
            }
            functions.put(name, f);
            if (camelName != null) {
                functions.put(camelName, f);
            }
        } catch (Exception e) {
            throw new IllegalArgumentException("failed to retrieve function metadata: " +
                                               iface.getName() + '.' + name + "()", e);
        }
    }
Creates a new instance from a single Thrift service interface.
thrift/thrift0.13/src/main/java/com/linecorp/armeria/internal/common/thrift/ThriftServiceMetadata.java