Interface JCSWorkerHelper<V>

All Known Implementing Classes:
AbstractJCSWorkerHelper

public interface JCSWorkerHelper<V>
Interface for doing a piece of work which is expected to be cached. This is meant to be used in conjunction with JCSWorker.

Implement doWork() to return the work being done. isFinished() should return false until setFinished(true) is called, after which time it should return true.

  • Method Summary

    Modifier and Type
    Method
    Description
    The method to implement to do the work that should be cached.
    boolean
    Tells us whether or not the work has been completed.
    void
    setFinished(boolean isFinished)
    Sets whether or not the work has been done.
  • Method Details

    • isFinished

      boolean isFinished()
      Tells us whether or not the work has been completed. This will be called automatically by JCSWorker. You should not call it yourself.

      Returns:
      True if the work has already been done, otherwise false.
    • setFinished

      void setFinished(boolean isFinished)
      Sets whether or not the work has been done.

      Parameters:
      isFinished - True if the work has already been done, otherwise false.
    • doWork

      V doWork() throws Exception
      The method to implement to do the work that should be cached. JCSWorker will call this itself! You should not call this directly.

      Returns:
      The result of doing the work to be cached.
      Throws:
      Exception - If anything goes wrong while doing the work, an Exception should be thrown.