Пример #1
0
  public ResourceType(
      String name, String plugin, ResourceCategory category, ResourceType parentResourceType) {
    if (name == null) {
      throw new IllegalArgumentException("name==null");
    }
    if (plugin == null) {
      throw new IllegalArgumentException("plugin==null");
    }

    // Initialize empty ordered lists...
    this.childResourceTypes = null;
    this.parentResourceTypes = new HashSet<ResourceType>(1);
    this.metricDefinitions = new LinkedHashSet<MeasurementDefinition>();

    this.name = name;
    this.category = category;
    this.plugin = plugin;
    this.mtime = this.ctime = System.currentTimeMillis();

    if (parentResourceType != null) {
      parentResourceType.addChildResourceType(this);
    }
  }