Interface WorkerConfiguration

  • All Superinterfaces:
    ActionConfiguration, Describable

    @Incubating
    public interface WorkerConfiguration
    extends Describable, ActionConfiguration
    Represents the configuration of a worker. Used when submitting an item of work to the WorkerExecutor.
          workerExecutor.submit(RunnableWorkImpl.class) { WorkerConfiguration conf ->
              conf.isolationMode = IsolationMode.PROCESS
    
              forkOptions { JavaForkOptions options ->
                  options.maxHeapSize = "512m"
                  options.systemProperty 'some.prop', 'value'
                  options.jvmArgs "-server"
              }
    
              classpath configurations.fooLibrary
    
              conf.params = [ "foo", file('bar') ]
          }
     
    Since:
    3.5
    • Method Detail

      • classpath

        void classpath​(Iterable<File> files)
        Adds a set of files to the classpath associated with the worker.
        Parameters:
        files - - the files to add to the classpath
      • setClasspath

        void setClasspath​(Iterable<File> files)
        Sets the classpath associated with the worker.
        Parameters:
        files - - the files to set the classpath to
      • getClasspath

        Iterable<File> getClasspath()
        Gets the classpath associated with the worker.
        Returns:
        the classpath associated with the worker
      • setIsolationMode

        void setIsolationMode​(IsolationMode isolationMode)
        Sets the isolation mode for this worker, see IsolationMode.
        Parameters:
        isolationMode - the forking mode for this worker, see IsolationMode
        Since:
        4.0
      • setForkMode

        void setForkMode​(ForkMode forkMode)
        Sets the forking mode for this worker, see ForkMode.
        Parameters:
        forkMode - the forking mode for this worker, see ForkMode
      • forkOptions

        void forkOptions​(Action<? super JavaForkOptions> forkOptionsAction)
        Executes the provided action against the JavaForkOptions object associated with this builder.
        Parameters:
        forkOptionsAction - - An action to configure the JavaForkOptions for this builder
      • setDisplayName

        void setDisplayName​(String displayName)
        Sets the name to use when displaying this item of work.
        Parameters:
        displayName - the name of this item of work