log.debug("endpointActivation, spec="+spec);
QuartzActivationSpec quartzSpec = (QuartzActivationSpec) spec;
// allocate instance of endpoint to figure out its endpoint interface
Class clazz = QuartzJob.class;
MessageEndpoint tmpMe = endpointFactory.createEndpoint(null);
if (tmpMe instanceof StatefulJob) clazz = StatefulQuartzJob.class;
tmpMe.release();
try
{
JobDetail jobDetail = new JobDetail(quartzSpec.getJobName(), quartzSpec.getJobGroup(), clazz, quartzSpec.getVolatility(), quartzSpec.getDurable(), quartzSpec.getRecoverable());
jobDetail.getJobDataMap().setAllowsTransientData(true);
jobDetail.getJobDataMap().put("endpointFactory", endpointFactory);
log.debug("adding job: " + quartzSpec);
CronTrigger trigger = new CronTrigger(quartzSpec.getTriggerName(), quartzSpec.getTriggerGroup(), quartzSpec.getCronTrigger());
sched.scheduleJob(jobDetail, trigger);
}
catch (Exception e)
{
log.error(e);
throw new ResourceException(e);
}