The previous sections demonstrated how to subclass ResourcePool to create the type of resource object to be managed by your pool. The ResourcePool class provides a shortcut that lets you create resource objects without subclassing ResourcePool. You can use this shortcut if your resource object fits the following criteria:

If your resource object fits these criteria, you can use the base ResourcePool class without defining a subclass. To do this, specify an extra property called resourceClassName. This property should define the full class name of the resource object. For example:


Now, whenever the resource pool requires a new object, it calls:

new atg.resources.ReallyExpensiveObject()

When the resource is no longer needed, the resource pool simply discards the object without calling any special notification methods.