예제 #1
0
        private IQueueStore GetStore()
        {
            if (_accessors.Configuration.TestMode)
            {
                return(new InMemoryQueueStore());
            }

#if !SILVERLIGHT
            if (!String.IsNullOrEmpty(_accessors.Configuration.QueuePath))
            {
                try {
                    var store = new FolderQueueStore(_accessors.Configuration.QueuePath, _accessors);
                    if (store.VerifyStoreIsUsable())
                    {
                        return(store);
                    }
                } catch (Exception ex) {
                    _accessors.Log.FormattedError(typeof(QueueManager), "Error trying to create folder store: {0}", ex.Message);
                }
            }
#endif

            try {
                var store = new IsolatedStorageQueueStore(_accessors.Configuration.StoreId, _accessors);
                if (store.VerifyStoreIsUsable())
                {
                    return(store);
                }
            } catch (Exception ex) {
                _accessors.Log.FormattedError(typeof(QueueManager), "Error trying to create isolated storage store: {0}", ex.Message);
            }

            _accessors.Log.Info("Using in memory store provider.", "QueueManger");
            return(new InMemoryQueueStore());
        }
예제 #2
0
 public void FolderQueueStore() {
     var store = new FolderQueueStore("dir", _accessor);
     ValidateStore(store);
 }
예제 #3
0
        private IQueueStore GetStore() {
            if (_accessors.Configuration.TestMode)
                return new InMemoryQueueStore();

#if !SILVERLIGHT
            if (!String.IsNullOrEmpty(_accessors.Configuration.QueuePath)) {
                try {
                    var store = new FolderQueueStore(_accessors.Configuration.QueuePath, _accessors);
                    if (store.VerifyStoreIsUsable())
                        return store;
                } catch (Exception ex) {
                    _accessors.Log.FormattedError(typeof(QueueManager), "Error trying to create folder store: {0}", ex.Message);
                }
            }
#endif

            try {
                var store = new IsolatedStorageQueueStore(_accessors.Configuration.StoreId, _accessors);
                if (store.VerifyStoreIsUsable())
                    return store;
            } catch (Exception ex) {
                _accessors.Log.FormattedError(typeof(QueueManager), "Error trying to create isolated storage store: {0}", ex.Message);
            }

            _accessors.Log.Info("Using in memory store provider.", "QueueManger");
            return new InMemoryQueueStore();
        }