summaryrefslogtreecommitdiffstats
path: root/jdisc_core/src/main/java/com/yahoo/jdisc/application/DeactivatedContainer.java
diff options
context:
space:
mode:
Diffstat (limited to 'jdisc_core/src/main/java/com/yahoo/jdisc/application/DeactivatedContainer.java')
-rw-r--r--jdisc_core/src/main/java/com/yahoo/jdisc/application/DeactivatedContainer.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/application/DeactivatedContainer.java b/jdisc_core/src/main/java/com/yahoo/jdisc/application/DeactivatedContainer.java
index 88943617fef..af28d756fe6 100644
--- a/jdisc_core/src/main/java/com/yahoo/jdisc/application/DeactivatedContainer.java
+++ b/jdisc_core/src/main/java/com/yahoo/jdisc/application/DeactivatedContainer.java
@@ -7,13 +7,14 @@ import com.yahoo.jdisc.Response;
import com.yahoo.jdisc.handler.ContentChannel;
/**
- * <p>This interface represents a {@link Container} which has been deactivated. An instance of this class is returned by
- * the {@link ContainerActivator#activateContainer(ContainerBuilder)} method, and is used to schedule a cleanup task
- * that is executed once the the deactivated Container has terminated.</p>
+ * <p>This interface represents a {@link Container} which is in the process of being deactivated. Closing this
+ * releases the last non-request-response reference to the container, and enables its termination.
+ * An instance of this class is returned by the {@link ContainerActivator#activateContainer(ContainerBuilder)} method,
+ * and is used to schedule a cleanup task that is executed once the the deactivated Container has terminated. </p>
*
* @author Simon Thoresen Hult
*/
-public interface DeactivatedContainer {
+public interface DeactivatedContainer extends AutoCloseable {
/**
* <p>Returns the context object that was previously attached to the corresponding {@link ContainerBuilder} through
@@ -35,4 +36,11 @@ public interface DeactivatedContainer {
*/
void notifyTermination(Runnable task);
+ /**
+ * <p>Close this DeactivatedContainer. This releases the last non-request-response reference to the container, and
+ * enables its termination.</p>
+ */
+ @Override
+ void close();
+
}