Scripts
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb Site ManagementScripts

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 27th, 2011, 11:43 PM
sangramanand sangramanand is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2010
Posts: 42 sangramanand User rank is Private First Class (20 - 50 Reputation Level)sangramanand User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 10 h 45 m
Reputation Power: 4
Cronjob for a executing a single method of Java class

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.

Reply With Quote
  #2  
Old May 7th, 2012, 07:14 AM
Jaseeey Jaseeey is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2012
Location: Adelaide, AU
Posts: 2 Jaseeey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 23 sec
Reputation Power: 0
Hi,

A cron job cannot execute a single method within a Java class file because it's not designed for this. Cron jobs simply execute a command at a given time or interval with any additional parameters specified in the command line. I guess based on this, you could create a separate driver class which executes the single method, or otherwise you could create some form of parameter input which has a condition to run the single method.

I'm no Java expert, but I'm pretty sure that's the way to go.

Cheers,

Jason.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb Site ManagementScripts > Cronjob for a executing a single method of Java class

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap