Is there a way to write a Spring bean in XML so that it uses constructor which doesn't need an argument. For instance:
public class CronSchedule {
public CronSchedule() throws Exception {
SchedulerFactory sf = new StdSchedulerFactory();
Scheduler sched = sf.getScheduler();
JobDetail jd = new JobDetail("job1", "group1", CronJob.class);
CronTrigger ct = new CronTrigger("cronTrigger", "group2", "0 * * * * ?");
sched.scheduleJob(jd, ct);
sched.start();
}
}
Should I use <constructor-arg />
or I should write just bean tags without it ?
<bean name="cronSchedule" class="com.lastogat.CronSchedule">
<constructor-arg />
</bean>