Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I wouldn't bother with Quartz, it's overkill for something this simple. Java5 comes with its own scheduler, and it's good enough.</p> <p>Pre-Spring 3, this is was the easiest approach:</p> <pre><code>&lt;bean class="org.springframework.scheduling.concurrent.ScheduledExecutorFactoryBean"&gt; &lt;property name="scheduledExecutorTasks"&gt; &lt;list&gt; &lt;bean class="org.springframework.scheduling.concurrent.ScheduledExecutorTask"&gt; &lt;property name="period" value="30000"/&gt; &lt;property name="runnable"&gt; &lt;bean class="org.springframework.scheduling.support.MethodInvokingRunnable"&gt; &lt;property name="targetObject" ref="pitcher"/&gt; &lt;property name="targetMethod" value="voice"/&gt; &lt;/bean&gt; &lt;/property&gt; &lt;/bean&gt; &lt;/list&gt; &lt;/property&gt; &lt;/bean&gt; </code></pre> <p>With Spring 3, it can be ridiculously easy:</p> <pre><code>@Scheduled(fixedRate=30000) public void voice() { System.out.println(getShout()); } </code></pre> <p>and</p> <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd "&gt; &lt;bean id="pitcher" class="spring.com.practice.Pitcher"&gt; &lt;property name="shout" value="I started executing..."&gt;&lt;/property&gt; &lt;/bean&gt; &lt;task:annotation-driven/&gt; &lt;/beans&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload