Package com.dotcms.publishing.job

Source Code of com.dotcms.publishing.job.SiteSearchJobProxy

package com.dotcms.publishing.job;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import com.dotcms.enterprise.publishing.sitesearch.SiteSearchPublishStatus;
import com.dotmarketing.db.DbConnectionFactory;
import com.dotmarketing.quartz.DotStatefulJob;
import com.dotmarketing.quartz.QuartzUtils;
import com.dotmarketing.quartz.TaskRuntimeValues;
import com.dotmarketing.util.Logger;

public class SiteSearchJobProxy extends DotStatefulJob {
 

  public void run(JobExecutionContext jobContext) throws JobExecutionException {   
    SiteSearchJobImpl jobImpl = new SiteSearchJobImpl();
    SiteSearchPublishStatus status = null;
    TaskRuntimeValues trv = QuartzUtils.getTaskRuntimeValues(jobContext.getJobDetail().getName(), jobContext.getJobDetail().getGroup());
    if(trv ==null || !(trv instanceof SiteSearchPublishStatus)){
      status = new SiteSearchPublishStatus();
      QuartzUtils.setTaskRuntimeValues(jobContext.getJobDetail().getName(), jobContext.getJobDetail().getGroup(), status);
    }
    status = (SiteSearchPublishStatus) QuartzUtils.getTaskRuntimeValues(jobContext.getJobDetail().getName(), jobContext.getJobDetail().getGroup());
   

   
    jobImpl.setStatus(status);
    try{
      jobImpl.run(jobContext);
    }
    catch(Exception e){
      Logger.error(this.getClass(), e.getMessage(), e);
      throw new JobExecutionException(e);
     
    }
    finally{
      try{
        DbConnectionFactory.closeConnection();
      }
      catch(Exception e){
       
      }
    }
  }
}
TOP

Related Classes of com.dotcms.publishing.job.SiteSearchJobProxy

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.