示例#1
0
 public void produce(Command command)
 {
     if(command.GetType().IsSubclassOf(typeof(ModelCommand))){
     lock(command){
         getCore().consume(command);
         if( ! command.isSucceed()){
             throw new Exception(command.getCommandSatus().getMessage());
         }
         try {
             Monitor.Wait(command, 12000000);
         } catch (Exception e) {
             throw new Exception("fail to execute command : "+command.ToString(),e);
         }
     }
     }else{
     getCore().consume(command);
     }
     if( ! command.isSucceed()){
     throw new Exception(command.getCommandSatus().getMessage());
     }
     log.Info("releasing thread command version "+command.getVersion());
 }