Exemplo n.º 1
0
        /// 
        /// <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];
        }
Exemplo n.º 2
0
 //---------------------------------------------------------------
 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;
     }
 }
Exemplo n.º 3
0
 public void Add(Domain dom)
 {
     domains.Add(dom);
 }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
 public static Participant GetInstance(Domain domain, string participantID)
 {
     return participantFactory.GetParticipant(domain, participantID);
 }