Class ResourceRegistryStandardImpl

  • All Implemented Interfaces:
    ResourceRegistry

    public final class ResourceRegistryStandardImpl
    extends Object
    implements ResourceRegistry
    Helps to track statements and resultsets which need being closed. This class is not threadsafe.

    Note regarding performance: we had evidence that allocating Iterators to implement the cleanup on each element recursively was the dominant resource cost, so we decided using "forEach" and lambdas in this case. However the forEach/lambda combination is able to dodge allocating Iterators on HashMap and ArrayList, but not on HashSet (at least on JDK8 and 11). Therefore some types which should ideally be modelled as a Set have been implemented using HashMap.