/** * Based on the value of <em>wrapInUserTransaction</em>, wraps the * call to shutdown(UserTransaction) in a UserTransaction. */ public void shutdown() { UserTransaction userTransaction = startUserTransaction(); try { shutdown(userTransaction); } finally { resolveUserTransaction(userTransaction); } }
/** * Based on the value of <em>wrapInUserTransaction</em>, wraps the * call to start(UserTransaction) in a UserTransaction. */ public void start() { UserTransaction userTransaction = startUserTransaction(); try { start(userTransaction); } finally { resolveUserTransaction(userTransaction); } }
/** * <p> * Called during creation of the <code>Scheduler</code> in order to give * the <code>SchedulerPlugin</code> a chance to initialize. * </p> * * @throws org.quartz.SchedulerConfigException * if there is an error initializing. */ public void initialize(String name, final Scheduler scheduler, ClassLoadHelper schedulerFactoryClassLoadHelper) throws SchedulerException { super.initialize(name, scheduler); this.classLoadHelper = schedulerFactoryClassLoadHelper; getLog().info("Registering Quartz Job Initialization Plug-in."); // Create JobFile objects StringTokenizer stok = new StringTokenizer(fileNames, FILE_NAME_DELIMITERS); while (stok.hasMoreTokens()) { final String fileName = stok.nextToken(); final JobFile jobFile = new JobFile(fileName); jobFiles.put(fileName, jobFile); } }
/** * If <em>wrapInUserTransaction</em> is true, starts a new UserTransaction * and returns it. Otherwise, or if establishing the transaction fail, it * will return null. */ private UserTransaction startUserTransaction() { if (wrapInUserTransaction == false) { return null; } UserTransaction userTransaction = null; try { userTransaction = UserTransactionHelper.lookupUserTransaction(); userTransaction.begin(); } catch (Throwable t) { UserTransactionHelper.returnUserTransaction(userTransaction); userTransaction = null; getLog().error("Failed to start UserTransaction for plugin: " + getName(), t); } return userTransaction; }
private void shutdownPlugins() { java.util.Iterator itr = quartzSchedulerResources.getSchedulerPlugins().iterator(); while (itr.hasNext()) { SchedulerPlugin plugin = (SchedulerPlugin) itr.next(); plugin.shutdown(); } }
private void startPlugins() { java.util.Iterator itr = quartzSchedulerResources.getSchedulerPlugins().iterator(); while (itr.hasNext()) { SchedulerPlugin plugin = (SchedulerPlugin) itr.next(); plugin.start(); } }
/** * Based on the value of <em>wrapInUserTransaction</em>, wraps the * call to shutdown(UserTransaction) in a UserTransaction. */ public void shutdown() { UserTransaction userTransaction = startUserTransaction(); try { shutdown(userTransaction); } finally { resolveUserTransaction(userTransaction); } }
/** * Based on the value of <em>wrapInUserTransaction</em>, wraps the * call to start(UserTransaction) in a UserTransaction. */ public void start() { UserTransaction userTransaction = startUserTransaction(); try { start(userTransaction); } finally { resolveUserTransaction(userTransaction); } }
/** * If <em>wrapInUserTransaction</em> is true, starts a new UserTransaction * and returns it. Otherwise, or if establishing the transaction fail, it * will return null. */ private UserTransaction startUserTransaction() { if (wrapInUserTransaction == false) { return null; } UserTransaction userTransaction = null; try { userTransaction = UserTransactionHelper.lookupUserTransaction(); userTransaction.begin(); } catch (Throwable t) { UserTransactionHelper.returnUserTransaction(userTransaction); userTransaction = null; getLog().error("Failed to start UserTransaction for plugin: " + getName(), t); } return userTransaction; }
/** * <p> * Called during creation of the <code>Scheduler</code> in order to give * the <code>SchedulerPlugin</code> a chance to initialize. * </p> * * @throws org.quartz.SchedulerConfigException * if there is an error initializing. */ public void initialize(String name, final Scheduler scheduler, ClassLoadHelper schedulerFactoryClassLoadHelper) throws SchedulerException { super.initialize(name, scheduler); this.classLoadHelper = schedulerFactoryClassLoadHelper; getLog().info("Registering Quartz Job Initialization Plug-in."); // Create JobFile objects StringTokenizer stok = new StringTokenizer(fileNames, FILE_NAME_DELIMITERS); while (stok.hasMoreTokens()) { final String fileName = stok.nextToken(); final JobFile jobFile = new JobFile(fileName); jobFiles.put(fileName, jobFile); } }
private void shutdownPlugins() { java.util.Iterator itr = quartzSchedulerResources.getSchedulerPlugins().iterator(); while (itr.hasNext()) { SchedulerPlugin plugin = (SchedulerPlugin) itr.next(); plugin.shutdown(); } }
private void startPlugins() { java.util.Iterator itr = quartzSchedulerResources.getSchedulerPlugins().iterator(); while (itr.hasNext()) { SchedulerPlugin plugin = (SchedulerPlugin) itr.next(); plugin.start(); } }
/** * Based on the value of <em>wrapInUserTransaction</em>, wraps the * call to shutdown(UserTransaction) in a UserTransaction. */ public void shutdown() { UserTransaction userTransaction = startUserTransaction(); try { shutdown(userTransaction); } finally { resolveUserTransaction(userTransaction); } }
/** * Based on the value of <em>wrapInUserTransaction</em>, wraps the * call to start(UserTransaction) in a UserTransaction. */ public void start() { UserTransaction userTransaction = startUserTransaction(); try { start(userTransaction); } finally { resolveUserTransaction(userTransaction); } }
/** * If the given UserTransaction is not null, it is committed/rolledback, * and then returned to the UserTransactionHelper. */ private void resolveUserTransaction(UserTransaction userTransaction) { if (userTransaction != null) { try { if (userTransaction.getStatus() == Status.STATUS_MARKED_ROLLBACK) { userTransaction.rollback(); } else { userTransaction.commit(); } } catch (Throwable t) { getLog().error("Failed to resolve UserTransaction for plugin: " + getName(), t); } finally { UserTransactionHelper.returnUserTransaction(userTransaction); } } } }
private void shutdownPlugins() { java.util.Iterator itr = quartzSchedulerResources.getSchedulerPlugins().iterator(); while (itr.hasNext()) { SchedulerPlugin plugin = (SchedulerPlugin) itr.next(); plugin.shutdown(); } }
private void startPlugins() { java.util.Iterator itr = quartzSchedulerResources.getSchedulerPlugins().iterator(); while (itr.hasNext()) { SchedulerPlugin plugin = (SchedulerPlugin) itr.next(); plugin.start(); } }
/** * Based on the value of <em>wrapInUserTransaction</em>, wraps the * call to shutdown(UserTransaction) in a UserTransaction. */ public void shutdown() { UserTransaction userTransaction = startUserTransaction(); try { shutdown(userTransaction); } finally { resolveUserTransaction(userTransaction); } }
/** * Based on the value of <em>wrapInUserTransaction</em>, wraps the * call to start(UserTransaction) in a UserTransaction. */ public void start() { UserTransaction userTransaction = startUserTransaction(); try { start(userTransaction); } finally { resolveUserTransaction(userTransaction); } }
/** * If the given UserTransaction is not null, it is committed/rolledback, * and then returned to the UserTransactionHelper. */ private void resolveUserTransaction(UserTransaction userTransaction) { if (userTransaction != null) { try { if (userTransaction.getStatus() == Status.STATUS_MARKED_ROLLBACK) { userTransaction.rollback(); } else { userTransaction.commit(); } } catch (Throwable t) { getLog().error("Failed to resolve UserTransaction for plugin: " + getName(), t); } finally { UserTransactionHelper.returnUserTransaction(userTransaction); } } } }