Class ScheduledTaskPoller

    • Field Detail

      • executor

        protected transient java.util.concurrent.ScheduledExecutorService executor
      • pollerTask

        protected transient java.util.concurrent.ScheduledFuture pollerTask
    • Constructor Detail

      • ScheduledTaskPoller

        public ScheduledTaskPoller()
    • Method Detail

      • init

        public void init()
                  throws CoreException
        Description copied from interface: ComponentLifecycle
        Initialises the component.

        Component initialisation includes config verification, creation of connections etc.

        Throws:
        CoreException - wrapping any underlying Exceptions
      • start

        public void start()
                   throws CoreException
        Description copied from interface: ComponentLifecycle
        Starts the component.

        Once a component is started it should be ready to process messages. In the case of AdaptrisMessageConsumer, calling start will begin message delivery.

        Throws:
        CoreException - wrapping any underlying Exceptions
      • scheduleTask

        protected abstract void scheduleTask()
      • stop

        public void stop()
        Description copied from interface: ComponentLifecycle
        Stop the component

        A stopped component is not expected to be ready to process messages. In the case of AdaptrisMessageConsumer, calling stop will pause message delivery. Throwing a RuntimeException may cause unintended consequences

      • close

        public void close()
        Description copied from interface: ComponentLifecycle
        Closes the component.

        A closed component should release any connections it uses, etc. and clean up completely. Throwing a RuntimeException may cause unintended consequences

      • getShutdownWaitTime

        public TimeInterval getShutdownWaitTime()
      • setShutdownWaitTime

        public void setShutdownWaitTime​(TimeInterval interval)
        Set the shutdown wait timeout for the pool.

        When stop() is invoked, this causes a emptying and shutdown of the pool. The specified value is the amount of time to wait for a clean shutdown. If this timeout is exceeded then a forced shutdown ensues, which may mean messages are in an inconsistent state.

        Parameters:
        interval - the shutdown time (default is 60 seconds)
        See Also:
        stop()