示例#1
0
 private ModuleType verifyModuleOfTypeExists(
     ModuleDeploymentRequest request, String moduleName, String type) {
   ModuleDefinition def = moduleRegistry.findDefinition(moduleName, type);
   if (def == null || def.getResource() == null) {
     List<ModuleDefinition> definitions = moduleRegistry.findDefinitions(moduleName);
     if (definitions == null || definitions.size() == 0) {
       throw new NoSuchModuleException(moduleName);
     }
     // The module is known but this doesn't seem to be a standard stream,
     // assume it is a composite module stream that isn't deployable by itself
     request.tagAsUndeployable();
     return ModuleType.getModuleTypeByTypeName(definitions.get(0).getType());
   }
   return ModuleType.getModuleTypeByTypeName(def.getType());
 }
示例#2
0
 /** {@inheritDoc} */
 @Override
 public int hashCode() {
   int result = stream.hashCode();
   result = 31 * result + type.hashCode();
   result = 31 * result + label.hashCode();
   return result;
 }
示例#3
0
 /** {@inheritDoc} */
 @Override
 public int compareTo(Key other) {
   int c = type.compareTo(other.getType());
   if (c == 0) {
     c = label.compareTo(other.getLabel());
   }
   return c;
 }
示例#4
0
    /** {@inheritDoc} */
    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }

      if (o instanceof Key) {
        Key other = (Key) o;
        return stream.equals(other.getStream())
            && type.equals(other.getType())
            && label.equals(other.getLabel());
      }

      return false;
    }