/** * Adapt the given job object to the Quartz Job interface. * <p>The default implementation supports straight Quartz Jobs * as well as Runnables, which get wrapped in a DelegatingJob. * @param jobObject the original instance of the specified job class * @return the adapted Quartz Job instance * @throws Exception if the given job could not be adapted * @see DelegatingJob */ protected Job adaptJob(Object jobObject) throws Exception { if (jobObject instanceof Job) { return (Job) jobObject; } else if (jobObject instanceof Runnable) { return new DelegatingJob((Runnable) jobObject); } else { throw new IllegalArgumentException( "Unable to execute job class [" + jobObject.getClass().getName() + "]: only [org.quartz.Job] and [java.lang.Runnable] supported."); } }
/** * Adapt the given job object to the Quartz Job interface. * <p>The default implementation supports straight Quartz Jobs * as well as Runnables, which get wrapped in a DelegatingJob. * @param jobObject the original instance of the specified job class * @return the adapted Quartz Job instance * @throws Exception if the given job could not be adapted * @see DelegatingJob */ protected Job adaptJob(Object jobObject) throws Exception { if (jobObject instanceof Job) { return (Job) jobObject; } else if (jobObject instanceof Runnable) { return new DelegatingJob((Runnable) jobObject); } else { throw new IllegalArgumentException( "Unable to execute job class [" + jobObject.getClass().getName() + "]: only [org.quartz.Job] and [java.lang.Runnable] supported."); } }
/** * Adapt the given job object to the Quartz Job interface. * <p>The default implementation supports straight Quartz Jobs * as well as Runnables, which get wrapped in a DelegatingJob. * @param jobObject the original instance of the specified job class * @return the adapted Quartz Job instance * @throws Exception if the given job could not be adapted * @see DelegatingJob */ protected Job adaptJob(Object jobObject) throws Exception { if (jobObject instanceof Job) { return (Job) jobObject; } else if (jobObject instanceof Runnable) { return new DelegatingJob((Runnable) jobObject); } else { throw new IllegalArgumentException("Unable to execute job class [" + jobObject.getClass().getName() + "]: only [org.quartz.Job] and [java.lang.Runnable] supported."); } }