Example #1
0
        /// <summary>
        /// This method supports the Fluorine infrastructure and is not intended to be used directly from your code.
        /// </summary>
        public void Service()
        {
            if (_messageBroker == null)
            {
                string msg = __Res.GetString(__Res.MessageBroker_NotAvailable);
                log.Fatal(msg);
                throw new FluorineException(msg);
            }

            //This is equivalent to request.getContextPath() (Java) or the HttpRequest.ApplicationPath (.Net).
            string contextPath  = HttpContext.Current.Request.ApplicationPath;
            string endpointPath = HttpContext.Current.Request.Path;
            bool   isSecure     = HttpContext.Current.Request.IsSecureConnection;

            if (log.IsDebugEnabled)
            {
                log.Debug(__Res.GetString(__Res.Endpoint_Bind, endpointPath, contextPath));
            }

            //http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=e329643d&pss=rss_flex_e329643d
            IEndpoint endpoint = _messageBroker.GetEndpoint(endpointPath, contextPath, isSecure);

            if (endpoint != null)
            {
                endpoint.Service();
            }
            else
            {
                string msg = __Res.GetString(__Res.Endpoint_BindFail, endpointPath, contextPath);
                log.Fatal(msg);
                _messageBroker.TraceChannelSettings();
                throw new FluorineException(msg);
            }
        }