コード例 #1
0
 @SuppressWarnings("unchecked")
 protected <T extends SharedObjectInterface> List<T> getSharedObjects(Class<T> clazz) {
   List<T> result = new ArrayList<T>();
   for (SharedObjectInterface sharedObject : sharedObjects.getObjectsMap().values()) {
     if (clazz.isInstance(sharedObject)) {
       result.add((T) sharedObject);
     }
   }
   return result;
 }
コード例 #2
0
  public static List<DatabaseMeta> loadSharedDatabases() {
    List<DatabaseMeta> sharedDatabases = new ArrayList<DatabaseMeta>();
    try {
      SharedObjects sharedObjects = new SharedObjects();
      for (SharedObjectInterface sharedObject : sharedObjects.getObjectsMap().values()) {
        if (sharedObject instanceof DatabaseMeta) {
          sharedDatabases.add((DatabaseMeta) sharedObject);
        }
      }
    } catch (Exception e) {
      LogChannel.GENERAL.logError("Unable to load shared objects", e);
    }

    return sharedDatabases;
  }