public Context(DefaultMessageManager manager, String domain)
            {
                _mManager = manager;

                _mTree  = new DefaultMessageTree();
                _mStack = new ThreadSafeStack <ITransaction>();

                Thread thread    = Thread.CurrentThread;
                String groupName = Thread.GetDomain().FriendlyName;

                _mTree.ThreadGroupName = groupName;
                _mTree.ThreadId        = thread.ManagedThreadId.ToString();
                _mTree.ThreadName      = thread.Name;

                _mTree.Domain = domain;
                // _mTree.HostName = hostName;
                // _mTree.IpAddress = ipAddress;

                _mLength = 1;

                _mKnownExceptions = new HashSet <Exception>();
            }
 public TransactionHelper(DefaultMessageManager manager)
 {
     _mManager = manager;
 }
Пример #3
0
 public TransactionHelper(DefaultMessageManager manager)
 {
     _mManager = manager;
 }
Пример #4
0
        public static void Initialize()
        {
            try
            {
                if (Instance._mInitialized)
                {
                    return;
                }

                DefaultMessageManager manager = new DefaultMessageManager();

                var configFilePath = System.Configuration.ConfigurationManager.AppSettings[CatConstants.LOCAL_CLIENT_CONFIG];
                AbstractClientConfig config;
                if (String.IsNullOrWhiteSpace(configFilePath))
                {
                    configFilePath = @"D:\data\appdatas\cat\client.xml";
                }
                config = new LocalClientConfig(configFilePath);

                manager.Initialize(config);
                Instance._mProducer = new DefaultMessageProducer(manager);
                Instance._mManager = manager;
                Instance._mInitialized = true;
            }
            catch (Exception ex) {
                Instance._mProducer = new NullMessageProducer();
                Instance._mManager = new NullMessageManager();
                Cat.lastException = ex;
                Instance._mInitialized = true;
            }
        }
Пример #5
0
            public Context(DefaultMessageManager manager, String domain)
            {
                _mManager = manager;

                _mTree = new DefaultMessageTree();
                _mStack = new Stack<ITransaction>();

                Thread thread = Thread.CurrentThread;
                String groupName = Thread.GetDomain().FriendlyName;

                _mTree.ThreadGroupName = groupName;
                _mTree.ThreadId = thread.ManagedThreadId.ToString();
                _mTree.ThreadName = thread.Name;

                _mTree.Domain = domain;
                // _mTree.HostName = hostName;
                // _mTree.IpAddress = ipAddress;

                _mLength = 1;

                _mKnownExceptions = new HashSet<Exception>();
            }