Class BasicJavaScriptJob

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean executeAsap_  
      private java.lang.Integer id_
      The job ID.
      private int initialDelay_
      The initial amount of time to wait before executing this job.
      private java.lang.Integer period_
      The amount of time to wait between executions of this job (maybe null).
      private long targetExecutionTime_
      The time at which this job should be executed.
    • Constructor Summary

      Constructors 
      Constructor Description
      BasicJavaScriptJob()
      Creates a new job instance that executes once, immediately.
      BasicJavaScriptJob​(int initialDelay, java.lang.Integer period)
      Creates a new job instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(JavaScriptJob other)
      java.lang.Integer getId()
      Returns the job ID.
      int getInitialDelay()
      Returns the initial amount of time to wait before executing this job.
      java.lang.Integer getPeriod()
      Returns the amount of time to wait between executions of this job (maybe null).
      long getTargetExecutionTime()
      Returns the target execution time of the job.
      boolean isExecuteAsap()
      Returns true if this job has to be executed asap.
      boolean isPeriodic()
      Returns true if this job executes periodically.
      void setId​(java.lang.Integer id)
      Sets the job ID.
      void setTargetExecutionTime​(long targetExecutionTime)
      Sets the target execution time of the job.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Runnable

        run
    • Field Detail

      • id_

        private java.lang.Integer id_
        The job ID.
      • initialDelay_

        private final int initialDelay_
        The initial amount of time to wait before executing this job.
      • period_

        private final java.lang.Integer period_
        The amount of time to wait between executions of this job (maybe null).
      • executeAsap_

        private final boolean executeAsap_
      • targetExecutionTime_

        private long targetExecutionTime_
        The time at which this job should be executed. Note: the browser will make its best effort to execute the job at the target time, as specified by the timeout/interval. However, depending on other scheduled jobs, this target time may not be the actual time at which the job is executed.
    • Constructor Detail

      • BasicJavaScriptJob

        public BasicJavaScriptJob()
        Creates a new job instance that executes once, immediately.
      • BasicJavaScriptJob

        BasicJavaScriptJob​(int initialDelay,
                           java.lang.Integer period)
        Creates a new job instance.
        Parameters:
        initialDelay - the initial amount of time to wait before executing this job
        period - the amount of time to wait between executions of this job (maybe null)
    • Method Detail

      • setId

        public void setId​(java.lang.Integer id)
        Sets the job ID.
        Specified by:
        setId in interface JavaScriptJob
        Parameters:
        id - the job ID
      • getId

        public java.lang.Integer getId()
        Returns the job ID.
        Specified by:
        getId in interface JavaScriptJob
        Returns:
        the job ID
      • getInitialDelay

        public int getInitialDelay()
        Returns the initial amount of time to wait before executing this job.
        Returns:
        the initial amount of time to wait before executing this job
      • getPeriod

        public java.lang.Integer getPeriod()
        Returns the amount of time to wait between executions of this job (maybe null).
        Specified by:
        getPeriod in interface JavaScriptJob
        Returns:
        the amount of time to wait between executions of this job (maybe null)
      • isPeriodic

        public boolean isPeriodic()
        Returns true if this job executes periodically.
        Specified by:
        isPeriodic in interface JavaScriptJob
        Returns:
        true if this job executes periodically
      • isExecuteAsap

        public boolean isExecuteAsap()
        Returns true if this job has to be executed asap.
        Specified by:
        isExecuteAsap in interface JavaScriptJob
        Returns:
        true if this job has to be executed asap
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(JavaScriptJob other)
        Specified by:
        compareTo in interface java.lang.Comparable<JavaScriptJob>
      • getTargetExecutionTime

        public long getTargetExecutionTime()
        Returns the target execution time of the job.
        Specified by:
        getTargetExecutionTime in interface JavaScriptJob
        Returns:
        the target execution time in ms
      • setTargetExecutionTime

        public void setTargetExecutionTime​(long targetExecutionTime)
        Sets the target execution time of the job.
        Specified by:
        setTargetExecutionTime in interface JavaScriptJob
        Parameters:
        targetExecutionTime - the new target execution time.