use of com.jim.framework.activemq.producer.JimPooledConnectionFactory in project jim-framework by jiangmin168168.
the class ProductController method test.
@RequestMapping("/test/{productId}")
public Long test(@PathVariable final long productId) {
productProducer.sendMessage(productId);
Map<String, PooledConnectionFactory> pooledConnectionFactoryMap = ConnectionFactoryContainer.getAllPooledConnectionFactory();
for (Map.Entry<String, PooledConnectionFactory> entry : pooledConnectionFactoryMap.entrySet()) {
JimPooledConnectionFactory jimPooledConnectionFactory = (JimPooledConnectionFactory) entry.getValue();
// jimPooledConnectionFactory.setExpiryTimeout();
GenericKeyedObjectPool<ConnectionKey, ConnectionPool> jimConnectionsPool = ((JimPooledConnectionFactory) entry.getValue()).getJimConnectionsPool();
// jimConnectionsPool.
jimConnectionsPool.clearOldest();
// jimConnectionsPool.set
Map<String, List<DefaultPooledObjectInfo>> defStringListMap = jimConnectionsPool.listAllObjects();
for (Map.Entry<String, List<DefaultPooledObjectInfo>> entry1 : defStringListMap.entrySet()) {
List<DefaultPooledObjectInfo> defaultPooledObjectInfos = entry1.getValue();
System.out.println("123");
for (DefaultPooledObjectInfo defaultPooledObjectInfo : defaultPooledObjectInfos) {
// defaultPooledObjectInfo.
System.out.println("123");
// ((ConnectionPool)defaultPooledObjectInfo.pooledObject.getObject()).connection;
}
}
// jimConnectionsPool.get
System.out.println("123");
// ((ObjectDeque)((java.util.concurrent.ConcurrentHashMap.MapEntry)((java.util.concurrent.ConcurrentHashMap)jimConnectionsPool.poolMap).entrySet().toArray()[0]).getValue()).allObjects
}
return productId;
}
Aggregations