Package com.yahoo.search.dispatch
Class CloseableInvoker
java.lang.Object
com.yahoo.search.dispatch.CloseableInvoker
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
FillInvoker
,SearchInvoker
CloseableInvoker is an abstract implementation of
Closeable
with an additional hook for
executing code at closing. Classes that extend CloseableInvoker need to override release()
instead of close()
which is final to avoid accidental overriding.- Author:
- ollivir
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
close()
protected abstract void
release()
protected void
setFinalStatus
(boolean success) void
teardown
(BiConsumer<Boolean, com.yahoo.search.dispatch.RequestDuration> teardown)
-
Constructor Details
-
CloseableInvoker
public CloseableInvoker()
-
-
Method Details
-
release
protected abstract void release() -
teardown
-
setFinalStatus
protected void setFinalStatus(boolean success) -
close
public final void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-