Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 404
  • Last Modified:

cronExpression

hi guys

I am using spring with java
I have


<bean id="emailTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="job" ref="emailJob" />
<property name="cronExpression" value="0 0/20 * * * ?"/>
</bean>

what does <property name="cronExpression" value="0 0/20 * * * ?"/>  mean ?

thanks
0
royjayd
Asked:
royjayd
  • 7
  • 3
  • 2
  • +1
3 Solutions
 
CEHJCommented:
'Run every twenty hours starting at midnight on every day'
0
 
royjaydAuthor Commented:
can you point me to a link which talks more about this?
also what is '?' in the end


0
 
for_yanCommented:
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
CEHJCommented:
>>also what is '?' in the end

I interpret that to mean 'there is no command' since it's being done w

http://en.wikipedia.org/wiki/Cronith Quartz
0
 
CEHJCommented:

Oops. That should have said 'done with Quartz'

http://en.wikipedia.org/wiki/Cron
0
 
royjaydAuthor Commented:
ok , thanks ,
if i want to send a email every 10 seconds wil that be
value="0/10 0 * * * ?"
0
 
CEHJCommented:
No. Unfortunately you can't get seconds granularity with cron
0
 
CEHJCommented:
0
 
for_yanCommented:
Just use CurentThread().sleep(...)
int count = 0;
while(true){
Thread.currentThread().sleep(10000);
sendEmail(...);
count++;
if(count > 1000000)break;
}

Open in new window

0
 
CEHJCommented:
No need for a nasty kludge like that. Needless to say, a fully-featured scheduling framework is quite able to cope with every n seconds - it's just that *cron* is not designed to support that
0
 
for_yanCommented:
But you definetely don't need the whole scheduling framework to send emails after every certian interval
0
 
gordon_vt02Commented:
@CEHJ - the Spring CronTrigger does support second-level scheduling.  From the Sprint 3 API Docs:

"The pattern is a list of six single space-separated fields: representing second, minute, hour, day, month, weekday. Month and weekday names can be given as the first three letters of the English names."

http://static.springsource.org/spring/docs/3.0.x/javadoc-api/index.html?org/springframework/scheduling/quartz/SchedulerFactoryBean.html
0
 
CEHJCommented:
:)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 7
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now