class SandboxedPersistentQueryMetadata extends PersistentQueryMetadata {

  @Override
  public void close() {
    closed = true;
    closeCallback.accept(this);
  }

  private  SandboxedPersistentQueryMetadata(
      final PersistentQueryMetadata queryMetadata,
      final Consumer<QueryMetadata> closeCallback
  );

}