Traditionally, distributed resource management/scheduling systems for the Grid (e.g. Globus/GRAM/Condor-G) have tended to deal with coarse-grained and concrete resource types (e.g. compute nodes and disks), to be statically configured and non-extensible, and to be non-adaptive at runtime. In this paper, we present a new resource management framework that tries to overcome these limitations. The framework, which is part of our 'Gridkit' middleware platform, uniformly accommodates an extensible set of resource types that may be both fine-grained (such as threads and TCP/IP connections), and abstract (i.e. represent application-level concepts such as matrix containers). In addition, it is highly configurable and extensible in terms of pluggable strategies, and supports flexible runtime adaptation to fluctuating application demand and resource availability. As a key contribution, the notion of tasks enables resource requirements to be expressed orthogonally to the structure of the application, allowing intuitive application-level QoS/resource specification, highly flexible mappings of applications to available distributed infrastructures, and also facilitates autonomic adaptation.