Class DefaultPriorityManagmentProvider

    • Constructor Detail

      • DefaultPriorityManagmentProvider

        public DefaultPriorityManagmentProvider​(net.toddm.cache.LoggingProvider loggingProvider)
        Returns an instance of DefaultPriorityManagmentProvider.
        Parameters:
        loggingProvider - OPTIONAL If NULL no logging callbacks are made otherwise the provided implementation will get log messages.
    • Method Detail

      • promotePriority

        public void promotePriority​(Priority priority)
        Decides if the given instance of Priority should be adjusted and makes the adjustment if it should.
        Note: CommManager will call this method each time it is deciding if work should begin, implement accordingly.

        This implementation does simple priority promotion based on age to help alleviate queue starvation.

        Specified by:
        promotePriority in interface PriorityManagementProvider
      • getPriorityComparator

        public Comparator<Priority> getPriorityComparator()
        Returns a Comparator that will be used to control priority order and thus effect the order in which work is attempted. Note: CommManager will call this method each time it is deciding if work should begin, implement accordingly.

        This implementation sorts on priority values and then on creation timestamp for equal priorities.

        Specified by:
        getPriorityComparator in interface PriorityManagementProvider