Ejemplo n.º 1
0
 private object GetFeature(string feature)
 {
     if (Features.Contains(feature))
     {
         return(Features[feature]);
     }
     lock (Features.SyncRoot)
     {
         if (!Features.Contains(feature))
         {
             IHttpHandler  handler;
             MessageBroker messageBroker = MessageBroker.GetMessageBroker(MessageBroker.DefaultMessageBrokerId);
             if (feature == "proxy")
             {
                 handler           = new JsonRpcProxyGenerator(messageBroker);
                 Features[feature] = handler;
                 return(handler);
             }
             if (feature == "rpc")
             {
                 handler           = new JsonRpcExecutive(messageBroker);
                 Features[feature] = handler;
                 return(handler);
             }
         }
         else
         {
             return(Features[feature]);
         }
     }
     throw new NotImplementedException(string.Format("The requested feature {0} is not implemented ", feature));
 }
Ejemplo n.º 2
0
 private object GetFeature(string feature)
 {
     if (Features.Contains(feature))
         return Features[feature];
     lock (Features.SyncRoot)
     {
         if (!Features.Contains(feature))
         {
             MessageBroker messageBroker = MessageBroker.GetMessageBroker(MessageBroker.DefaultMessageBrokerId);
             if (feature == "proxy")
             {
                 IHttpHandler handler = new JsonRpcProxyGenerator(messageBroker);
                 Features[feature] = handler;
                 return handler;
             }
             if (feature == "rpc")
             {
                 IHttpHandler handler = new JsonRpcExecutive(messageBroker);
                 Features[feature] = handler;
                 return handler;
             }
         }
         else
             return Features[feature];
     }
     throw new NotImplementedException(string.Format("The requested feature {0} is not implemented ", feature));
 }