Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kieker-TeeTime-Stages
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeeTime
Kieker-TeeTime-Stages
Commits
3c350c26
There was a problem fetching the pipeline summary.
Commit
3c350c26
authored
8 years ago
by
Lars Erik Blümke
Browse files
Options
Downloads
Patches
Plain Diff
Not needed anymore
parent
e66faec4
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/kieker/analysis/plugin/filter/AbstractKiekerFilter.java
+0
-132
0 additions, 132 deletions
...a/kieker/analysis/plugin/filter/AbstractKiekerFilter.java
with
0 additions
and
132 deletions
src/main/java/kieker/analysis/plugin/filter/AbstractKiekerFilter.java
deleted
100644 → 0
+
0
−
132
View file @
e66faec4
package
kieker.analysis.plugin.filter
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
kieker.analysis.AnalysisController
;
import
kieker.analysis.IProjectContext
;
import
kieker.analysis.analysisComponent.AbstractAnalysisComponent
;
import
kieker.analysis.analysisComponent.IAnalysisComponent
;
import
kieker.analysis.exception.InvalidProjectContextException
;
import
kieker.analysis.plugin.annotation.Plugin
;
import
kieker.analysis.plugin.annotation.Property
;
import
kieker.common.configuration.Configuration
;
import
kieker.common.logging.Log
;
import
kieker.common.logging.LogFactory
;
import
teetime.stage.basic.AbstractFilter
;
public
abstract
class
AbstractKiekerFilter
<
E
>
extends
AbstractFilter
<
E
>
implements
IAnalysisComponent
{
/** The name of the property for the name. This should normally only be used by Kieker. */
public
static
final
String
CONFIG_NAME
=
"name-hiddenAndNeverExportedProperty"
;
protected
static
final
Log
LOG
=
LogFactory
.
getLog
(
AbstractAnalysisComponent
.
class
);
// NOPMD (logger for inheriting classes)
private
static
final
AtomicInteger
UNNAMED_COUNTER
=
new
AtomicInteger
(
0
);
/** The project context (usually the analysis controller) of this component. */
protected
final
IProjectContext
projectContext
;
/** The current configuration of this component. */
protected
final
Configuration
configuration
;
/** The log for this component. */
protected
final
Log
log
;
// NOPMD (logger for inheriting classes)
/** The record time unit as provided by the project context. */
protected
final
TimeUnit
recordsTimeUnitFromProjectContext
;
private
final
String
name
;
/**
* Each AnalysisComponent requires a constructor with a Configuration object and a IProjectContext.
*
* @param configuration
* The configuration for this component.
* @param projectContext
* The project context for this component. The component will be registered.
*
* @throws NullPointerException
* If configuration or projectContext null
*/
public
AbstractKiekerFilter
(
final
Configuration
configuration
,
final
IProjectContext
projectContext
)
throws
NullPointerException
{
super
();
if
(
null
==
projectContext
)
{
throw
new
NullPointerException
(
"Missing projectContext"
);
}
if
(
null
==
configuration
)
{
throw
new
NullPointerException
(
"Missing configuration"
);
}
this
.
projectContext
=
projectContext
;
// somewhat dirty hack...
configuration
.
setDefaultConfiguration
(
this
.
getDefaultConfiguration
());
this
.
configuration
=
configuration
;
// Get the controller, as we have to register the name
final
AnalysisController
ac
;
if
(
projectContext
instanceof
AnalysisController
)
{
ac
=
(
AnalysisController
)
projectContext
;
}
else
{
throw
new
InvalidProjectContextException
(
"Invalid analysis controller in constructor"
);
}
// Try to determine the name
String
tmpName
=
configuration
.
getStringProperty
(
CONFIG_NAME
);
while
((
tmpName
.
length
()
==
0
)
||
!
ac
.
tryRegisterComponentName
(
tmpName
))
{
tmpName
=
this
.
getClass
().
getSimpleName
()
+
'-'
+
UNNAMED_COUNTER
.
incrementAndGet
();
}
this
.
name
=
tmpName
;
// As we have now a name, we can create our logger
this
.
log
=
LogFactory
.
getLog
(
this
.
getClass
().
getName
()
+
" ("
+
this
.
name
+
")"
);
// Try the record time unit
final
String
recordTimeunitProperty
=
projectContext
.
getProperty
(
IProjectContext
.
CONFIG_PROPERTY_NAME_RECORDS_TIME_UNIT
);
TimeUnit
recordTimeunit
;
try
{
recordTimeunit
=
TimeUnit
.
valueOf
(
recordTimeunitProperty
);
}
catch
(
final
IllegalArgumentException
ex
)
{
// already caught in AnalysisController, should never happen
this
.
log
.
warn
(
recordTimeunitProperty
+
" is no valid TimeUnit! Using NANOSECONDS instead."
);
recordTimeunit
=
TimeUnit
.
NANOSECONDS
;
}
this
.
recordsTimeUnitFromProjectContext
=
recordTimeunit
;
}
@Override
protected
void
execute
(
final
E
element
)
{
super
.
execute
();
}
/**
* This method delivers an instance of {@code Configuration} containing the default properties for this class.
*
* @return The default properties.
*/
protected
final
Configuration
getDefaultConfiguration
()
{
final
Configuration
defaultConfiguration
=
new
Configuration
();
// Get the annotation from the class
final
Plugin
pluginAnnotation
=
this
.
getClass
().
getAnnotation
(
Plugin
.
class
);
final
Property
[]
propertyAnnotations
=
pluginAnnotation
.
configuration
();
// Run through all properties within the annotation and add them to the configuration object
for
(
final
Property
property
:
propertyAnnotations
)
{
defaultConfiguration
.
setProperty
(
property
.
name
(),
property
.
defaultValue
());
}
return
defaultConfiguration
;
}
/**
* {@inheritDoc}
*/
@Override
public
abstract
Configuration
getCurrentConfiguration
();
/**
* {@inheritDoc}
*/
@Override
public
final
String
getName
()
{
return
this
.
name
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment