As peer-to-peer systems are evolving from simplistic application specific overlays to middleware platforms hosting a range of potential applications it has become evident that increasingly configurable approaches are required to ensure appropriate overlay support is provided for divergent applications. This is exacerbated by the increasing heterogeneity of networked devices expected to host the overlay. Traditional adaptation approaches rely on simplistic design-time isolated fine-tuning of overlay operations. This, however, cannot fully support the level of configurability required by next generation peer-to-peer systems. To remedy this, a middleware overlay framework is designed that promotes the use of architectural reconfiguration for adaptive purposes. Underpinning this is a generic reusable component pattern that utilises software reflection to enable rich and extensible adaptation of overlays beneath divergent applications operating in heterogeneous environments. This is evaluated through a number of case-study experiments showing how overlays developed using the framework have been adapted to address a range of application and environmental variations.