Class IdlePurgePolicy

    • Constructor Detail

      • IdlePurgePolicy

        public IdlePurgePolicy​(long timeToLive,
                               long checkInterval,
                               ConfigurationScheduler scheduler)
    • Method Detail

      • stop

        public boolean stop​(long timeout,
                            TimeUnit timeUnit)
        Description copied from interface: LifeCycle2
        Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.
        Specified by:
        stop in interface LifeCycle2
        Overrides:
        stop in class AbstractLifeCycle
        Parameters:
        timeout - the maximum time to wait
        timeUnit - the time unit of the timeout argument
        Returns:
        true if the receiver was stopped cleanly and normally, false otherwise.
      • purge

        public void purge()
        Purging appenders that were not in use specified time
        Specified by:
        purge in interface PurgePolicy
      • run

        public void run()
        Specified by:
        run in interface Runnable
      • createPurgePolicy

        @PluginFactory
        public static PurgePolicy createPurgePolicy​(@PluginAttribute("timeToLive")
                                                    String timeToLive,
                                                    @PluginAttribute("checkInterval")
                                                    String checkInterval,
                                                    @PluginAttribute("timeUnit")
                                                    String timeUnit,
                                                    @PluginConfiguration
                                                    Configuration configuration)
        Create the PurgePolicy
        Parameters:
        timeToLive - the number of increments of timeUnit before the Appender should be purged.
        checkInterval - when all appenders purged, the number of increments of timeUnit to check if any appenders appeared
        timeUnit - the unit of time the timeToLive and the checkInterval is expressed in.
        Returns:
        The Routes container.