Beispiel #1
0
        private static void StartShreds(ShredStartupInfoList shredStartupInfoList)
        {
            if (null != shredStartupInfoList)
            {
                // create the data structure that will hold the shreds and their thread, etc. related objects
                foreach (ShredStartupInfo shredStartupInfo in shredStartupInfoList)
                {
                    if (null != shredStartupInfo)
                    {
                        // clone the shredStartupInfo structure into the current AppDomain, otherwise, once the StagingDomain
                        // has been unloaded, the shredStartupInfo structure will be destroyed
                        var newShredStartupInfo = new ShredStartupInfo(shredStartupInfo.AssemblyPath, shredStartupInfo.ShredName,
                                                                       shredStartupInfo.ShredTypeName, shredStartupInfo.IsolationLevel);

                        // create the controller that will allow us to start and stop the shred
                        var shredController = new ShredController(newShredStartupInfo);
                        _shredInfoList.Add(shredController);
                    }
                }
            }

            foreach (ShredController shredController in _shredInfoList)
            {
                shredController.Start();
            }
        }
Beispiel #2
0
        private void StartupShred(object threadData)
        {
            ShredController shredController = threadData as ShredController;
            IWcfShred       wcfShred        = shredController.Shred as IWcfShred;

            try
            {
                if (wcfShred != null)
                {
                    wcfShred.SharedHttpPort     = ShredHostServiceSettings.Instance.SharedHttpPort;
                    wcfShred.SharedTcpPort      = ShredHostServiceSettings.Instance.SharedTcpPort;
                    wcfShred.ServiceAddressBase = ShredHostServiceSettings.Instance.ServiceAddressBase;
                }

                BeginStartupTimer();

                shredController.Shred.Start();
            }
            catch (Exception e)
            {
                Platform.Log(LogLevel.Error, e, "Unexpected exception when starting up Shred {0}",
                             shredController.Shred.GetDescription());
            }
            finally
            {
                EndStartupTimer();
            }
        }
Beispiel #3
0
        private static void StartShreds(ShredStartupInfoList shredStartupInfoList)
        {
            if (null != shredStartupInfoList)
            {
                // create the data structure that will hold the shreds and their thread, etc. related objects
                foreach (ShredStartupInfo shredStartupInfo in shredStartupInfoList)
                {
                    if (null != shredStartupInfo)
                    {
                        // clone the shredStartupInfo structure into the current AppDomain, otherwise, once the StagingDomain 
                        // has been unloaded, the shredStartupInfo structure will be destroyed
                        ShredStartupInfo newShredStartupInfo = new ShredStartupInfo(shredStartupInfo.AssemblyPath, shredStartupInfo.ShredName, shredStartupInfo.ShredTypeName);
                        
                        // create the controller that will allow us to start and stop the shred
                        ShredController shredController = new ShredController(newShredStartupInfo);
                        _shredInfoList.Add(shredController);
                    }

                }
            }

            foreach (ShredController shredController in _shredInfoList)
            {
                shredController.Start();
            }
        }