The idea that the sequential queue implements the task to execute:
 Public classTaskmanage {//Task Queue    Privateblockingqueue<runnable> queue =NewArrayblockingqueue<runnable> (10); Private Booleanrunning =false;  Public voidStart () {Running=true; Thread T=NewThread (Neworderedjob ());      T.start (); }         Public voidStop () {running=false; }           Public voidSubmit (Runnable Task) {Try {            if(Queue.offer (Task, 5000L, timeunit.milliseconds) = =false) {System.out.println (); }        } Catch(interruptedexception e) {e.printstacktrace (); }    }    classOrderedjobImplementsRunnable {@Override Public voidrun () { while(running) {Try{Runnable Job= Queue.poll (5000L, Timeunit.milliseconds); Try {                          if(Job! =NULL) Job.run (); } Catch(RuntimeException e) {//Todo:handle Exception                    }                  } Catch(interruptedexception e) {e.printstacktrace (); }              }          }      }}
Sequential queue implementation tasks to perform-Task scheduling series 2