Class TagsComponent

java.lang.Object
io.opencensus.tags.TagsComponent
Direct Known Subclasses:
NoopTags.NoopTagsComponent, TagsComponentImplBase

public abstract class TagsComponent extends Object
Class that holds the implementation for Tagger and TagPropagationComponent.

All objects returned by methods on TagsComponent are cacheable.

Since:
0.8
  • Constructor Details

    • TagsComponent

      public TagsComponent()
  • Method Details

    • getTagger

      public abstract Tagger getTagger()
      Returns the Tagger for this implementation.
      Since:
      0.8
    • getTagPropagationComponent

      public abstract TagPropagationComponent getTagPropagationComponent()
      Returns the TagPropagationComponent for this implementation.
      Since:
      0.8
    • getState

      public abstract TaggingState getState()
      Returns the current TaggingState.

      When no implementation is available, getState always returns TaggingState.DISABLED.

      Once getState() is called, subsequent calls to setState(TaggingState) will throw an IllegalStateException.

      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 of getState(), use a stale value, and behave incorrectly. It is only safe to call early in initialization. This method throws IllegalStateException after getState() has been called, in order to limit changes to the result of getState().
      Sets the current TaggingState.

      When no implementation is available, setState does not change the state.

      Parameters:
      state - the new TaggingState.
      Throws:
      IllegalStateException - if getState() was previously called.
      Since:
      0.8