Class OnePersonTeam

java.lang.Object
net.officefloor.frame.impl.spi.team.OnePersonTeam
All Implemented Interfaces:
Team

public class OnePersonTeam extends Object implements Team
Team having only one Thread.
Author:
Daniel Sagenschneider
  • Constructor Details

    • OnePersonTeam

      public OnePersonTeam(ThreadFactory threadFactory, long waitTime)
      Initiate.
      Parameters:
      threadFactory - ThreadFactory.
      waitTime - Time to wait in milliseconds for a Job.
  • Method Details

    • getThreadName

      public String getThreadName()
      Obtains the name of the single Thread.
      Returns:
      Name of the single Thread. Will be null if Team not started.
    • startWorking

      public void startWorking()
      Description copied from interface: Team
      Indicates for the Team to start working.
      Specified by:
      startWorking in interface Team
    • assignJob

      public void assignJob(Job job)
      Description copied from interface: Team
      Assigns a Job to be executed by this Team.
      Specified by:
      assignJob in interface Team
      Parameters:
      job - Job.
    • stopWorking

      public void stopWorking()
      Description copied from interface: Team

      Indicates for the Team to stop working.

      This method should block and only return control when the Team has stopped working and is no longer assigned Job instances to complete.

      Specified by:
      stopWorking in interface Team