try {
Scheduler scheduler = getQuartzScheduler();
QuartzJobKey jobKey = QuartzJobKey.parse( jobId );
String groupName = jobKey.getUserName();
for ( Trigger trigger : scheduler.getTriggersOfJob( jobId, groupName ) ) {
Job job = new Job();
JobDetail jobDetail = scheduler.getJobDetail( jobId, groupName );
if ( jobDetail != null ) {
JobDataMap jobDataMap = jobDetail.getJobDataMap();
if ( jobDataMap != null ) {
Map<String, Serializable> wrappedMap = jobDataMap.getWrappedMap();
job.setJobParams( wrappedMap );
}
}
job.setJobId( jobId );
setJobTrigger( scheduler, job, trigger );
job.setUserName( jobDetail.getGroup() );
return job;
}
} catch ( org.quartz.SchedulerException e ) {
throw new SchedulerException( Messages.getInstance().getString(
"QuartzScheduler.ERROR_0007_FAILED_TO_GET_JOB", jobId ), e ); //$NON-NLS-1$