@Override
    public void handleScannedItem(ScannedItem item) {
      if ("class".equals(item.getExtension())) {
        boolean scan = false;

        String path = item.getRelativePath();
        for (String packageName : packageNames) {
          if (path.startsWith(packageName)) {
            scan = true;
            break;
          }
        }

        if (scan) {
          try {
            Class<?> cls = item.loadAsClass();
            RemoteAlias alias = cls.getAnnotation(RemoteAlias.class);
            if (alias != null) classes.add(cls);
          } catch (ClassFormatError e) {
          } catch (ClassNotFoundException e) {
          } catch (IOException e) {
            log.error(e, "Could not load class: %s", item);
          }
        }
      }
    }
예제 #2
0
 public void handleScannedItem(ScannedItem item) {
   if ("class".equals(item.getExtension()) && item.getName().indexOf('$') == -1) {
     try {
       handleClass(item.loadAsClass());
     } catch (NoClassDefFoundError e) {
       // Ignore errors with Tide classes depending on Gravity
     } catch (LinkageError e) {
       // Ignore errors with GraniteDS/Hibernate classes depending on Hibernate 3 when using
       // Hibernate 4
     } catch (Throwable t) {
       log.error(t, "Could not load class: %s", item);
     }
   }
 }