public class StrategyStorage extends java.lang.Object implements RecorderElementFactory
| Modifier and Type | Field and Description |
|---|---|
private HashMap<java.lang.String,RecorderElement> |
defaults
Stores default recorder elements which should be available by
their name only (fix).
|
private RecorderElementMap |
recorderElements
Stores the recorder elements and performs the internal mapping
between group ids and class names.
|
private boolean |
variabilityDetectionEnabled
Stores if automatic variability detection is enabled.
|
| Constructor and Description |
|---|
StrategyStorage()
Creates a new recorder strategy.
|
| Modifier and Type | Method and Description |
|---|---|
RecorderElement |
create(MonitoringGroupConfiguration conf,
boolean forceDefaultInstances)
Creates a recorder element.
|
void |
enableVariabilityDetection(boolean enable)
Enables or disables automatic variability detection.
|
protected RecorderElement |
getRecorderElement(java.lang.String id)
Returns the recorder element for the given recording group id.
|
RecorderElementMap |
getRecorderElements()
Returns the set of recorder elements used by this strategy.
|
java.lang.String |
getRecorderId(java.lang.String className)
Maps a class name to its recorder id (called in this interface usually
recId). |
char |
getVariabilitySeparatorChar()
Returns the char used for separating the variability id and its
current value (in configurations).
|
boolean |
isOk(RecorderElement element,
MonitoringGroupConfiguration conf)
Returns if the given
element is adequate (e.g. supports
debugging) or if a new instance must be created and information must be
taken over. |
boolean |
isVariabilityDetectionEnabled()
Returns if automatic variability detection is enabled.
|
private static void |
logConsistencyWarning(java.lang.String recId1,
java.lang.String recId2)
Emits a consistency warning.
|
void |
registerDefaultRecorderElement(java.lang.String recId,
RecorderElement elt)
Registers an default recorder elements which should be available by
its name only (fix).
|
void |
registerForRecording(java.lang.String className,
java.lang.String recId,
MonitoringGroupConfiguration conf,
MonitoringGroupSettings settings)
Registers a given class for recording.
|
private RecorderElementMap recorderElements
private boolean variabilityDetectionEnabled
private HashMap<java.lang.String,RecorderElement> defaults
public StrategyStorage()
public RecorderElement create(MonitoringGroupConfiguration conf, boolean forceDefaultInstances)
create in interface RecorderElementFactoryconf - the configuration to be considered for creating the elementforceDefaultInstances - if true do only create the
default instances, otherways also those collecting contributing
variants can be createdpublic boolean isOk(RecorderElement element, MonitoringGroupConfiguration conf)
element is adequate (e.g. supports
debugging) or if a new instance must be created and information must be
taken over. This method is relevant, as instances may be created before
the annotated class is loaded, e.g. during automated variant detection.isOk in interface RecorderElementFactoryelement - the element to be testedconf - the configuration associated with elementtrue if the instance is adequate,
false if element must be revisedpublic RecorderElementMap getRecorderElements()
public java.lang.String getRecorderId(java.lang.String className)
recId).className - the class name to be mappedclassNamepublic char getVariabilitySeparatorChar()
public void registerForRecording(java.lang.String className,
java.lang.String recId,
MonitoringGroupConfiguration conf,
MonitoringGroupSettings settings)
id might be specified to which the measurements are
assigned to. Ids are unique strings without inherent semantics. If
not given, the className is used for grouping and assigning
measurements (implicit 1-groups).className - the name of the class measurements should be registered
forrecId - an optional group identification (may be empty or
null)conf - additional configuration for the monitoring group derived
from settingssettings - the monitoring group settings including all configuration
information (reference should not be stored, will be freed
explicitly)private static void logConsistencyWarning(java.lang.String recId1,
java.lang.String recId2)
recId1 - the first recorder idrecId2 - the second recorder idpublic void enableVariabilityDetection(boolean enable)
enable - true if variability detection should be
enabled, false elsepublic boolean isVariabilityDetectionEnabled()
true if variability detection should be
enabled, false elseprotected RecorderElement getRecorderElement(java.lang.String id)
defaults.id - the group identificationpublic void registerDefaultRecorderElement(java.lang.String recId,
RecorderElement elt)
recId - the recorder idelt - the element