Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*     */ package org.quartz.ee.jta;
 /*     */ 
 /*     */ import  javax.transaction.SystemException;
 /*     */ import  javax.transaction.UserTransaction;
 /*     */ import org.apache.commons.logging.Log;
 /*     */ import org.quartz.Scheduler;
 /*     */ import org.quartz.SchedulerException;
 /*     */ import org.quartz.core.JobRunShell;
 /*     */ import org.quartz.core.JobRunShellFactory;
/*     */ import org.quartz.core.SchedulingContext;
/*     */ 
/*     */ public class JTAJobRunShell extends JobRunShell
/*     */ {
/*     */   private UserTransaction ut;
/*     */   private UserTransactionHelper userTxHelper;
/*     */ 
/*     */   public JTAJobRunShell(JobRunShellFactory jobRunShellFactoryScheduler schedulerSchedulingContext schdCtxtUserTransactionHelper userTxHelper)
/*     */   {
/*  75 */     super(jobRunShellFactoryschedulerschdCtxt);
/*     */ 
/*  77 */     this. = userTxHelper;
/*     */   }
/*     */ 
/*     */   protected void begin()
/*     */     throws SchedulerException
/*     */   {
/*     */     try
/*     */     {
/*  90 */       this..debug("Looking up UserTransaction.");
/*  91 */       this. = this..lookup();
/*     */ 
/*  93 */       this..debug("Beginning UserTransaction.");
/*  94 */       this..begin();
/*     */     } catch (SchedulerException se) {
/*  96 */       throw se;
/*     */     }
/*     */     catch (Exception nse) {
/*  99 */       throw new SchedulerException("JTAJobRunShell could not start UserTransaction."nse);
/*     */     }
/*     */   }
/*     */ 
/*     */   protected void complete(boolean successfulExecution)
/*     */     throws SchedulerException
/*     */   {
/* 107 */     if (this. == nullreturn;
/*     */     try
/*     */     {
/* 110 */       if (this..getStatus() == 1) {
/* 111 */         this..debug("UserTransaction marked for rollback only.");
/* 112 */         successfulExecution = false;
/*     */       }
/*     */     } catch (SystemException e) {
/* 115 */       throw new SchedulerException("JTAJobRunShell could not read UserTransaction status."e);
/*     */     }
/*     */ 
/* 119 */     if (successfulExecution)
/*     */       try {
/* 121 */         this..debug("Committing UserTransaction.");
/* 122 */         this..commit();
/*     */       } catch (Exception nse) {
/* 124 */         throw new SchedulerException("JTAJobRunShell could not commit UserTransaction."nse);
/*     */       }
/*     */     else {
/*     */       try
/*     */       {
/* 129 */         this..debug("Rolling-back UserTransaction.");
/* 130 */         this..rollback();
/*     */       } catch (Exception nse) {
/* 132 */         throw new SchedulerException("JTAJobRunShell could not rollback UserTransaction."nse);
/*     */       }
/*     */ 
/*     */     }
/*     */ 
/* 138 */     this. = null;
/*     */   }
/*     */ }
/* Location:           /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_COMMUNITY/embedded/output/lib/embedded-jboss/lib/thirdparty-all.jar
 * Qualified Name:     org.quartz.ee.jta.JTAJobRunShell
 * JD-Core Version:    0.6.0
 */
New to GrepCode? Check out our FAQ X