10.07.2015 Views

pdf - 395 K - Ecole des mines de Nantes

pdf - 395 K - Ecole des mines de Nantes

pdf - 395 K - Ecole des mines de Nantes

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

}}}table[agentId] = address;}}/// /// Unregisters an IAgent. Does nothing is it is not registered/// /// public void Unregister(AgentId agentId){Debug.Assert(agentId != null);lock(table){if (table.Contains(agentId)){table.Remove(agentId);}}}4. Class MAP.DirectoryFacilitatorusing System;using System.Collections;using System.Diagnostics;using System.Runtime.Remoting;using System.Runtime.Remoting.Channels;using System.Runtime.Remoting.Channels.Http;namespace MAP{/// /// Directory Facilitator: helps service consumers find serviceprovi<strong>de</strong>rs./// The singleton DF resi<strong><strong>de</strong>s</strong> on the main host only. Other hosts use aproxy and/// synchronized remote calls to the instance on the main host./// public class DirectoryFacilitator : MarshalByRefObject // For remoteaccess{//****** STATIC PART ******// The unique instance.private static DirectoryFacilitator Instance;// Remoting parametersprivate static readonly string FUNCTION = "DF";/// /// Returns the singleton instance./// /// public static DirectoryFacilitator GetDF(){if (Instance == null) Install();MSc EMOOSE Thesis – http://www.emn.fr/EMOOSE 75

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!