Class WaitService

    • Constructor Detail

      • WaitService

        public WaitService()

        Creates a new instance.

      • WaitService

        public WaitService​(TimeInterval wait,
                           java.lang.Boolean randomize)
      • WaitService

        public WaitService​(java.lang.String uniqueId)
    • Method Detail

      • doService

        public void doService​(AdaptrisMessage msg)
                       throws ServiceException

        Waits for the configured number of milliseconds.

        Parameters:
        msg - the message to apply service to
        Throws:
        ServiceException - wrapping any underlying Exceptions
      • waitMs

        protected long waitMs()
      • setWaitInterval

        public void setWaitInterval​(TimeInterval interval)
        Set how long to wait for.
        Parameters:
        interval - if not specified then the default is 20 seconds.
      • getRandomize

        public java.lang.Boolean getRandomize()
      • setRandomize

        public void setRandomize​(java.lang.Boolean b)
        Set to true to randomize the wait time between 0 and the value specified by setWaitInterval(TimeInterval)
        Parameters:
        b - default null (false)
      • randomizeWait

        protected boolean randomizeWait()
      • getExceptionOnInterrupt

        public java.lang.Boolean getExceptionOnInterrupt()
        Returns:
        the exceptionOnInterupt
      • setExceptionOnInterrupt

        public void setExceptionOnInterrupt​(java.lang.Boolean b)
        Whether or not to throw an exception if an InterruptedException happens.
        Parameters:
        b - the exceptionOnInterupt to set
        Since:
        3.6.6