static void validateClass(Procedure<?> proc) throws BadProcedureException {
    try {
      Class<?> clazz = proc.getClass();
      if (!Modifier.isPublic(clazz.getModifiers())) {
        throw new Exception("the " + clazz + " class is not public");
      }

      Constructor<?> ctor = clazz.getConstructor();
      assert ctor != null;
      if (!Modifier.isPublic(ctor.getModifiers())) {
        throw new Exception("the " + clazz + " constructor is not public");
      }
    } catch (Exception e) {
      throw new BadProcedureException("The procedure class " + proc.getClass().getName()
        + " must be accessible and have an empty constructor", e);
    }
  }
Helper to convert to/from ProcedureProtos
hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureUtil.java