Package zipkin2
Class Component
- java.lang.Object
-
- zipkin2.Component
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
StorageComponent
public abstract class Component extends Object implements 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.
-
-
-
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 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 interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-