use of org.cloudfoundry.reactor.util.ByteBufAllocatorMetricProviderWrapper in project cf-java-client by cloudfoundry.
the class _DefaultConnectionContext method monitorByteBufAllocator.
@PostConstruct
void monitorByteBufAllocator() {
try {
ObjectName name = getByteBufAllocatorObjectName();
if (ManagementFactory.getPlatformMBeanServer().isRegistered(name)) {
this.logger.warn("MBean '{}' is already registered and will be removed. You should only have a single DefaultConnectionContext per endpoint.", name);
ManagementFactory.getPlatformMBeanServer().unregisterMBean(name);
}
ManagementFactory.getPlatformMBeanServer().registerMBean(new ByteBufAllocatorMetricProviderWrapper(PooledByteBufAllocator.DEFAULT), name);
} catch (JMException e) {
this.logger.error("Unable to register ByteBufAllocator MBean", e);
}
}
Aggregations