public void add ( final GridmixJob job ) throws InterruptedException { final boolean addToQueue = ! shutdown ; if ( addToQueue ) { final SubmitTask task = new SubmitTask ( job ) ; sem . acquire ( ) ; try { sched . execute ( task ) ; } catch ( RejectedExecutionException e ) { sem . release ( ) ; } } }
Enqueue the job to be submitted per the deadline associated with it .