Example #1
0
 private void populateCustomTraceTypes() {
   // add the custom trace types
   for (CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
     String traceTypeId = CustomTxtTrace.class.getCanonicalName() + SEPARATOR + def.definitionName;
     ITmfTrace trace = new CustomTxtTrace(def);
     TraceTypeHelper tt =
         new TraceTypeHelper(
             traceTypeId,
             CUSTOM_TXT_CATEGORY,
             def.definitionName,
             trace,
             false,
             TraceElementType.TRACE);
     fTraceTypes.put(traceTypeId, tt);
     // Deregister trace as signal handler because it is only used for validation
     TmfSignalManager.deregister(trace);
   }
   for (CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {
     String traceTypeId = CustomXmlTrace.class.getCanonicalName() + SEPARATOR + def.definitionName;
     ITmfTrace trace = new CustomXmlTrace(def);
     TraceTypeHelper tt =
         new TraceTypeHelper(
             traceTypeId,
             CUSTOM_XML_CATEGORY,
             def.definitionName,
             trace,
             false,
             TraceElementType.TRACE);
     fTraceTypes.put(traceTypeId, tt);
     // Deregister trace as signal handler because it is only used for validation
     TmfSignalManager.deregister(trace);
   }
 }
Example #2
0
  /**
   * Gets all the custom trace types
   *
   * @return the list of custom trace types
   */
  public static List<String> getCustomTraceTypes() {

    List<String> traceTypes = new ArrayList<>();
    for (CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
      String traceTypeName = def.definitionName;
      traceTypes.add(traceTypeName);
    }
    for (CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {
      String traceTypeName = def.definitionName;
      traceTypes.add(traceTypeName);
    }
    return traceTypes;
  }
Example #3
0
 /**
  * Gets the custom trace types (custom text and friends)
  *
  * @param type the type to get (Text, xml or other...)
  * @return the list of custom trace types
  */
 public static List<String> getCustomTraceTypes(String type) {
   List<String> traceTypes = new ArrayList<>();
   if (type.equals(CUSTOM_TXT_CATEGORY)) {
     for (CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
       String traceTypeName = def.definitionName;
       traceTypes.add(traceTypeName);
     }
   }
   if (type.equals(CUSTOM_XML_CATEGORY)) {
     for (CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {
       String traceTypeName = def.definitionName;
       traceTypes.add(traceTypeName);
     }
   }
   return traceTypes;
 }