/// /// <param name="domain"></param> /// <param name="participantID"></param> internal Participant GetParticipant(Domain domain, string participantID) { string hashKey = domain.GetDomainID() + " " + participantID; if (!instances.ContainsKey(hashKey)) { Participant newInst = new Participant(domain, participantID); Domain tDomain = newInst.getDomain(); if (tDomain != null) { instances.Add(hashKey, newInst); } else { return null; } } return instances[hashKey]; }
//--------------------------------------------------------------- public Participant(string domainID, string participantID, string configFile) { Interlocked.Increment(ref safeInstanceCount); ///TEST this.domainID = domainID; this.participantID = participantID; try { if (configFile == "") { this.config = OPSConfig.GetConfig(); this.domain = this.config.GetDomain(domainID); } else { this.config = OPSConfig.GetConfig(configFile); this.domain = this.config.GetDomain(domainID); } if (this.domain != null) { this.inProcessTransport.Start(); SetupCyclicThread(); } else { Logger.ExceptionLogger.LogMessage(this.GetType().Name + ", Failed to find requested domain in configuration file"); throw new System.Exception("Failed to find requested domain in configuration file"); } } catch (IOException) { Logger.ExceptionLogger.LogMessage(this.GetType().Name + ", Configuration file missing"); throw; } catch (Ops.FormatException) { Logger.ExceptionLogger.LogMessage(this.GetType().Name + ", Format error in configuration file"); throw; } }
public void Add(Domain dom) { domains.Add(dom); }
public Participant(Domain domain, string participantID) { Interlocked.Increment(ref safeInstanceCount); ///TEST this.domainID = domain.GetDomainID(); this.participantID = participantID; this.domain = domain; this.inProcessTransport.Start(); SetupCyclicThread(); }
public static Participant GetInstance(Domain domain, string participantID) { return participantFactory.GetParticipant(domain, participantID); }