Package zipkin2

Class Component

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    StorageComponent

    public abstract class Component
    extends java.lang.Object
    implements java.io.Closeable
    Components are object graphs used to compose a zipkin service or client. For example, a storage component might return a query api.

    Components are lazy with regards to I/O. They can be injected directly to other components so as to avoid crashing the application graph if a network service is unavailable.

    • Constructor Summary

      Constructors 
      Constructor Description
      Component()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      CheckResult check()
      Answers the question: Are operations on this component likely to succeed?
      void close()
      Closes any network resources created implicitly by the component.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Component

        public Component()
    • Method Detail

      • check

        public CheckResult check()
        Answers the question: Are operations on this component likely to succeed?

        Implementations should initialize the component if necessary. It should test a remote connection, or consult a trusted source to derive the result. They should use least resources possible to establish a meaningful result, and be safe to call many times, even concurrently.

        See Also:
        CheckResult.OK
      • close

        public void close()
                   throws java.io.IOException
        Closes any network resources created implicitly by the component.

        For example, if this created a connection, it would close it. If it was provided one, this would close any sessions, but leave the connection open.

        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException