Class FileWriterTaskBase

java.lang.Object
org.aksw.shellgebra.exec.stage.FileWriterTaskBase
All Implemented Interfaces:
AutoCloseable, FileWriterTask
Direct Known Subclasses:
FileWriterTaskFromContainer, FileWriterTaskNoop, FileWriterTaskViaExecutor

public abstract class FileWriterTaskBase extends Object implements FileWriterTask
  • Field Details

  • Constructor Details

    • FileWriterTaskBase

      public FileWriterTaskBase(Path path, PathLifeCycle pathLifeCycle)
  • Method Details

    • getOutputPath

      public Path getOutputPath()
      Description copied from interface: FileWriterTask
      The path that will be written to by this writer.
      Specified by:
      getOutputPath in interface FileWriterTask
    • checkIfNew

      protected void checkIfNew()
    • checkIfAbortHasBeenCalled

      protected void checkIfAbortHasBeenCalled()
      Only call this method from within a synchronized block!
    • isStarted

      public boolean isStarted()
    • isFinished

      public boolean isFinished()
    • getState

      public FileWriterTaskBase.TaskState getState()
    • prepareWriteFile

      protected abstract void prepareWriteFile() throws IOException
      Method that allows for setting up resources in an atomic way. STARTING.
      Throws:
      IOException
    • runWriteFile

      protected abstract void runWriteFile() throws IOException
      Throws:
      IOException
    • onCompletion

      protected abstract void onCompletion() throws IOException
      Called on completion - regardless whether successful or not. Only called if prepareWriteFile has been called before. (doWriteFile may not have been called).
      Throws:
      IOException
    • waitForCompletion

      public abstract void waitForCompletion() throws ExecutionException, InterruptedException
      Specified by:
      waitForCompletion in interface FileWriterTask
      Throws:
      ExecutionException
      InterruptedException
    • abort

      public abstract void abort()
      Specified by:
      abort in interface FileWriterTask