Exemple #1
0
        public static RequestProcessorBase GetServerRequestProcessor()
        {
            if (serverRequestProcessor == null)
            {
                var context = HttpContext.Current;
                if (context == null || context.Cache == null)
                {
                    serverRequestProcessor = (serverRequestProcessor ?? new ServerRequestProcessor());
                }
                else
                {
                    serverRequestProcessor = context.Cache[serverRequestProcessorCacheKey] as RequestProcessorBase;

                    if (serverRequestProcessor == null)
                    {
                        serverRequestProcessor = new ServerRequestProcessor();

                        context.Cache.Insert(serverRequestProcessorCacheKey, serverRequestProcessor);
                    }
                }
            }

            return(serverRequestProcessor);
        }
Exemple #2
0
        public static RequestProcessorBase GetClientRequestProcessor()
        {
            if (clidntRequestProcessor == null)
            {
                var context = HttpContext.Current;
                if (context == null || context.Cache == null)
                {
                    clidntRequestProcessor = (clidntRequestProcessor ?? new ClientRequestProcessor());
                }
                else
                {
                    clidntRequestProcessor = context.Cache[clientRequestProcessorCacheKey] as RequestProcessorBase;

                    if (clidntRequestProcessor == null)
                    {
                        clidntRequestProcessor = new ClientRequestProcessor();

                        context.Cache.Insert(clientRequestProcessorCacheKey, clidntRequestProcessor);
                    }
                }
            }

            return(clidntRequestProcessor);
        }