use of com.googlecode.jmxtrans.connections.DatagramSocketFactory in project jmxtrans by jmxtrans.
the class StatsDWriter method start.
@Override
public void start() throws LifecycleException {
try {
pool = new GenericKeyedObjectPool<>(new DatagramSocketFactory());
pool.setTestOnBorrow(true);
pool.setMaxActive(-1);
pool.setMaxIdle(-1);
pool.setTimeBetweenEvictionRunsMillis(MILLISECONDS.convert(5, MINUTES));
pool.setMinEvictableIdleTimeMillis(MILLISECONDS.convert(5, MINUTES));
this.mbean = new ManagedGenericKeyedObjectPool((GenericKeyedObjectPool) pool, "StatsdConnectionPool");
ManagementFactory.getPlatformMBeanServer().registerMBean(this.mbean, this.mbean.getObjectName());
} catch (Exception e) {
throw new LifecycleException(e);
}
}
Aggregations