Class AbstractOperation<T extends AbstractOperation<T>>

java.lang.Object
rife.bld.operations.AbstractOperation<T>
Direct Known Subclasses:
AbstractCreateOperation, AbstractProcessOperation, CleanOperation, CompileOperation, DependencyTreeOperation, DownloadOperation, JarOperation, JavadocOperation, PrecompileOperation, PublishOperation, PurgeOperation, UberJarOperation, UpdatesOperation, UpgradeOperation, VersionOperation, WarOperation

public abstract class AbstractOperation<T extends AbstractOperation<T>> extends Object
Provides common features across all operations
Since:
1.5.2
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    Performs the operation execution that can be wrapped by the #executeOnce call.
    void
    Ensures that this operation instance is executed once and only once.
    void
    Ensures that this operation instance is executed once and only once.
    boolean
    Indicates whether the operation should be silent or not.
    silent(boolean silent)
    Changes whether the operation should be silent or not.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbstractOperation

      public AbstractOperation()
  • Method Details

    • silent

      public T silent(boolean silent)
      Changes whether the operation should be silent or not.

      Defaults to not silent.

      Parameters:
      silent - true if the operation should be silent; false otherwise
      Returns:
      this operation instance
      Since:
      1.5.2
    • silent

      public boolean silent()
      Indicates whether the operation should be silent or not.
      Returns:
      true if the operation should be silent; false otherwise
      Since:
      1.5.2
    • executeOnce

      public void executeOnce() throws Exception
      Ensures that this operation instance is executed once and only once.
      Throws:
      Exception - when an exception was thrown by the execute() call
      Since:
      1.5.17
      See Also:
    • executeOnce

      public void executeOnce(Runnable setup) throws Exception
      Ensures that this operation instance is executed once and only once.

      A setup lambda can be provided that is called when the only execution takes place.

      Parameters:
      setup - the setup lambda that will be called with the only execution
      Throws:
      Exception - when an exception was thrown by the execute() call
      Since:
      1.5.17
      See Also:
    • execute

      public abstract void execute() throws Exception
      Performs the operation execution that can be wrapped by the #executeOnce call.
      Throws:
      Exception - when an exception occurs during the execution
      Since:
      1.5.10