Design of active middleware protocols for coordination of distributed resources