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 allows you to 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, then 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:

resourceClassName=atg.resources.ReallyExpensiveObject

Now whenever the resource pool requires a new object, it will call new atg.resources.ReallyExpensiveObject(). When the resource is no longer needed, the resource pool simply discards the object without calling any special notification methods.

 
loading table of contents...