示例#1
0
 public void BeforeSendReply(ref Message reply, object correlationState)
 {
     TraceHelper.Current.DebugMessage("Entering FormatSupportInspector: BeforeSendReply");
     TraceHelper.Current.RequestEnd();
     if (DataServiceController.IsCurrentInstancePresent())
     {
         DataServiceController.Current.PerfCounters.ActiveRequests.Decrement();
     }
 }
 public static void DeleteDataServiceController()
 {
     lock (DataServiceController.syncObject)
     {
         if (DataServiceController.current != null)
         {
             DataServiceController.current.PerfCounters.Dispose();
             DataServiceController.current = null;
         }
     }
 }
        public static void CreateDataServiceController(DSConfiguration settings, CustomAuthorizationHandler.ICustomContextStore customContextStore, ISchemaBuilder testSchemaBuilder)
        {
            string filePath;

            lock (DataServiceController.syncObject)
            {
                Configuration configuration = null;
                if (settings == null)
                {
                    try
                    {
                        settings = DSConfiguration.GetSection(configuration);
                    }
                    catch (Exception exception1)
                    {
                        Exception exception = exception1;
                        Microsoft.Management.Odata.Tracing.Tracer current = TraceHelper.Current;
                        string str = "config file is ";
                        if (configuration == null)
                        {
                            filePath = "(not available)";
                        }
                        else
                        {
                            filePath = configuration.FilePath;
                        }
                        current.DebugMessage(string.Concat(str, filePath));
                        if (TraceHelper.IsEnabled(5))
                        {
                            TraceHelper.Current.DebugMessage(exception.ToTraceMessage("DataServiceController failed to create"));
                        }
                        TraceHelper.Current.DataServiceControllerCreationFailedOperational(exception.Message);
                        throw;
                    }
                }
                DataServiceController.current = new DataServiceController(settings, customContextStore, testSchemaBuilder);
            }
        }
示例#4
0
		public static void DeleteDataServiceController()
		{
			lock (DataServiceController.syncObject)
			{
				if (DataServiceController.current != null)
				{
					DataServiceController.current.PerfCounters.Dispose();
					DataServiceController.current = null;
				}
			}
		}
示例#5
0
		public static void CreateDataServiceController(DSConfiguration settings, CustomAuthorizationHandler.ICustomContextStore customContextStore, ISchemaBuilder testSchemaBuilder)
		{
			string filePath;
			lock (DataServiceController.syncObject)
			{
				Configuration configuration = null;
				if (settings == null)
				{
					try
					{
						settings = DSConfiguration.GetSection(configuration);
					}
					catch (Exception exception1)
					{
						Exception exception = exception1;
						Microsoft.Management.Odata.Tracing.Tracer current = TraceHelper.Current;
						string str = "config file is ";
						if (configuration == null)
						{
							filePath = "(not available)";
						}
						else
						{
							filePath = configuration.FilePath;
						}
						current.DebugMessage(string.Concat(str, filePath));
						if (TraceHelper.IsEnabled(5))
						{
							TraceHelper.Current.DebugMessage(exception.ToTraceMessage("DataServiceController failed to create"));
						}
						TraceHelper.Current.DataServiceControllerCreationFailedOperational(exception.Message);
						throw;
					}
				}
				DataServiceController.current = new DataServiceController(settings, customContextStore, testSchemaBuilder);
			}
		}
 public static void CreateDataServiceController(DSConfiguration settings, CustomAuthorizationHandler.ICustomContextStore customContextStore)
 {
     DataServiceController.CreateDataServiceController(settings, customContextStore, null);
 }