Package net.officefloor.web.executive
Class WebThreadAffinityExecutive
- java.lang.Object
-
- net.officefloor.web.executive.WebThreadAffinityExecutive
-
- All Implemented Interfaces:
ExecutionStrategy,Executive,TeamOversight
public class WebThreadAffinityExecutive extends java.lang.Object implements Executive, ExecutionStrategy, TeamOversight
WebThreadaffinityExecutive.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description WebThreadAffinityExecutive(CpuCore[] cpuCores, ExecutiveSourceContext context)Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectcreateProcessIdentifier()Creates a newProcessStateidentifier.TeamcreateTeam(ExecutiveContext context)Creates theTeam.ExecutionStrategy[]getExcutionStrategies()Obtains theExecutionStrategystrategies.java.lang.StringgetExecutionStrategyName()Obtains the name of theExecutionStrategy.java.lang.StringgetTeamOversightName()Obtains the name of theTeamOversight.TeamOversight[]getTeamOversights()Obtains theTeamOversightinstances.java.util.concurrent.ThreadFactory[]getThreadFactories()<T extends java.lang.Throwable>
ProcessManagermanageExecution(Execution<T> execution)Manages theExecution.
-
-
-
Constructor Detail
-
WebThreadAffinityExecutive
public WebThreadAffinityExecutive(CpuCore[] cpuCores, ExecutiveSourceContext context)
Instantiate.- Parameters:
cpuCores-CpuCoreinstances.context-ExecutiveSourceContext.
-
-
Method Detail
-
createProcessIdentifier
public java.lang.Object createProcessIdentifier()
Description copied from interface:ExecutiveCreates a newProcessStateidentifier.- Specified by:
createProcessIdentifierin interfaceExecutive- Returns:
- New
ProcessStateidentifier.
-
manageExecution
public <T extends java.lang.Throwable> ProcessManager manageExecution(Execution<T> execution) throws T extends java.lang.Throwable
Description copied from interface:ExecutiveManages the
Execution.The
Thread.currentThread()will provide the inboundThread.- Specified by:
manageExecutionin interfaceExecutive- Type Parameters:
T- Type ofThrowablethrown.- Parameters:
execution-Executionto be undertaken.- Returns:
ProcessManagerfor theProcessState.- Throws:
T- Propagation of failure fromExecution.T extends java.lang.Throwable
-
getExcutionStrategies
public ExecutionStrategy[] getExcutionStrategies()
Description copied from interface:ExecutiveObtains theExecutionStrategystrategies.- Specified by:
getExcutionStrategiesin interfaceExecutive- Returns:
ExecutionStrategyinstances.
-
getTeamOversights
public TeamOversight[] getTeamOversights()
Description copied from interface:ExecutiveObtains theTeamOversightinstances.- Specified by:
getTeamOversightsin interfaceExecutive- Returns:
TeamOversightinstances.
-
getExecutionStrategyName
public java.lang.String getExecutionStrategyName()
Description copied from interface:ExecutionStrategyObtains the name of theExecutionStrategy.- Specified by:
getExecutionStrategyNamein interfaceExecutionStrategy- Returns:
- Name of the
ExecutionStrategy.
-
getThreadFactories
public java.util.concurrent.ThreadFactory[] getThreadFactories()
Description copied from interface:ExecutionStrategy- Specified by:
getThreadFactoriesin interfaceExecutionStrategy- Returns:
ThreadFactoryinstances.
-
getTeamOversightName
public java.lang.String getTeamOversightName()
Description copied from interface:TeamOversightObtains the name of theTeamOversight.- Specified by:
getTeamOversightNamein interfaceTeamOversight- Returns:
- Name of the
TeamOversight.
-
createTeam
public Team createTeam(ExecutiveContext context) throws java.lang.Exception
Description copied from interface:TeamOversightCreates the
Team.This is expected to delegate to the
TeamSourceto create theTeam. However, theExecutivemay decide to wrap theTeamor provide multipleTeaminstances with assigning algorithm (such as taking advantage ofThreadaffinity). The choice is, however, ultimately left to theExecutiveto manage theTeaminstances.- Specified by:
createTeamin interfaceTeamOversight- Parameters:
context-ExecutiveContext.- Returns:
Team.- Throws:
java.lang.Exception- If fails to configure theTeamSource.
-
-