net.officefloor.frame.impl.spi.team
Class OnePersonTeam

java.lang.Object
  extended by 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

Nested Class Summary
 class OnePersonTeam.OnePerson
          The individual comprising the Team.
 
Field Summary
protected  OnePersonTeam.OnePerson person
          OnePersonTeam.OnePerson of this Team.
 
Constructor Summary
OnePersonTeam(String teamName, TeamIdentifier teamIdentifier, long waitTime)
          Initiate.
 
Method Summary
 void assignJob(Job job, TeamIdentifier assignerTeam)
          Assigns a Job to be executed by this Team.
 void startWorking()
          Indicates for the Team to start working.
 void stopWorking()
           Indicates for the Team to stop working.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

person

protected OnePersonTeam.OnePerson person
OnePersonTeam.OnePerson of this Team.

Constructor Detail

OnePersonTeam

public OnePersonTeam(String teamName,
                     TeamIdentifier teamIdentifier,
                     long waitTime)
Initiate.

Parameters:
teamName - Name of this Team.
teamIdentifier - TeamIdentifier of this Team.
waitTime - Time to wait in milliseconds for a Job.
Method Detail

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,
                      TeamIdentifier assignerTeam)
Description copied from interface: Team
Assigns a Job to be executed by this Team.

Specified by:
assignJob in interface Team
Parameters:
job - Job.
assignerTeam - TeamIdentifier of the Team assigning the Job to this Team.

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


Copyright © 2005-2013. All Rights Reserved.