Example #1
0
 void EnqueueAction(AsyncAction action, ProduceConsumerQueue queue, List <Exception> exceptions)
 {
     action.Completed += action_Completed;
     queue.EnqueueItem(
         () =>
     {
         if (Cancelling)     // don't start any more actions
         {
             return;
         }
         try
         {
             action.RunExternal(action.Session);
         }
         catch (Exception e)
         {
             Failure f = e as Failure;
             if (f != null && Connection != null &&
                 f.ErrorDescription[0] == Failure.RBAC_PERMISSION_DENIED)
             {
                 Failure.ParseRBACFailure(f, action.Connection, action.Session ?? action.Connection.Session);
             }
             exceptions.Add(e);
             // Record the first exception we come to. Though later if there are more than one we will replace this with non specific one.
             if (Exception == null)
             {
                 Exception = e;
             }
         }
     });
 }
Example #2
0
 protected override void RunSubActions(List <Exception> exceptions)
 {
     foreach (AsyncAction subAction in subActions)
     {
         AsyncAction action = subAction;
         action.Completed += action_Completed;
         _queuePC.EnqueueItem(
             () =>
         {
             try
             {
                 action.RunExternal(Session);
             }
             catch (Exception e)
             {
                 Failure f = e as Failure;
                 if (f != null && Connection != null &&
                     f.ErrorDescription[0] == Failure.RBAC_PERMISSION_DENIED)
                 {
                     Failure.ParseRBACFailure(f, Connection, Session ?? Connection.Session);
                 }
                 exceptions.Add(e);
                 // Record the first exception we come to. Though later if there are more than one we will replace this with non specific one.
                 if (Exception == null)
                 {
                     Exception = e;
                 }
             }
         });
     }
     lock (_lock)
     {
         Monitor.Wait(_lock);
     }
 }
 private List<string> ExtractApiCallList(AsyncAction myAction)
 {
     RbacMethodList rbacMethods = new RbacMethodList();
     RbacCollectorProxy.GetProxy(rbacMethods);
     Session session = new Session(RbacCollectorProxy.GetProxy(rbacMethods), myAction.Connection);
     myAction.RunExternal(session);
     return rbacMethods.ConvertAll(c => c.Method.ToLower().Replace('.', '_').Replace("async_", ""));
 }
Example #4
0
 void EnqueueAction(AsyncAction action, ProduceConsumerQueue queue, List<Exception> exceptions)
 {
     action.Completed += action_Completed;
     queue.EnqueueItem(
         () =>
         {
             if (Cancelling) // don't start any more actions
                 return;
             try
             {
                 action.RunExternal(action.Session);
             }
             catch (Exception e)
             {
                 Failure f = e as Failure;
                 if (f != null && Connection != null &&
                     f.ErrorDescription[0] == Failure.RBAC_PERMISSION_DENIED)
                 {
                     Failure.ParseRBACFailure(f, action.Connection, action.Session ?? action.Connection.Session);
                 }
                 exceptions.Add(e);
                 // Record the first exception we come to. Though later if there are more than one we will replace this with non specific one.
                 if (Exception == null)
                     Exception = e;
             }
         });
 }