--HG--
branch : dev
This commit is contained in:
Bertrand Le Roy
2010-07-28 18:17:42 -07:00
3 changed files with 20 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
<MSDeploy.iisApp> <MSDeploy.iisApp>
<iisapp path="Orchard" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated"/> <iisapp path="Orchard" managedRuntimeVersion="v4.0" />
<setAcl path="Orchard/App_Data" setAclAccess="Modify" /> <setAcl path="Orchard/App_Data" setAclAccess="Modify" />
<setAcl path="Orchard/Media" setAclAccess="Modify" /> <setAcl path="Orchard/Media" setAclAccess="Modify" />
</MSDeploy.iisApp> </MSDeploy.iisApp>

View File

@@ -21,6 +21,7 @@ namespace Orchard.Environment {
private readonly ControllerBuilder _controllerBuilder; private readonly ControllerBuilder _controllerBuilder;
private readonly IShellSettingsManager _shellSettingsManager; private readonly IShellSettingsManager _shellSettingsManager;
private readonly IShellContextFactory _shellContextFactory; private readonly IShellContextFactory _shellContextFactory;
private readonly IShellDescriptorCache _shellDescriptorCache;
private readonly IRunningShellTable _runningShellTable; private readonly IRunningShellTable _runningShellTable;
private readonly IProcessingEngine _processingEngine; private readonly IProcessingEngine _processingEngine;
private readonly IExtensionLoaderCoordinator _extensionLoaderCoordinator; private readonly IExtensionLoaderCoordinator _extensionLoaderCoordinator;
@@ -32,6 +33,7 @@ namespace Orchard.Environment {
public DefaultOrchardHost( public DefaultOrchardHost(
IShellSettingsManager shellSettingsManager, IShellSettingsManager shellSettingsManager,
IShellContextFactory shellContextFactory, IShellContextFactory shellContextFactory,
IShellDescriptorCache shellDescriptorCache,
IRunningShellTable runningShellTable, IRunningShellTable runningShellTable,
IProcessingEngine processingEngine, IProcessingEngine processingEngine,
IExtensionLoaderCoordinator extensionLoaderCoordinator, IExtensionLoaderCoordinator extensionLoaderCoordinator,
@@ -40,6 +42,7 @@ namespace Orchard.Environment {
_shellSettingsManager = shellSettingsManager; _shellSettingsManager = shellSettingsManager;
_shellContextFactory = shellContextFactory; _shellContextFactory = shellContextFactory;
_shellDescriptorCache = shellDescriptorCache;
_runningShellTable = runningShellTable; _runningShellTable = runningShellTable;
_processingEngine = processingEngine; _processingEngine = processingEngine;
_extensionLoaderCoordinator = extensionLoaderCoordinator; _extensionLoaderCoordinator = extensionLoaderCoordinator;
@@ -149,6 +152,7 @@ namespace Orchard.Environment {
_cacheManager.Get("OrchardHost_Extensions", _cacheManager.Get("OrchardHost_Extensions",
ctx => { ctx => {
_extensionLoaderCoordinator.MonitorExtensions(ctx.Monitor); _extensionLoaderCoordinator.MonitorExtensions(ctx.Monitor);
_shellDescriptorCache.Monitor(ctx.Monitor);
_current = null; _current = null;
return ""; return "";
}); });

View File

@@ -2,6 +2,7 @@
using System.IO; using System.IO;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using System.Xml; using System.Xml;
using Orchard.Caching;
using Orchard.Environment.Descriptor.Models; using Orchard.Environment.Descriptor.Models;
using Orchard.FileSystems.AppData; using Orchard.FileSystems.AppData;
using Orchard.Localization; using Orchard.Localization;
@@ -26,6 +27,11 @@ namespace Orchard.Environment.Descriptor {
/// Loss of storage is expected. /// Loss of storage is expected.
/// </summary> /// </summary>
void Store(string shellName, ShellDescriptor descriptor); void Store(string shellName, ShellDescriptor descriptor);
/// <summary>
/// Monitor changes on the persistent storage.
/// </summary>
void Monitor(Action<IVolatileToken> monitor);
} }
public class ShellDescriptorCache : IShellDescriptorCache { public class ShellDescriptorCache : IShellDescriptorCache {
@@ -98,6 +104,10 @@ namespace Orchard.Environment.Descriptor {
_appDataFolder.CreateFile(DescriptorCacheFileName, saveWriter.ToString()); _appDataFolder.CreateFile(DescriptorCacheFileName, saveWriter.ToString());
} }
public void Monitor(Action<IVolatileToken> monitor) {
monitor(_appDataFolder.WhenPathChanges(DescriptorCacheFileName));
}
#endregion #endregion
private void VerifyCacheFile() { private void VerifyCacheFile() {