code: public List<CmsModuleDependency> checkDependencies(CmsModule module, int mode) {
  
          List<CmsModuleDependency> result = new ArrayList<CmsModuleDependency>();
  
          if (mode == DEPENDENCY_MODE_DELETE) {
              // delete mode, check if other modules depend on this module
              Iterator<CmsModule> i = m_modules.values().iterator();
              while (i.hasNext()) {
                  CmsModule otherModule = i.next();
                  CmsModuleDependency dependency = otherModule.checkDependency(module);
                  if (dependency != null) {
                      // dependency found, add to list
                      result.add(new CmsModuleDependency(otherModule.getName(), otherModule.getVersion()));
                  }
              }
  
          } else if (mode == DEPENDENCY_MODE_IMPORT) {
              // import mode, check if all module dependencies are fulfilled
              Iterator<CmsModule> i = m_modules.values().iterator();
              // add all dependencies that must be found
              result.addAll(module.getDependencies());
              while (i.hasNext() && (result.size() > 0)) {
                  CmsModule otherModule = i.next();
                  CmsModuleDependency dependency = module.checkDependency(otherModule);
                  if (dependency != null) {
                      // dependency found, remove from list
                      result.remove(dependency);
                  }
              }
          } else {
              // invalid mode selected
              throw new CmsRuntimeException(
                  Messages.get().container(Messages.ERR_CHECK_DEPENDENCY_INVALID_MODE_1, new Integer(mode)));
          }
  
          return result;
      }
docs: Checks if a modules dependencies are fulfilled.<p>
  
  The possible values for the <code>mode</code> parameter are:<dl>
  <dt>{@link #DEPENDENCY_MODE_DELETE}</dt>
  <dd>Check for module deleting, i.e. are other modules dependent on the
  given module?</dd>
  <dt>{@link #DEPENDENCY_MODE_IMPORT}</dt>
  <dd>Check for module importing, i.e. are all dependencies required by the given
  module available?</dd></dl>
  
  @param module the module to check the dependencies for
  @param mode the dependency check mode
  @return a list of dependencies that are not fulfilled, if empty all dependencies are fulfilled