Cross-layer Adaptation and Monitoring of Service-Based Applications