3 Replies Latest reply on Apr 25, 2008 7:07 PM by Jason Long

    QuartzTriggerHandle Running

    Tom Goring Apprentice

      Hi,


      I want to tell if my quartz job is running.
      (I want to show a running icon next to the record)


      However seam's QuartzTriggerHandle triggerName is private and thus I can't seem to find a way to the API to tell.


      Any ideas ?


      Thanks


      Tom

        • 1. Re: QuartzTriggerHandle Running
          Jason Long Novice

          I use the following as a hack.  I will replace this when the Seam API changes.  I believe there is a JIRA for this, but I am not sure.


          import java.lang.reflect.Field;
          import org.jboss.seam.async.QuartzTriggerHandle;
          
          public class QuartzUtil {
          
               public static String getTriggerName(QuartzTriggerHandle handle)
               {
                    Field field;
                    String value = null;
                    try {
                         field = handle.getClass().getDeclaredField("triggerName");
                         field.setAccessible(true);
                         value = (String) field.get(handle);
                    } catch (SecurityException e) {
                         e.printStackTrace();
                    } catch (NoSuchFieldException e) {
                         e.printStackTrace();
                    } catch (IllegalArgumentException e) {
                         e.printStackTrace();
                    } catch (IllegalAccessException e) {
                         e.printStackTrace();
                    }
                    return value;
               }
          }


          • 2. Re: QuartzTriggerHandle Running
            Tom Goring Apprentice

            Cheers for that....


            Do you know the API to tell if the Job is running?


            Thanks


            tom

            • 3. Re: QuartzTriggerHandle Running
              Jason Long Novice

              I do not.  When you find it please post it here.