コード例 #1
0
  /** @return A hashtable with the J2EE Server as parent */
  protected Hashtable getParentKeys(ObjectName pParent) {
    Hashtable lReturn = new Hashtable();
    Hashtable lProperties = pParent.getKeyPropertyList();
    lReturn.put(J2EETypeConstants.J2EEServer, lProperties.get("name"));

    return lReturn;
  }
コード例 #2
0
ファイル: JmxMetricPoller.java プロジェクト: gorzell/servo
 /** Creates a tag list from an object name. */
 private TagList createTagList(ObjectName name) {
   Map<String, String> props = name.getKeyPropertyList();
   List<Tag> tags = Lists.newArrayList();
   for (Map.Entry<String, String> e : props.entrySet()) {
     String key = PROP_KEY_PREFIX + "." + e.getKey();
     tags.add(Tags.newTag(key, e.getValue()));
   }
   tags.add(Tags.newTag(DOMAIN_KEY, name.getDomain()));
   tags.add(CLASS_TAG);
   return SortedTagList.builder().withTags(tags).build();
 }
コード例 #3
0
 @Override
 public ObjectName getObjectName(Object managedBean, String beanKey)
     throws MalformedObjectNameException {
   ObjectName objectName = this.namingStrategy.getObjectName(managedBean, beanKey);
   String domain = objectName.getDomain();
   Hashtable<String, String> table =
       new Hashtable<String, String>(objectName.getKeyPropertyList());
   String name = objectName.getKeyProperty("name");
   if (name != null) {
     table.remove("name");
     String[] parts = StringUtils.delimitedListToStringArray(name, ".");
     table.put("type", parts[0]);
     if (parts.length > 1) {
       table.put(parts.length > 2 ? "name" : "value", parts[1]);
     }
     if (parts.length > 2) {
       table.put("value", name.substring(parts[0].length() + parts[1].length() + 2));
     }
   }
   return new ObjectName(domain, table);
 }