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.
You can pass a parameter to your Main class, and use this parameter to call different method:
For sales team, run it with
java -cp . SelectMethod sales; and for the other team, usejava -cp . SelectMethod other.