Global protocols as first class entities for self-adaptive agents