Cron Expression Evaluation

Problem Statement: How to calculate TTL (Time To Live) for objects in cache?
Answer:
Step 1: Get the data in cron expression.
From the cron expression http://www.cronmaker.com/

Step 2: Evaluate the expression and get next execution time.
http://quartz-scheduler.org/api/1.8.1/org/quartz/CronExpression.html
http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/scheduling/support/CronSequenceGenerator.html
spring-context-3.a.b.x.jar

Step 3: Take the diff between nex time and present time.
i.e TTL = next execution time – current time;

-o-
What is Cron Expression:
http://en.wikipedia.org/wiki/Cron

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s