Class TagsComponent
java.lang.Object
io.opencensus.tags.TagsComponent
- Direct Known Subclasses:
NoopTags.NoopTagsComponent, TagsComponentImplBase
Class that holds the implementation for
Tagger and TagPropagationComponent.
All objects returned by methods on TagsComponent are cacheable.
- Since:
- 0.8
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract TaggingStategetState()Returns the currentTaggingState.abstract TaggerReturns theTaggerfor this implementation.abstract TagPropagationComponentReturns theTagPropagationComponentfor this implementation.abstract voidsetState(TaggingState state) Deprecated.
-
Constructor Details
-
TagsComponent
public TagsComponent()
-
-
Method Details
-
getTagger
-
getTagPropagationComponent
Returns theTagPropagationComponentfor this implementation.- Since:
- 0.8
-
getState
Returns the currentTaggingState.When no implementation is available,
getStatealways returnsTaggingState.DISABLED.Once
getState()is called, subsequent calls tosetState(TaggingState)will throw anIllegalStateException.- Returns:
- the current
TaggingState. - Since:
- 0.8
-
setState
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 throwsIllegalStateExceptionaftergetState()has been called, in order to limit changes to the result ofgetState().Sets the currentTaggingState.When no implementation is available,
setStatedoes not change the state.- Parameters:
state- the newTaggingState.- Throws:
IllegalStateException- ifgetState()was previously called.- Since:
- 0.8
-
getState(), use a stale value, and behave incorrectly.