Tabnine Logo
JTAJobRunShell
Code IndexAdd Tabnine to your IDE (free)

How to use
JTAJobRunShell
in
org.quartz.ee.jta

Best Java code snippets using org.quartz.ee.jta.JTAJobRunShell (Showing top 18 results out of 315)

origin: quartz-scheduler/quartz

/**
 * <p>
 * Called by the <class>{@link org.quartz.core.QuartzSchedulerThread}
 * </code> to obtain instances of <code>
 * {@link org.quartz.core.JobRunShell}</code>.
 * </p>
 */
public JobRunShell createJobRunShell(TriggerFiredBundle bundle)
    throws SchedulerException {
  return new JTAJobRunShell(scheduler, bundle);
}
origin: quartz-scheduler/quartz

@Override
protected void begin() throws SchedulerException {
  // Don't get a new UserTransaction w/o making sure we cleaned up the old 
  // one.  This is necessary because there are paths through JobRunShell.run()
  // where begin() can be called multiple times w/o complete being called in
  // between.
  cleanupUserTransaction();
  
  boolean beganSuccessfully = false;
  try {
    getLog().debug("Looking up UserTransaction.");
    ut = UserTransactionHelper.lookupUserTransaction();
    if (transactionTimeout != null) {
      ut.setTransactionTimeout(transactionTimeout);
    }
    getLog().debug("Beginning UserTransaction.");
    ut.begin();
    
    beganSuccessfully = true;
  } catch (SchedulerException se) {
    throw se;
  } catch (Exception nse) {
    throw new SchedulerException(
        "JTAJobRunShell could not start UserTransaction.", nse);
  } finally {
    if (beganSuccessfully == false) {
      cleanupUserTransaction();
    }
  }
}
origin: quartz-scheduler/quartz

/**
 * Override passivate() to ensure we always cleanup the UserTransaction. 
 */
@Override
public void passivate() {
  cleanupUserTransaction();
  super.passivate();
}

origin: quartz-scheduler/quartz

/**
 * Override passivate() to ensure we always cleanup the UserTransaction. 
 */
@Override
public void passivate() {
  cleanupUserTransaction();
  super.passivate();
}

origin: quartz-scheduler/quartz

@Override
protected void begin() throws SchedulerException {
  // Don't get a new UserTransaction w/o making sure we cleaned up the old 
  // one.  This is necessary because there are paths through JobRunShell.run()
  // where begin() can be called multiple times w/o complete being called in
  // between.
  cleanupUserTransaction();
  
  boolean beganSuccessfully = false;
  try {
    getLog().debug("Looking up UserTransaction.");
    ut = UserTransactionHelper.lookupUserTransaction();
    if (transactionTimeout != null) {
      ut.setTransactionTimeout(transactionTimeout);
    }
    getLog().debug("Beginning UserTransaction.");
    ut.begin();
    
    beganSuccessfully = true;
  } catch (SchedulerException se) {
    throw se;
  } catch (Exception nse) {
    throw new SchedulerException(
        "JTAJobRunShell could not start UserTransaction.", nse);
  } finally {
    if (beganSuccessfully == false) {
      cleanupUserTransaction();
    }
  }
}
origin: quartz-scheduler/quartz

/**
 * <p>
 * Called by the <class>{@link org.quartz.core.QuartzSchedulerThread}
 * </code> to obtain instances of <code>
 * {@link org.quartz.core.JobRunShell}</code>.
 * </p>
 */
public JobRunShell createJobRunShell(TriggerFiredBundle bundle)
    throws SchedulerException {
  return new JTAJobRunShell(scheduler, bundle);
}
origin: com.opensymphony.quartz/com.springsource.org.quartz

/**
 * Override passivate() to ensure we always cleanup the UserTransaction. 
 */
public void passivate() {
  cleanupUserTransaction();
  super.passivate();
}

origin: quartz-scheduler/quartz

try {
  if (ut.getStatus() == Status.STATUS_MARKED_ROLLBACK) {
    getLog().debug("UserTransaction marked for rollback only.");
    successfulExecution = false;
    getLog().debug("Committing UserTransaction.");
    ut.commit();
  } catch (Exception nse) {
    getLog().debug("Rolling-back UserTransaction.");
    ut.rollback();
  } catch (Exception nse) {
cleanupUserTransaction();
origin: quartz-scheduler/quartz

/**
 * <p>
 * Called by the <class>{@link org.quartz.core.QuartzSchedulerThread}
 * </code> to obtain instances of <code>
 * {@link org.quartz.core.JobRunShell}</code>.
 * </p>
 */
public JobRunShell createJobRunShell(TriggerFiredBundle bundle)
    throws SchedulerException {
  ExecuteInJTATransaction jtaAnnotation = ClassUtils.getAnnotation(bundle.getJobDetail().getJobClass(), ExecuteInJTATransaction.class);
  if(jtaAnnotation == null)
    return new JobRunShell(scheduler, bundle);
  else {
    int timeout = jtaAnnotation.timeout();
    if (timeout >= 0) {
      return new JTAJobRunShell(scheduler, bundle, timeout);
    } else {
      return new JTAJobRunShell(scheduler, bundle);
    }
  }
}
origin: quartz/quartz-all

/**
 * Override passivate() to ensure we always cleanup the UserTransaction. 
 */
public void passivate() {
  cleanupUserTransaction();
  super.passivate();
}

origin: quartz-scheduler/quartz

try {
  if (ut.getStatus() == Status.STATUS_MARKED_ROLLBACK) {
    getLog().debug("UserTransaction marked for rollback only.");
    successfulExecution = false;
    getLog().debug("Committing UserTransaction.");
    ut.commit();
  } catch (Exception nse) {
    getLog().debug("Rolling-back UserTransaction.");
    ut.rollback();
  } catch (Exception nse) {
cleanupUserTransaction();
origin: quartz-scheduler/quartz

/**
 * <p>
 * Called by the <class>{@link org.quartz.core.QuartzSchedulerThread}
 * </code> to obtain instances of <code>
 * {@link org.quartz.core.JobRunShell}</code>.
 * </p>
 */
public JobRunShell createJobRunShell(TriggerFiredBundle bundle)
    throws SchedulerException {
  ExecuteInJTATransaction jtaAnnotation = ClassUtils.getAnnotation(bundle.getJobDetail().getJobClass(), ExecuteInJTATransaction.class);
  if(jtaAnnotation == null)
    return new JobRunShell(scheduler, bundle);
  else {
    int timeout = jtaAnnotation.timeout();
    if (timeout >= 0) {
      return new JTAJobRunShell(scheduler, bundle, timeout);
    } else {
      return new JTAJobRunShell(scheduler, bundle);
    }
  }
}
origin: com.opensymphony.quartz/com.springsource.org.quartz

protected void begin() throws SchedulerException {
  // Don't get a new UserTransaction w/o making sure we cleaned up the old 
  // one.  This is necessary because there are paths through JobRunShell.run()
  // where begin() can be called multiple times w/o complete being called in
  // between.
  cleanupUserTransaction();
  
  boolean beganSuccessfully = false;
  try {
    getLog().debug("Looking up UserTransaction.");
    ut = UserTransactionHelper.lookupUserTransaction();
    getLog().debug("Beginning UserTransaction.");
    ut.begin();
    
    beganSuccessfully = true;
  } catch (SchedulerException se) {
    throw se;
  } catch (Exception nse) {
    throw new SchedulerException(
        "JTAJobRunShell could not start UserTransaction.", nse);
  } finally {
    if (beganSuccessfully == false) {
      cleanupUserTransaction();
    }
  }
}
origin: com.opensymphony.quartz/com.springsource.org.quartz

/**
 * <p>
 * Called by the <class>{@link org.quartz.core.QuartzSchedulerThread}
 * </code> to obtain instances of <code>
 * {@link org.quartz.core.JobRunShell}</code>.
 * </p>
 */
public JobRunShell borrowJobRunShell() {
  return new JTAJobRunShell(this, scheduler, schedCtxt);
}
origin: quartz/quartz-all

protected void begin() throws SchedulerException {
  // Don't get a new UserTransaction w/o making sure we cleaned up the old 
  // one.  This is necessary because there are paths through JobRunShell.run()
  // where begin() can be called multiple times w/o complete being called in
  // between.
  cleanupUserTransaction();
  
  boolean beganSuccessfully = false;
  try {
    getLog().debug("Looking up UserTransaction.");
    ut = UserTransactionHelper.lookupUserTransaction();
    getLog().debug("Beginning UserTransaction.");
    ut.begin();
    
    beganSuccessfully = true;
  } catch (SchedulerException se) {
    throw se;
  } catch (Exception nse) {
    throw new SchedulerException(
        "JTAJobRunShell could not start UserTransaction.", nse);
  } finally {
    if (beganSuccessfully == false) {
      cleanupUserTransaction();
    }
  }
}
origin: quartz/quartz-all

/**
 * <p>
 * Called by the <class>{@link org.quartz.core.QuartzSchedulerThread}
 * </code> to obtain instances of <code>
 * {@link org.quartz.core.JobRunShell}</code>.
 * </p>
 */
public JobRunShell borrowJobRunShell() {
  return new JTAJobRunShell(this, scheduler, schedCtxt);
}
origin: com.opensymphony.quartz/com.springsource.org.quartz

try {
  if (ut.getStatus() == Status.STATUS_MARKED_ROLLBACK) {
    getLog().debug("UserTransaction marked for rollback only.");
    successfulExecution = false;
    getLog().debug("Committing UserTransaction.");
    ut.commit();
  } catch (Exception nse) {
    getLog().debug("Rolling-back UserTransaction.");
    ut.rollback();
  } catch (Exception nse) {
cleanupUserTransaction();
origin: quartz/quartz-all

try {
  if (ut.getStatus() == Status.STATUS_MARKED_ROLLBACK) {
    getLog().debug("UserTransaction marked for rollback only.");
    successfulExecution = false;
    getLog().debug("Committing UserTransaction.");
    ut.commit();
  } catch (Exception nse) {
    getLog().debug("Rolling-back UserTransaction.");
    ut.rollback();
  } catch (Exception nse) {
cleanupUserTransaction();
org.quartz.ee.jtaJTAJobRunShell

Javadoc

An extension of org.quartz.core.JobRunShell that begins an XA transaction before executing the Job, and commits (or rolls-back) the transaction after execution completes.

Most used methods

  • <init>
    Create a JTAJobRunShell instance with the given settings.
  • cleanupUserTransaction
  • getLog

Popular in Java

  • Reactive rest calls using spring rest template
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSystemService (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now