コード例 #1
0
  public TabularData listEips() throws Exception {
    try {
      // find all EIPs
      Map<String, Properties> eips = context.findEips();

      TabularData answer = new TabularDataSupport(CamelOpenMBeanTypes.listEipsTabularType());

      // gather EIP detail for each eip
      for (Map.Entry<String, Properties> entry : eips.entrySet()) {
        String name = entry.getKey();
        String title = (String) entry.getValue().get("title");
        String description = (String) entry.getValue().get("description");
        String label = (String) entry.getValue().get("label");
        String type = (String) entry.getValue().get("class");
        String status = CamelContextHelper.isEipInUse(context, name) ? "in use" : "on classpath";
        CompositeType ct = CamelOpenMBeanTypes.listEipsCompositeType();
        CompositeData data =
            new CompositeDataSupport(
                ct,
                new String[] {"name", "title", "description", "label", "status", "type"},
                new Object[] {name, title, description, label, status, type});
        answer.put(data);
      }
      return answer;
    } catch (Exception e) {
      throw ObjectHelper.wrapRuntimeCamelException(e);
    }
  }
コード例 #2
0
 public Map<String, Properties> findEips() throws Exception {
   return context.findEips();
 }