public Object create() {
return "";
}
});
Pool pool = builder.build();
pool.start();
pool.add("");
pool.add("");
pool.add("");
pool.add("");
pool.add("");
pool.add("");
Map<String, String> map = new HashMap<String, String>();
map.put("EJBModule", "FooModule");
map.put("J2EEApplication", "FooApp");
map.put("J2EEServer", "FooServer");
map.put("j2eeType", "StatelessSessionBean");
map.put("name", "Pool");
ObjectName objectName = new ObjectName("something", new Hashtable(map));
server.registerMBean(new ManagedMBean(pool), objectName);
// while ("".equals("")) {
// object.tick(System.currentTimeMillis() % 1000);
// Thread.sleep(287);
// }
// server.createMBean()
while (true) {
List<Pool.Entry> entries = new ArrayList<Pool.Entry>();
try {
while (true) {
entries.add(pool.pop(1, TimeUnit.SECONDS));
snooze();
}
} catch (TimeoutException e) {
}
for (Pool.Entry entry : entries) {
pool.push(entry);
snooze();
}
}
// new CountDownLatch(1).await();