static ProcessControllerFacade() { GlobalEventSystemFacade.SubscribeToFlushEvent(args => Flush()); _controlledTypes.Add(typeof(IPublishControlled), typeof(IPublishProcessController)); _controlledTypes.Add(typeof(ILocalizedControlled), typeof(ILocalizeProcessController)); }
private void step5CodeActivity_RefreshTree_ExecuteCode(object sender, EventArgs e) { if (this.GetBinding <bool>("ReloadConsoleOnCompletion")) { ConsoleMessageQueueFacade.Enqueue(new RebootConsoleMessageQueueItem(), null); } if (this.GetBinding <bool>("FlushOnCompletion")) { GlobalEventSystemFacade.FlushTheSystem(); } SpecificTreeRefresher specificTreeRefresher = this.CreateSpecificTreeRefresher(); specificTreeRefresher.PostRefreshMesseges(new PackageElementProviderRootEntityToken()); if (this.GetBinding <bool>("ReloadConsoleOnCompletion") == false) { PackageElementProviderAvailablePackagesItemEntityToken castedEntityToken = (PackageElementProviderAvailablePackagesItemEntityToken)this.EntityToken; InstalledPackageInformation installedPackage = PackageManager.GetInstalledPackages().FirstOrDefault(f => f.Id == castedEntityToken.PackageId); var installedPackageEntityToken = new PackageElementProviderInstalledPackageItemEntityToken( installedPackage.Id, installedPackage.GroupName, installedPackage.IsLocalInstalled, installedPackage.CanBeUninstalled); ExecuteWorklow(installedPackageEntityToken, WorkflowFacade.GetWorkflowType("Composite.Plugins.Elements.ElementProviders.PackageElementProvider.ViewInstalledPackageInfoWorkflow")); } }
static BrowserRender() { GlobalEventSystemFacade.SubscribeToShutDownEvent(a => ShutdownPhantomJsExeSilent()); PackageInstaller.OnPackageInstallation += ShutdownPhantomJsExeSilent; FileChangeNotificator.Subscribe(PhantomServer.ScriptFilePath, (a, b) => PhantomServer.ShutDown(false)); }
static CodeGenerationManager() { string assemblyTempPath = null; try { assemblyTempPath = PathUtil.Resolve(GlobalSettingsFacade.GeneratedAssembliesDirectory); } catch { // NOTE: We don't want this static constructor fail if GlobalSettingsFacade failed to load. } if (assemblyTempPath != null) { if (!C1Directory.Exists(assemblyTempPath)) { C1Directory.CreateDirectory(assemblyTempPath); } } GlobalEventSystemFacade.SubscribeToFlushEvent(args => Flush()); GlobalEventSystemFacade.SubscribeToShutDownEvent(args => ClearOldTempFiles()); }
static DataFacadeReflectionCache() { GlobalEventSystemFacade.SubscribeToFlushEvent(args => Flush()); IQueryProvider_CreateQuery = typeof(IQueryProvider).GetMethods().First(m => m.Name == "CreateQuery" && m.IsGenericMethod); Queryable_AsQueryable = typeof(Queryable).GetMethods().First(m => m.Name == "AsQueryable" && m.IsGenericMethod); }
static XmlDataProviderDocumentWriter() { _autoCommitTimer = new System.Timers.Timer(_updateFrequency.TotalMilliseconds); _autoCommitTimer.AutoReset = true; _autoCommitTimer.Elapsed += new System.Timers.ElapsedEventHandler(OnAutoCommitTimer); _autoCommitTimer.Start(); GlobalEventSystemFacade.SubscribeToShutDownEvent(OnShutDownEvent); }
private void InvalidateCache() { lock (_calculationLock) { _hash = null; _lastFileChangeTime = null; } GlobalEventSystemFacade.FireDesignChangeEvent(); }
static StackifyTraceListener() { GlobalEventSystemFacade.SubscribeToPrepareForShutDownEvent(args => { StackifyAPILogger.Log("Composite C1 TraceListener shutting down"); MetricClient.StopMetricsQueue("Composite C1 TraceListener shutting down"); StackifyLogger.Shutdown(); }); }
public static void OnInitialized() { var hours = int.Parse(Config.SendEveryNHours); Log.LogInformation("Composite.Tools.LegacyUrlHandler", string.Format("Send404Mails Thread Timer Started(send emails every {0} hour)", Config.SendEveryNHours)); _timer = new Timer(Run, null, 60000, 900000); GlobalEventSystemFacade.SubscribeToPrepareForShutDownEvent(RunOnShutDown); Functions.DeleteOldBrokenLinks(); }
/// <exclude /> public void UpdateDataTypeDescriptor(DataTypeDescriptor dataTypeDescriptor, bool flushTheSystem) { dataTypeDescriptor.Validate(); DataMetaDataFacade.PersistMetaData(dataTypeDescriptor); if (flushTheSystem) { GlobalEventSystemFacade.FlushTheSystem(); } }
/// <exclude /> public void FunctionsUpdated() { if (SystemSetupFacade.SetupIsRunning) { return; } MetaFunctionProviderRegistry.ReinitializeFunctionFromProvider(this.ProviderName); GlobalEventSystemFacade.FireDesignChangeEvent(); }
static DataCachingFacade() { ReadSettings(); GlobalEventSystemFacade.SubscribeToFlushEvent(OnFlushEvent); DataEvents <IData> .OnStoreChanged += (sender, args) => { if (!args.DataEventsFired) { ClearCache(args.DataType, args.PublicationScope); } }; }
static DataMetaDataFacade() { GlobalEventSystemFacade.SubscribeToFlushEvent(args => Flush()); _metaDataPath = PathUtil.Resolve(GlobalSettingsFacade.DataMetaDataDirectory); if (!C1Directory.Exists(_metaDataPath)) { C1Directory.CreateDirectory(_metaDataPath); } UpdateFilenames(); }
/// <exclude /> static LoggingService() { MethodInfo getRuntimeResourceStringMethodInfo = typeof(Environment) .GetMethod("GetRuntimeResourceString", BindingFlags.NonPublic | BindingFlags.Static, null, new[] { typeof(string) }, null); // NOTE: "Magic" strings, shouldn't be modified BeginOfInnerExceptionMarker = "---> "; EndOfInnerExceptionMarker = Environment.NewLine + " " + (string)getRuntimeResourceStringMethodInfo.Invoke(null, new object[] { "Exception_EndOfInnerExceptionStack" }); ExceptionToStringInternal_MethodInfo = typeof(Exception).GetMethod("ToString", BindingFlags.Instance | BindingFlags.NonPublic); GlobalEventSystemFacade.SubscribeToFlushEvent(OnFlush); }
/// <exclude /> public static void Application_End(object sender, EventArgs e) { if (RuntimeInformation.IsDebugBuild) { Log.LogInformation(_verboseLogEntryTitle, "AppDomain {0} ended at {1} in process {2}", AppDomain.CurrentDomain.Id, DateTime.Now.ToString("HH:mm:ss:ff"), Process.GetCurrentProcess().Id); } if (!SystemSetupFacade.IsSystemFirstTimeInitialized) { return; } using (ThreadDataManager.Initialize()) { try { CodeGenerationManager.ValidateCompositeGenerate(_startTime); CodeGenerationManager.GenerateCompositeGeneratedAssembly(); } catch (Exception ex) { Log.LogCritical("Global.asax", "Error updating Composite.Generated.dll"); Log.LogCritical("Global.asax", ex); } try { GlobalEventSystemFacade.PrepareForShutDown(); if (RuntimeInformation.IsDebugBuild) { LogShutDownReason(); } GlobalEventSystemFacade.ShutDownTheSystem(); TempDirectoryFacade.OnApplicationEnd(); } catch (Exception ex) { Log.LogCritical("Global.asax", ex); throw; } Log.LogVerbose("Global.asax", string.Format("--- Web Application End, {0} Id = {1}---", DateTime.Now.ToLongTimeString(), AppDomain.CurrentDomain.Id)); } }
private void step3CodeActivity_RefreshTree_ExecuteCode(object sender, EventArgs e) { if (this.GetBinding<bool>("ReloadConsoleOnCompletion")) { ConsoleMessageQueueFacade.Enqueue(new RebootConsoleMessageQueueItem(), null); } if (this.GetBinding<bool>("FlushOnCompletion")) { GlobalEventSystemFacade.FlushTheSystem(); } SpecificTreeRefresher specificTreeRefresher = this.CreateSpecificTreeRefresher(); specificTreeRefresher.PostRefreshMesseges(new PackageElementProviderRootEntityToken()); }
public static void Initialize() { if (!_initialized) { lock (_lock) { if (!_initialized) { GlobalEventSystemFacade.SubscribeToFlushEvent(OnFlushEvent); AppDomain.CurrentDomain.AssemblyResolve += OnAssemblyResolve; _initialized = true; } } } }
/// <exclude /> public void DropStore(string providerName, DataTypeDescriptor typeDescriptor, bool makeAFlush) { Verify.ArgumentNotNullOrEmpty(providerName, "providerName"); Verify.ArgumentNotNull(typeDescriptor, "typeDescriptor"); typeDescriptor.Validate(); using (var transactionScope = TransactionsFacade.CreateNewScope()) { DataProviderPluginFacade.DropStore(providerName, typeDescriptor); DataMetaDataFacade.DeleteMetaData(typeDescriptor.DataTypeId); transactionScope.Complete(); } if (makeAFlush) { GlobalEventSystemFacade.FlushTheSystem(); } }
/// <exclude /> public override void Uninstall() { Verify.IsNotNull(_dataTypeDescriptorsToDelete, "DynamicDataTypePackageFragmentUninstaller has not been validated"); bool flushTheSystem = false; foreach (DataTypeDescriptor dataTypeDescriptor in _dataTypeDescriptorsToDelete) { Log.LogVerbose(this.GetType().Name, "Uninstalling the type '{0}'", dataTypeDescriptor); GeneratedTypesFacade.DeleteType(dataTypeDescriptor, false); flushTheSystem = true; } if (flushTheSystem) { GlobalEventSystemFacade.FlushTheSystem(true); } }
public static void Initialize() { SubscribeToDataEvents(); var cts = new CancellationTokenSource(); var task = Task.Run(() => WaitForWriteLockAndStartServiceBusListener(cts.Token)); GlobalEventSystemFacade.SubscribeToPrepareForShutDownEvent(args => { try { cts.Cancel(); task.Wait(WaitingTimeForCancellationToFinishInMs); } catch (Exception ex) { Log.LogError(nameof(SitemapEventRegistrator), ex); } }); }
public override IEnumerable <XElement> Install() { if (_updates == null) { throw new InvalidOperationException(GetType().Name + " has not been validated"); } foreach (var kvp in _updates) { var oldDataTypeDescriptor = kvp.Key; var newDataTypeDescriptor = kvp.Value; var updateDescriptor = new UpdateDataTypeDescriptor(oldDataTypeDescriptor, newDataTypeDescriptor); GeneratedTypesFacade.UpdateType(updateDescriptor); } GlobalEventSystemFacade.FlushTheSystem(); return(Configuration); }
public static void Initialize() { if (_initialized) { return; } lock (_lock) { if (_initialized) { return; } GlobalEventSystemFacade.SubscribeToFlushEvent(args => ClearAssemblyList()); AppDomain.CurrentDomain.AssemblyResolve += OnAssemblyResolve; AppDomain.CurrentDomain.AssemblyLoad += OnAssemblyLoad; _initialized = true; } }
/// <exclude /> public override IEnumerable <XElement> Install() { Verify.IsNotNull(_typesToInstall, "DataTypePackageFragmentInstaller has not been validated"); string typeNames = string.Join(", ", _typesToInstall.Select(t => t.GetFullInterfaceName())); Log.LogVerbose(this.GetType().Name, "Installing types: '{0}'", typeNames); DynamicTypeManager.CreateStores(_typesToInstall, false); var typeElements = new List <XElement>(); foreach (var dataTypeDescriptor in _typesToInstall) { var typeElement = new XElement("Type", new XAttribute("typeId", dataTypeDescriptor.DataTypeId)); typeElements.Add(typeElement); } GlobalEventSystemFacade.FlushTheSystem(true); yield return(new XElement("Types", typeElements)); }
/// <exclude /> public static void TransformConfiguration(Func <XDocument, bool> transformer) { using (GlobalInitializerFacade.CoreLockScope) { lock (_lock) { XDocument document = XDocumentUtils.Load(ConfigurationServices.FileConfigurationSourcePath); if (transformer(document)) { ValidateConfigurationFile(document); // Kill monitoring of file changes: // FileConfigurationSource.ResetImplementation(ConfigurationServices.FileConfigurationSourcePath, false); document.SaveToFile(ConfigurationServices.FileConfigurationSourcePath); _configurationSource = new FileConfigurationSource(ConfigurationServices.FileConfigurationSourcePath); // Kill monitoring of file changes: // FileConfigurationSource.ResetImplementation(ConfigurationServices.FileConfigurationSourcePath, false); GlobalEventSystemFacade.ShutDownTheSystem(); } } } }
/// <exclude /> public void CreateStores(string providerName, IReadOnlyCollection <DataTypeDescriptor> typeDescriptors, bool doFlush) { Verify.ArgumentNotNullOrEmpty(providerName, "providerName"); Verify.ArgumentNotNull(typeDescriptors, "typeDescriptors"); typeDescriptors.ForEach(d => d.Validate()); using (var transactionScope = TransactionsFacade.CreateNewScope()) { foreach (var typeDescriptor in typeDescriptors) { DataMetaDataFacade.PersistMetaData(typeDescriptor); } DataProviderPluginFacade.CreateStores(providerName, typeDescriptors); transactionScope.Complete(); } if (doFlush) { GlobalEventSystemFacade.FlushTheSystem(); } }
static WorkflowRuntimeProviderRegistry() { GlobalEventSystemFacade.SubscribeToFlushEvent(OnFlushEvent); }
static SerializationFacade() { GlobalEventSystemFacade.SubscribeToFlushEvent(OnFlushEvent); }
static EmptyDataClassTypeManager() { GlobalEventSystemFacade.SubscribeToFlushEvent(OnFlushEvent); }
static GlobalInitializerFacade() { GlobalEventSystemFacade.SubscribeToFlushEvent(OnFlushEvent); }
/// <exclude /> public static void FatalResetTheSystem() { Log.LogWarning(LogTitle, "Unhandled error occurred, reinitializing the system!"); ReinitializeTheSystem(delegate() { _fatalErrorFlushCount++; GlobalEventSystemFacade.FlushTheSystem(); }); }