コード例 #1
0
        private static Dictionary <string, Dictionary <string, MessageQueue> > GetErrorQueues(ComponentRunState runState)
        {
            if (runState == null || runState.SerializedState == null)
            {
                return(null);
            }

            try
            {
                MemoryStream    stream = new MemoryStream(runState.SerializedState);
                ErrorQueueState state  = MySpace.Common.IO.Serializer.Deserialize <ErrorQueueState>(stream, false);

                if (state != null)
                {
                    return(state.ErrorQueues);
                }

                return(null);
            }
            catch (Exception ex)
            {
                if (_log.IsErrorEnabled)
                {
                    _log.ErrorFormat("Exception getting Error Queues from Run State: {0}", ex);
                }
                return(null);
            }
        }
コード例 #2
0
        /// <summary>
        /// Returns a ComponentRunState with any existing error queues, so that they can be persisted through
        /// AppDomain reloads.
        /// </summary>
        public ComponentRunState GetRunState()
        {
            ComponentRunState runState = new ComponentRunState(GetComponentName());
            Dictionary <string, Dictionary <string, MessageQueue> > errorQueues = NodeManager.Instance.GetErrorQueues();
            ErrorQueueState state = new ErrorQueueState {
                ErrorQueues = errorQueues
            };

            runState.SerializedState = MySpace.Common.IO.Serializer.Serialize(state, false);
            return(runState);
        }
コード例 #3
0
		/// <summary>
		/// Returns a ComponentRunState with any existing error queues, so that they can be persisted through
		/// AppDomain reloads.
		/// </summary>		
		public ComponentRunState GetRunState()
		{
			ComponentRunState runState = new ComponentRunState(GetComponentName());
			Dictionary<string, Dictionary<string, MessageQueue>> errorQueues = NodeManager.Instance.GetErrorQueues();
			ErrorQueueState state = new ErrorQueueState {ErrorQueues = errorQueues};
			runState.SerializedState = MySpace.Common.IO.Serializer.Serialize(state, false);
			return runState;
		}