{
try {
// extract method handles into a map so they can be exported individually into jmx
ImmutableMap.Builder<ObjectName, ThriftMethodHandler> builder = ImmutableMap.builder();
for (ThriftClientBinder.ThriftClientProvider<?> clientProvider : clientProviders) {
ThriftClientMetadata clientMetadata = clientProvider.getClientMetadata();
for (ThriftMethodHandler methodHandler : clientMetadata.getMethodHandlers().values()) {
String name = format("com.facebook.swift.client:type=%s,clientName=%s,name=%s",
clientMetadata.getClientType(),
clientMetadata.getClientName(),
methodHandler.getName());
builder.put(ObjectName.getInstance(name), methodHandler);
}
}
return builder.build();