@Override public Set<OperationalExtensionId> getSupportedTypesForProvider(OperationalStats operationalStats) { OperationalExtensionId operationalExtensionId = OperationalStatsUtils.getOperationalExtensionId(operationalStats); return operationalExtensionId == null ? Collections.<OperationalExtensionId>emptySet() : Collections.singleton(operationalExtensionId); } }
@Override public Set<OperationalExtensionId> getSupportedTypesForProvider(OperationalStats operationalStats) { OperationalExtensionId operationalExtensionId = OperationalStatsUtils.getOperationalExtensionId(operationalStats); return operationalExtensionId == null ? Collections.<OperationalExtensionId>emptySet() : Collections.singleton(operationalExtensionId); } }
@Nullable private ObjectName getObjectName(OperationalStats operationalStats) { OperationalExtensionId operationalExtensionId = OperationalStatsUtils.getOperationalExtensionId(operationalStats); if (operationalExtensionId == null) { return null; } Hashtable<String, String> properties = new Hashtable<>(); properties.put(OperationalStatsUtils.SERVICE_NAME_KEY, operationalExtensionId.getServiceName()); properties.put(OperationalStatsUtils.STAT_TYPE_KEY, operationalExtensionId.getStatType()); try { return new ObjectName(OperationalStatsUtils.JMX_DOMAIN, properties); } catch (MalformedObjectNameException e) { // should never happen, since we're constructing a valid domain name, and properties is non-empty throw Throwables.propagate(e); } } }
@Nullable private ObjectName getObjectName(OperationalStats operationalStats) { OperationalExtensionId operationalExtensionId = OperationalStatsUtils.getOperationalExtensionId(operationalStats); if (operationalExtensionId == null) { return null; } Hashtable<String, String> properties = new Hashtable<>(); properties.put(OperationalStatsUtils.SERVICE_NAME_KEY, operationalExtensionId.getServiceName()); properties.put(OperationalStatsUtils.STAT_TYPE_KEY, operationalExtensionId.getStatType()); try { return new ObjectName(OperationalStatsUtils.JMX_DOMAIN, properties); } catch (MalformedObjectNameException e) { // should never happen, since we're constructing a valid domain name, and properties is non-empty throw Throwables.propagate(e); } } }