// Token: 0x0600115D RID: 4445 RVA: 0x00042A40 File Offset: 0x00040C40
        private static void InitializeApplicationCaches()
        {
            HttpContext     httpContext         = HttpContext.Current;
            HttpApplication applicationInstance = httpContext.ApplicationInstance;

            ADIdentityInformationCache.Initialize(4000);
            applicationInstance.Application["WS_APPWideMailboxCacheKey"] = new AppWideStoreSessionCache();
            applicationInstance.Application["WS_AcceptedDomainCacheKey"] = new AcceptedDomainCache();
            int maxThreadCount = 10 * Environment.ProcessorCount;

            Global.BudgetType = BudgetType.Owa;
            Global.BulkOperationBudgetType           = BudgetType.OwaBulkOperation;
            Global.NonInteractiveOperationBudgetType = BudgetType.OwaNonInteractiveOperation;
            Global.NonInteractiveThrottlingEnabled   = true;
            Global.NonInteractiveOperationMethods    = OwaApplication.owaNonInteractiveMethodNames;
            UserWorkloadManager.Initialize(maxThreadCount, 500, 500, TimeSpan.FromMinutes(5.0), null);
            applicationInstance.Application["WS_WorkloadManagerKey"] = UserWorkloadManager.Singleton;
            OwaEventRegistry owaEventRegistry = new OwaEventRegistry();

            owaEventRegistry.RegisterHandler(typeof(PendingRequestEventHandler));
            applicationInstance.Application["OwaEventRegistry"] = owaEventRegistry;
            string identification = ConfigurationManager.AppSettings["ProvisioningCacheIdentification"];

            ProvisioningCache.InitializeAppRegistrySettings(identification);
        }
Ejemplo n.º 2
0
        // Token: 0x060010D2 RID: 4306 RVA: 0x0003FFF0 File Offset: 0x0003E1F0
        public IHttpHandler GetHandler(HttpContext httpContext, string requestType, string url, string pathTranslated)
        {
            ExTraceGlobals.OehCallTracer.TraceDebug(0L, "OwaEventHandlerFactory.GetHandler");
            string queryStringParameter  = HttpUtilities.GetQueryStringParameter(httpContext.Request, "ns");
            string queryStringParameter2 = HttpUtilities.GetQueryStringParameter(httpContext.Request, "ev");

            ExTraceGlobals.OehDataTracer.TraceDebug <string, string>(0L, "Request namespace: '{0}', event: '{1}'", queryStringParameter, queryStringParameter2);
            HttpApplication  applicationInstance = httpContext.ApplicationInstance;
            OwaEventRegistry owaEventRegistry    = (OwaEventRegistry)applicationInstance.Application["OwaEventRegistry"];

            if (owaEventRegistry == null)
            {
                HttpUtilities.EndResponse(httpContext, HttpStatusCode.MethodNotAllowed);
                return(null);
            }
            OwaEventNamespaceAttribute owaEventNamespaceAttribute = owaEventRegistry.FindNamespaceInfo(queryStringParameter);

            if (owaEventNamespaceAttribute == null)
            {
                throw new OwaException(string.Format(CultureInfo.InvariantCulture, "Namespace '{0}' doesn't exist", new object[]
                {
                    queryStringParameter
                }), null, this);
            }
            OwaEventAttribute owaEventAttribute = owaEventNamespaceAttribute.FindEventInfo(queryStringParameter2);

            if (owaEventAttribute == null)
            {
                throw new OwaException(string.Format(CultureInfo.InvariantCulture, "Event '{0}' doesn't exist", new object[]
                {
                    queryStringParameter2
                }), null, this);
            }
            OwaEventVerb owaEventVerb = OwaEventVerbAttribute.Parse(httpContext.Request.HttpMethod);

            ExTraceGlobals.OehDataTracer.TraceDebug <string>(0L, "Request verb: {0}", httpContext.Request.HttpMethod);
            if ((owaEventAttribute.AllowedVerbs & owaEventVerb) == OwaEventVerb.Unsupported)
            {
                ExTraceGlobals.OehTracer.TraceDebug <OwaEventVerb, OwaEventVerb>(0L, "Verb is not allowed, returning 405. Actual verb: {0}. Allowed: {1}.", owaEventVerb, owaEventAttribute.AllowedVerbs);
                HttpUtilities.EndResponse(httpContext, HttpStatusCode.MethodNotAllowed);
                return(null);
            }
            OwaEventHandlerBase owaEventHandlerBase = (OwaEventHandlerBase)Activator.CreateInstance(owaEventNamespaceAttribute.HandlerType);

            owaEventHandlerBase.EventInfo = owaEventAttribute;
            owaEventHandlerBase.Verb      = owaEventVerb;
            if (owaEventAttribute.IsAsync)
            {
                ExTraceGlobals.OehTracer.TraceDebug(0L, "Created async HTTP handler to server OEH request");
                return(new OwaEventAsyncHttpHandler(owaEventHandlerBase));
            }
            return(new OwaEventHttpHandler(owaEventHandlerBase));
        }