Package com.yahoo.search.dispatch
Class CloseableInvoker
- java.lang.Object
-
- com.yahoo.search.dispatch.CloseableInvoker
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
FillInvoker
,SearchInvoker
public abstract class CloseableInvoker extends java.lang.Object implements java.io.Closeable
CloseableInvoker is an abstract implementation ofCloseable
with an additional hook for executing code at closing. Classes that extend CloseableInvoker need to overriderelease()
instead ofclose()
which is final to avoid accidental overriding.- Author:
- ollivir
-
-
Constructor Summary
Constructors Constructor Description CloseableInvoker()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
protected abstract void
release()
protected void
setFinalStatus(boolean success)
void
teardown(java.util.function.BiConsumer<java.lang.Boolean,java.lang.Long> teardown)
-
-
-
Method Detail
-
release
protected abstract void release()
-
teardown
public void teardown(java.util.function.BiConsumer<java.lang.Boolean,java.lang.Long> teardown)
-
setFinalStatus
protected void setFinalStatus(boolean success)
-
close
public final void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-