Esempio n. 1
0
 private void DoAutoRollback()
 {
     lock (_locker)
     {
         foreach (var pair in _packages)
         {
             RemotePackage package = pair.Value;
             package.AutoRollback();
         }
     }
 }
Esempio n. 2
0
 public string Invoke(string filePath)
 {
     string cookie = Guid.NewGuid().ToString("N");
     RemotePackage package = new RemotePackage(_ginRoot, cookie, filePath);
     lock (_locker)
     {
         _packages.Add(cookie, package);
     }
     package.Invoke();
     return cookie;
 }
Esempio n. 3
0
        public string Invoke(string filePath)
        {
            string        cookie  = Guid.NewGuid().ToString("N");
            RemotePackage package = new RemotePackage(_ginRoot, cookie, filePath);

            lock (_locker)
            {
                _packages.Add(cookie, package);
            }
            package.Invoke();
            return(cookie);
        }
Esempio n. 4
0
        private void LoadCookies()
        {
            string cookiesPath = Path.Combine(_ginRoot, COOKIES_PATH);

            string[] cookiePaths = Directory.GetDirectories(cookiesPath);
            _packages = new Dictionary <string, RemotePackage>();
            foreach (string cookiePath in cookiePaths)
            {
                string        cookie = cookiePath.Split('\\').Last();
                RemotePackage rp     = new RemotePackage(_ginRoot, cookie, null);
                lock (_locker)
                {
                    _packages.Add(cookie, rp);
                }
            }
        }
Esempio n. 5
0
 private void LoadCookies()
 {
     string cookiesPath = Path.Combine(_ginRoot, COOKIES_PATH);
     string[] cookiePaths = Directory.GetDirectories(cookiesPath);
     _packages = new Dictionary<string, RemotePackage>();
     foreach (string cookiePath in cookiePaths)
     {
         string cookie = cookiePath.Split('\\').Last();
         RemotePackage rp = new RemotePackage(_ginRoot, cookie, null);
         lock (_locker)
         {
             _packages.Add(cookie, rp);
         }
     }
 }
Esempio n. 6
0
        public void Abort(string cookie)
        {
            RemotePackage package = GetPackage(cookie);

            package.Abort();
        }
Esempio n. 7
0
        public RemotePackageState GetState(string cookie)
        {
            RemotePackage package = GetPackage(cookie);

            return(package.GetState());
        }
Esempio n. 8
0
        public void Rollback(string cookie)
        {
            RemotePackage package = GetPackage(cookie);

            package.Rollback();
        }
Esempio n. 9
0
        public void Commit(string cookie)
        {
            RemotePackage package = GetPackage(cookie);

            package.Commit();
        }