package com.acme.structure.job;


import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;


public class SchedulerJob implements Job
{
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException
    {
        try
        {
            // jndiName and methodName are the reference to a calling method
            String jndiName = context.getJobDetail().getJobDataMap().getString("jndiName");
            String methodName = context.getJobDetail().getJobDataMap().getString("methodName");
            // quartz user is being used for authorization
//            Object invokedObject = ServiceLocator.createNewInstance("quartz").getResource(jndiName);
//            Method invokedMethod = invokedObject.getClass().getDeclaredMethod(methodName);
//            invokedMethod.invoke(invokedObject);
        }
        catch (Exception exc)
        {
            exc.printStackTrace();
        }
    }
}
