File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Cronjob for a executing a single method of Java class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Cronjob for a executing a single method of Java class" Watch "Cronjob for a executing a single method of Java class" New topic
Author

Cronjob for a executing a single method of Java class

sangram nani
Greenhorn

Joined: Nov 27, 2011
Posts: 21
Hi Friends,

Am a new bie to Java, Currently we are running a daily cronjob of executing a class (a struts2 web application project) which sends an email to two different team @ a specific time. The class includes two methods, one for sending email to sales team, and other for sending email to business team of the list of created keywords on the site that day. The requirement is to send an email to sales team @ a different time, and to business team to other team. So, can i write cron jobs by specifying the method name, so that only that specific method will be executed @ that time.

Thanks.
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3947
    
  17

Not directly, your cron job would have to call your application's entry point. Your solution would be to add a parameter to the application which specifies which group to email. Then your application would have to read that parameter and do the right thing based on its value.


Steve
sangram nani
Greenhorn

Joined: Nov 27, 2011
Posts: 21
Thanks Steve for your solution.

Steve Luke wrote:Not directly, your cron job would have to call your application's entry point. Your solution would be to add a parameter to the application which specifies which group to email. Then your application would have to read that parameter and do the right thing based on its value.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cronjob for a executing a single method of Java class
 
Similar Threads
Threads
Java Business Development position
Thread sync issue
Java, J2EE, Swing/SWT Developer (Work From Home)
static methods multiple calls