Package net.officefloor.frame.test
Class BackPressureTeamSource
- java.lang.Object
-
- net.officefloor.frame.api.team.source.impl.AbstractTeamSource
-
- net.officefloor.frame.test.BackPressureTeamSource
-
- All Implemented Interfaces:
TeamSource,Team
public class BackPressureTeamSource extends AbstractTeamSource implements Team
TeamSourcethat causes back pressure to be applied.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.officefloor.frame.api.team.source.impl.AbstractTeamSource
AbstractTeamSource.SpecificationContext
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.concurrent.RejectedExecutionExceptionBACK_PRESSURE_EXCEPTIONRejectedExecutionExceptionthrown to indicate back pressure.
-
Constructor Summary
Constructors Constructor Description BackPressureTeamSource()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassignJob(Job job)TeamcreateTeam(TeamSourceContext context)Creates theTeam.static intgetBackPressureEscalationCount()Obtains the number of back pressureEscalationinstances that have occurred.protected voidloadSpecification(AbstractTeamSource.SpecificationContext context)Overridden to load specification.static voidresetBackPressureEscalationCount(int count)Resets the back pressureEscalationcount.voidstartWorking()Indicates for theTeamto start working.voidstopWorking()Indicates for theTeamto stop working.-
Methods inherited from class net.officefloor.frame.api.team.source.impl.AbstractTeamSource
getSpecification
-
-
-
-
Method Detail
-
getBackPressureEscalationCount
public static int getBackPressureEscalationCount()
Obtains the number of back pressureEscalationinstances that have occurred.- Returns:
- Number of back pressure
Escalationinstances that have occurred.
-
resetBackPressureEscalationCount
public static void resetBackPressureEscalationCount(int count)
Resets the back pressureEscalationcount.- Parameters:
count- Count to reset theEscalationcount.
-
loadSpecification
protected void loadSpecification(AbstractTeamSource.SpecificationContext context)
Description copied from class:AbstractTeamSourceOverridden to load specification.- Specified by:
loadSpecificationin classAbstractTeamSource- Parameters:
context-AbstractTeamSource.SpecificationContext.
-
createTeam
public Team createTeam(TeamSourceContext context) throws java.lang.Exception
Description copied from interface:TeamSourceCreates theTeam.- Specified by:
createTeamin interfaceTeamSource- Parameters:
context-TeamSourceContext.- Returns:
Team.- Throws:
java.lang.Exception- If fails to configure theTeamSource.
-
startWorking
public void startWorking()
Description copied from interface:TeamIndicates for theTeamto start working.- Specified by:
startWorkingin interfaceTeam
-
-