Class AbstractRule
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.rules.AbstractRule
-
-
Field Summary
Fields Modifier and Type Field Description protected FutureTask<IResult>evaluationTask
-
Constructor Summary
Constructors Constructor Description AbstractRule(String id, String name, String topic, Collection<TypedPreference<?>> configAttributes, Collection<TypedResult<?>> resultAttributes, Map<String,RulesToolkit.EventAvailability> requiredEvents)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description RunnableFuture<IResult>createEvaluation(IItemCollection items, IPreferenceValueProvider valueProvider, IResultValueProvider resultProvider)Gets a future representing the result of the evaluation of this rule.Collection<TypedPreference<?>>getConfigurationAttributes()Gets information about which attributes may be configured during rule evaluation.StringgetId()StringgetName()Map<String,RulesToolkit.EventAvailability>getRequiredEvents()protected abstract IResultgetResult(IItemCollection items, IPreferenceValueProvider vp, IResultValueProvider rp)Collection<TypedResult<?>>getResults()Gets information about which results may be part of anIResultinstance.StringgetTopic()
-
-
-
Field Detail
-
evaluationTask
protected FutureTask<IResult> evaluationTask
-
-
Constructor Detail
-
AbstractRule
public AbstractRule(String id, String name, String topic, Collection<TypedPreference<?>> configAttributes, Collection<TypedResult<?>> resultAttributes, Map<String,RulesToolkit.EventAvailability> requiredEvents)
-
-
Method Detail
-
getResult
protected abstract IResult getResult(IItemCollection items, IPreferenceValueProvider vp, IResultValueProvider rp)
-
createEvaluation
public RunnableFuture<IResult> createEvaluation(IItemCollection items, IPreferenceValueProvider valueProvider, IResultValueProvider resultProvider)
Description copied from interface:IRuleGets 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:
createEvaluationin interfaceIRule- Parameters:
items- items to evaluatevalueProvider- Provider of configuration values used for evaluation. The attributes that will be asked for from the provider should be provided byIRule.getConfigurationAttributes().resultProvider- Provider of results from rules evaluated prior to this rule and which this rule explicitly depends on via aDependsOnannotation. The attributes that will be asked for from the provider will be provided by each dependant rule, e.g. via public static constants.- Returns:
- a RunnableFuture that when run will return the evaluation result
-
getConfigurationAttributes
public Collection<TypedPreference<?>> getConfigurationAttributes()
Description copied from interface:IRuleGets information about which attributes may be configured during rule evaluation.- Specified by:
getConfigurationAttributesin interfaceIRule- Returns:
- a list of configuration attributes
-
getId
public String getId()
-
getName
public String getName()
-
getTopic
public String getTopic()
-
getResults
public Collection<TypedResult<?>> getResults()
Description copied from interface:IRuleGets information about which results may be part of anIResultinstance.- Specified by:
getResultsin interfaceIRule- Returns:
- a list of result attributes
-
getRequiredEvents
public Map<String,RulesToolkit.EventAvailability> getRequiredEvents()
- Specified by:
getRequiredEventsin interfaceIRule- Returns:
- a map of all event type IDs and the minimum
RulesToolkit.EventAvailabilitythis rule requires for that event type
-
-