Beispiel #1
0
        public override void AcceptRequest(RequestContext context, Microsoft.Cis.Services.Nephos.Common.ServiceType serviceType)
        {
            Logger <IRestProtocolHeadLogger> .Instance.VerboseDebug.Log("Accepting request");

            context.ServiceType = serviceType;
            PerRequestStorageManager perRequestStorageManager = new PerRequestStorageManager(QueueServiceEntry.SharedStorageManager, context.OperationStatus);
            AuthenticationManager    authenticationManager    = XFEQueueAuthenticationManager.CreateAuthenticationManager(QueueServiceEntry.SharedStorageManager);
            AuthorizationManager     authorizationManager     = XFEQueueAuthorizationManager.CreateAuthorizationManager(QueueServiceEntry.SharedStorageManager, false);
            AbstractQueueManager     dbQueueManager           = new DbQueueManager(QueueServiceEntry.SharedStorageManager, authorizationManager)
            {
                OperationStatus = context.OperationStatus
            };
            IProcessor processor = QueueProtocolHead.Create(context, perRequestStorageManager, authenticationManager, dbQueueManager, QueueProtocolHead.HttpProcessorConfigurationDefaultInstance, new TransformExceptionDelegate(SqlExceptionManager.TransformSqlException), null);
            bool       flag      = true;

            try
            {
                try
                {
                    processor.BeginProcess(new AsyncCallback(this.ProcessAsyncCallback), processor);
                    flag = false;
                }
                catch (NephosAssertionException nephosAssertionException1)
                {
                    NephosAssertionException nephosAssertionException = nephosAssertionException1;
                    IStringDataEventStream   error = Logger <IRestProtocolHeadLogger> .Instance.Error;
                    object[] str = new object[] { nephosAssertionException.ToString() };
                    error.Log("ASSERTION in BeginProcess: {0}", str);
                    processor.Dispose();
                }
                catch (Exception exception1)
                {
                    Exception exception = exception1;
                    IStringDataEventStream unhandledException = Logger <IRestProtocolHeadLogger> .Instance.UnhandledException;
                    object[] objArray = new object[] { exception.ToString() };
                    unhandledException.Log("BeginProcess threw exception {0}", objArray);
                    processor.Dispose();
                }
            }
            finally
            {
                if (flag)
                {
                    processor.Dispose();
                }
            }
            Logger <IRestProtocolHeadLogger> .Instance.VerboseDebug.Log("Returning from AcceptRequest method.");
        }
Beispiel #2
0
        void Microsoft.Cis.Services.Nephos.Common.Protocols.Rest.IServiceEntry.Initialize(IServiceEntrySink sink)
        {
            Logger <IRestProtocolHeadLogger> .Instance.VerboseDebug.Log("[Nephos.Queue] { Initialize");

            QueueServiceEntry.SharedStorageManager = new DbStorageManager();
            QueueProtocolHead.HttpProcessorConfigurationDefaultInstance = HttpProcessorConfiguration.LoadDefaultHttpProcessorConfiguration(sink, "UriHostSuffixes", null);
            this.authenticationManager = XFEQueueAuthenticationManager.CreateAuthenticationManager(QueueServiceEntry.SharedStorageManager);
            this.queueManager          = new DbQueueManager(QueueServiceEntry.SharedStorageManager, XFEQueueAuthorizationManager.CreateAuthorizationManager(QueueServiceEntry.SharedStorageManager, false));
            sink.RegisterRestHandler(this);
            Logger <IRestProtocolHeadLogger> .Instance.VerboseDebug.Log("[DevelopmentStorage.Queue] } Initialize");
        }