}
}
public void testWithPool()
{
final AbstractPoolablePool pool =
new AbstractPoolablePool("test")
{
public Object newInstance()
{
return new StructuredEventMessage();
}
};
pool.configure(null);
Work[] worker = new Work[4];
for (int i = 0; i < worker.length; ++i)
{
worker[i] = new Work()
{
public StructuredEventMessage createStructuredEventMessage()
{
return (StructuredEventMessage) pool.lendObject();
}
};
new Thread(worker[i]).start();
}