Class BiasedLockingRevocationRule

  • All Implemented Interfaces:
    IRule

    public final class BiasedLockingRevocationRule
    extends java.lang.Object
    implements IRule
    This rule is making use of the new dedicated biased locking revocation events available in JDK 10/18.3. It will fire whenever a class is excluded from biased lockings, or whenever there have been more than 15 revocations (can be configured) for a particular class.
    • Constructor Detail

      • BiasedLockingRevocationRule

        public BiasedLockingRevocationRule()
    • Method Detail

      • calculateRevocationCountScore

        private int calculateRevocationCountScore​(java.util.List<ClassEntry> offendingClasses)
      • filteredMerge

        private java.util.List<ClassEntry> filteredMerge​(java.util.Set<java.lang.String> filteredTypes,
                                                         java.util.Set<IMCType> revokedTypes,
                                                         java.util.Map<IMCType,​ClassEntry> offendingClassRevocations,
                                                         java.util.Map<IMCType,​ClassEntry> offendingRevocations)
        Parameters:
        filteredTypes - user filtered types
        revokedTypes - the types that were revoked during this recording.
        offendingClassRevocations -
        offendingRevocations -
        Returns:
      • putIfNotInFiltered

        private static void putIfNotInFiltered​(java.util.Set<java.lang.String> filteredTypes,
                                               java.util.Set<IMCType> revokedTypes,
                                               java.util.Map<IMCType,​ClassEntry> merged,
                                               java.util.Map.Entry<IMCType,​ClassEntry> entry)
      • filter

        private java.util.Set<IMCType> filter​(java.util.Set<java.lang.String> filteredTypes,
                                              java.util.Set<IMCType> types)
      • getFilteredTypes

        private static java.util.Set<java.lang.String> getFilteredTypes​(java.lang.String preferenceValue)
      • evaluate

        public java.util.concurrent.RunnableFuture<Result> evaluate​(IItemCollection items,
                                                                    IPreferenceValueProvider valueProvider)
        Description copied from interface: IRule
        Gets a future representing the result of the evaluation of this rule. Running the RunnableFuture is the responsibility of the caller of this method, not the implementation.
        Specified by:
        evaluate in interface IRule
        Parameters:
        items - items to evaluate
        valueProvider - Provider of configuration values used for evaluation. The attributes that will be asked for from the provider should be provided by IRule.getConfigurationAttributes().
        Returns:
        a RunnableFuture that when run will return the evaluation result
      • getConfigurationAttributes

        public java.util.Collection<TypedPreference<?>> getConfigurationAttributes()
        Description copied from interface: IRule
        Gets information about which attributes may be configured during rule evaluation.
        Specified by:
        getConfigurationAttributes in interface IRule
        Returns:
        a list of configuration attributes
      • getId

        public java.lang.String getId()
        Specified by:
        getId in interface IRule
        Returns:
        a unique id for this rule implementation
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface IRule
        Returns:
        a human readable name for this rule
      • getTopic

        public java.lang.String getTopic()
        Specified by:
        getTopic in interface IRule
        Returns:
        the topic for this rule, may be null