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
TeamSource that 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
FieldsModifier and TypeFieldDescriptionstatic final RejectedExecutionExceptionRejectedExecutionExceptionthrown to indicate back pressure. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateTeam(TeamSourceContext context) Creates theTeam.static intObtains the number of back pressureEscalationinstances that have occurred.protected voidOverridden to load specification.static voidresetBackPressureEscalationCount(int count) Resets the back pressureEscalationcount.voidIndicates for theTeamto start working.voidIndicates for theTeamto stop working.Methods inherited from class net.officefloor.frame.api.team.source.impl.AbstractTeamSource
getSpecification
-
Field Details
-
BACK_PRESSURE_EXCEPTION
RejectedExecutionExceptionthrown to indicate back pressure.
-
-
Constructor Details
-
BackPressureTeamSource
public BackPressureTeamSource()
-
-
Method Details
-
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
Description copied from class:AbstractTeamSourceOverridden to load specification.- Specified by:
loadSpecificationin classAbstractTeamSource- Parameters:
context-AbstractTeamSource.SpecificationContext.
-
createTeam
Description copied from interface:TeamSourceCreates theTeam.- Specified by:
createTeamin interfaceTeamSource- Parameters:
context-TeamSourceContext.- Returns:
Team.- Throws:
Exception- If fails to configure theTeamSource.
-
startWorking
public void startWorking()Description copied from interface:TeamIndicates for theTeamto start working.- Specified by:
startWorkingin interfaceTeam
-
assignJob
Description copied from interface:Team -
stopWorking
public void stopWorking()Description copied from interface:TeamIndicates for the
Teamto stop working.This method should block and only return control when the
Teamhas stopped working and is no longer assignedJobinstances to complete.- Specified by:
stopWorkingin interfaceTeam
-