View Javadoc
1   /*
2    * Licensed under the GPL License. You may not use this file except in compliance with the License.
3    * You may obtain a copy of the License at
4    *
5    *   https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
6    *
7    * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
8    * WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
9    * PURPOSE.
10   */
11  package psiprobe.scheduler.triggers;
12  
13  import org.springframework.beans.factory.annotation.Autowired;
14  import org.springframework.beans.factory.annotation.Value;
15  import org.springframework.scheduling.quartz.CronTriggerFactoryBean;
16  
17  import psiprobe.tools.TimeExpression;
18  
19  /**
20   * The Class MemoryStatsTrigger.
21   */
22  public class MemoryStatsTrigger extends CronTriggerFactoryBean {
23  
24    /**
25     * Sets the cron expression.
26     *
27     * @param periodExpression the period expression
28     * @param phaseExpression the phase expression
29     */
30    @Autowired
31    public void setCronExpression(
32        @Value("${psiprobe.beans.stats.collectors.memory.period}") String periodExpression,
33        @Value("${psiprobe.beans.stats.collectors.memory.phase}") String phaseExpression) {
34      super.setCronExpression(TimeExpression.cronExpression(periodExpression, phaseExpression));
35    }
36  
37  }