Java 类org.quartz.UnableToInterruptJobException 实例源码

项目:lams    文件:QuartzScheduler.java   
/**
 * Interrupt the identified InterruptableJob executing in this Scheduler instance.
 *  
 * <p>
 * This method is not cluster aware.  That is, it will only interrupt 
 * instances of the identified InterruptableJob currently executing in this 
 * Scheduler instance, not across the entire cluster.
 * </p>
 * 
 * @see org.quartz.core.RemotableQuartzScheduler#interrupt(JobKey)
 */
public boolean interrupt(String fireInstanceId) throws UnableToInterruptJobException {
    List<JobExecutionContext> jobs = getCurrentlyExecutingJobs();

    Job job = null;

    for(JobExecutionContext jec : jobs) {
        if (jec.getFireInstanceId().equals(fireInstanceId)) {
            job = jec.getJobInstance();
            if (job instanceof InterruptableJob) {
                ((InterruptableJob)job).interrupt();
                return true;
            } else {
                throw new UnableToInterruptJobException(
                    "Job " + jec.getJobDetail().getKey() +
                    " can not be interrupted, since it does not implement " +                        
                    InterruptableJob.class.getName());
            }
        }                        
    }

    return false;
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
protected void executeJob( JobExecutionContext context )
    throws JobExecutionException
{
  JobDataMap jobDataMap = context.getMergedJobDataMap();

  // optionally set the exception
  Object quartzdeskInterruptException = jobDataMap.get( JDM_KEY_INTERRUPT_EXCEPTION );
  if ( quartzdeskInterruptException != null )
  {
    log.debug( "Interrupt attempts will throw {} with message: {}", UnableToInterruptJobException.class.getName(),
        quartzdeskInterruptException );

    interruptException = quartzdeskInterruptException.toString();
  }

  super.executeJob( context );
}
项目:quartzdesk-test-webapps    文件:InterruptibleTestJob.java   
@Override
public void interrupt()
    throws UnableToInterruptJobException
{
  log.warn( "Received interrupt request." );
  if ( interruptException == null )
  {
    log.warn( "Interrupting job." );
    interruptFlag.set( true );
  }
  else
  {
    log.warn( "Failing job interrupt with message: {}", interruptException );
    throw new UnableToInterruptJobException( interruptException );
  }
}