-
May 1st, 2012, 06:05 AM
#1
@Scheduled(cron) does not support SpEL
Hello,
I've noticed that the @Scheduled annotation does not support SpEL ( I've noticed that the StringValueResolver interface is implemented by PlaceholderResolvingStringValueResolver etc, but not with any SpEL class ).
Is there a way today to use SpEL in the @Scheduled annotation?
If not - why? and will it be possible?
Thanks,
Noam
-
May 4th, 2012, 07:56 PM
#2
Hello
If you read the @Scheduled API it only work with cron.
Seems you have must write statically your cron expression
- Manuel Jordan
Kill Your Pride, Share Your Knowledge With All
The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7
Blog
Technical Reviewer of Apress
- Pro SpringSource dm Server
- Spring Enterprise Recipes: A Problem-Solution Approach
- Spring Recipes: A Problem-Solution Approach, 2nd Edition
- Pro Spring Integration
- Pro Spring Batch
- Pro Spring 3
- Pro Spring MVC: With Web Flow
- Pro Spring Security
-
May 6th, 2012, 02:38 AM
#3
Hi Dr.,
Thanks for the reply - but I think my question was not clear.
I used @Scheduled with cron expression by the following:
When I used:
1) Statically expression - It worked fine.
2) Placeholder ( the expression was in scheduler.properties file and I've wrote @Scheduled(cron="${cron}") ) - It worked fine.
3) SpEL ( I've used the same property file and wrote @Scheduled(cron="#{scheduler['cron']") ) - It didn't workd.
So my question were:
Did I do something wrong here?
Does @Scheduled ( with cron ) support SpEL?
If not - Is there intention of supporting SpEL in this situation?
Thanks,
Noam.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules