Package io.opencensus.tags
Class TagsComponent
- java.lang.Object
-
- io.opencensus.tags.TagsComponent
-
- Direct Known Subclasses:
NoopTags.NoopTagsComponent
,TagsComponentImplBase
public abstract class TagsComponent extends java.lang.Object
Class that holds the implementation forTagger
andTagPropagationComponent
.All objects returned by methods on
TagsComponent
are cacheable.- Since:
- 0.8
-
-
Constructor Summary
Constructors Constructor Description TagsComponent()
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description abstract TaggingState
getState()
Returns the currentTaggingState
.abstract Tagger
getTagger()
Returns theTagger
for this implementation.abstract TagPropagationComponent
getTagPropagationComponent()
Returns theTagPropagationComponent
for this implementation.abstract void
setState(TaggingState state)
Deprecated.This method is deprecated because other libraries could cache the result ofgetState()
, use a stale value, and behave incorrectly.
-
-
-
Method Detail
-
getTagPropagationComponent
public abstract TagPropagationComponent getTagPropagationComponent()
Returns theTagPropagationComponent
for this implementation.- Since:
- 0.8
-
getState
public abstract TaggingState getState()
Returns the currentTaggingState
.When no implementation is available,
getState
always returnsTaggingState.DISABLED
.Once
getState()
is called, subsequent calls tosetState(TaggingState)
will throw anIllegalStateException
.- Returns:
- the current
TaggingState
. - Since:
- 0.8
-
setState
@Deprecated public abstract void setState(TaggingState state)
Deprecated.This method is deprecated because other libraries could cache the result ofgetState()
, use a stale value, and behave incorrectly. It is only safe to call early in initialization. This method throwsIllegalStateException
aftergetState()
has been called, in order to limit changes to the result ofgetState()
.Sets the currentTaggingState
.When no implementation is available,
setState
does not change the state.- Parameters:
state
- the newTaggingState
.- Throws:
java.lang.IllegalStateException
- ifgetState()
was previously called.- Since:
- 0.8
-
-