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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

public static bool ProcessIsMainHost(){return GetMainHostName() == "localhost";}resources/// /// Uninstalls the agent infrastructure by cleaning up/// (for example MSMQ queues)./// public static void Uninstall(){MessageTransporter.Uninstall();}}}// Class cannot be instantiatedprivate Middleware() {}2. Class MAP.MessageTransporter#<strong>de</strong>fine MULTI_PROCESSES // For testing several platforms on the samemachineusing System;using System.Diagnostics;using System.Collections;using System.Messaging;namespace MAP{/// /// The MessageTransporter provi<strong><strong>de</strong>s</strong> facilities for <strong>de</strong>liveringMessages to their/// recipient. Agents have to register to their MT in or<strong>de</strong>r toreceive an ID that/// allows them to receive Messages by the mean of the 'Recipient'property./// There is one instance of MT per machine. Each instance has a MSMQqueue for/// receiving messages from other machines./// public class MessageTransporter{// The singleton instanceprivate static MessageTransporter instance;Messages./// /// Defines the path of a MSMQ MessageQueue for IAgent/// /// /// /// private static string MakePath(string computer, string process){string path = computer + "\\private$\\agentmt";#if MULTI_PROCESSESpath += process;#endifMSc EMOOSE Thesis – http://www.emn.fr/EMOOSE 67

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

Saved successfully!

Ooh no, something went wrong!