Class CheckCallerRunsPolicy

  • All Implemented Interfaces:
    Policy

    public class CheckCallerRunsPolicy
    extends java.lang.Object
    implements Policy
    If either UNICAST3 or NAKACK2 are missing, then this policy checks that the thread pool has a rejection policy of ThreadPoolExecutor.CallerRunsPolicy.
    Issues a warning and changes the rejection policy to ThreadPoolExecutor.CallerRunsPolicy if not.
    Since:
    5.2.14
    Author:
    Bela Ban
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.Class<? extends Protocol> NAKACK2  
      protected static java.lang.Class<? extends Protocol> UNICAST3  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void check​(Protocol prot)
      Checks that a condition is met in a given protocol
      protected static boolean isCallerRunsHandler​(java.util.concurrent.RejectedExecutionHandler h)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • UNICAST3

        protected static final java.lang.Class<? extends Protocol> UNICAST3
      • NAKACK2

        protected static final java.lang.Class<? extends Protocol> NAKACK2
    • Constructor Detail

      • CheckCallerRunsPolicy

        public CheckCallerRunsPolicy()
    • Method Detail

      • check

        public void check​(Protocol prot)
                   throws java.lang.Exception
        Description copied from interface: Policy
        Checks that a condition is met in a given protocol
        Specified by:
        check in interface Policy
        Parameters:
        prot - The protocol in which the policy is run
        Throws:
        java.lang.Exception - Thrown if the condition is not met
      • isCallerRunsHandler

        protected static boolean isCallerRunsHandler​(java.util.concurrent.RejectedExecutionHandler h)