Class DefaultExecutive
java.lang.Object
net.officefloor.frame.api.executive.source.impl.AbstractExecutiveSource
net.officefloor.frame.impl.execute.executive.DefaultExecutive
- All Implemented Interfaces:
BackgroundScheduler,ExecutionStrategy,Executive,ExecutiveSource
public class DefaultExecutive
extends AbstractExecutiveSource
implements Executive, ExecutionStrategy, BackgroundScheduler
Default
Executive.- Author:
- Daniel Sagenschneider
-
Nested Class Summary
Nested classes/interfaces inherited from class net.officefloor.frame.api.executive.source.impl.AbstractExecutiveSource
AbstractExecutiveSource.SpecificationContext -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault construct to be used asExecutiveSource.DefaultExecutive(ThreadFactoryManufacturer threadFactoryManufacturer) Instantiate to use asExecutive. -
Method Summary
Modifier and TypeMethodDescriptioncreateExecutive(ExecutiveSourceContext context) Creates theExecutive.createExecutor(ProcessIdentifier processIdentifier) Obtains theExecutionStrategystrategies.Obtains theExecutionStrategyinstances by name.Obtains the name of theExecutionStrategy.protected voidOverridden to load specification.voidSchedules theRunnableto be executed after the delay.voidschedule(ProcessIdentifier processIdentifier, long delay, Runnable runnable) Schedules theRunnableto execute so many milliseconds in the future.voidstartManaging(ExecutiveStartContext context) Starts managing theOfficeFloor.voidStops managing theOfficeFloor.Methods inherited from class net.officefloor.frame.api.executive.source.impl.AbstractExecutiveSource
getSpecificationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.officefloor.frame.api.executive.Executive
createProcessIdentifier, createThread, getOfficeManager, getTeamOversight, manageExecution, processComplete
-
Field Details
-
EXECUTION_STRATEGY_NAME
DefaultExecutionStrategyname.- See Also:
-
-
Constructor Details
-
DefaultExecutive
public DefaultExecutive()Default construct to be used asExecutiveSource. -
DefaultExecutive
Instantiate to use asExecutive.- Parameters:
threadFactoryManufacturer-ThreadFactoryManufacturer.
-
-
Method Details
-
getExecutionStrategyMap
Obtains theExecutionStrategyinstances by name.- Returns:
ExecutionStrategyinstances by name.
-
loadSpecification
Description copied from class:AbstractExecutiveSourceOverridden to load specification.- Specified by:
loadSpecificationin classAbstractExecutiveSource- Parameters:
context-AbstractExecutiveSource.SpecificationContext.
-
createExecutive
Description copied from interface:ExecutiveSourceCreates theExecutive.- Specified by:
createExecutivein interfaceExecutiveSource- Parameters:
context-ExecutiveSourceContext.- Returns:
Executive.- Throws:
Exception- If fails to configure theExecutiveSource.
-
getExcutionStrategies
Description copied from interface:ExecutiveObtains theExecutionStrategystrategies.- Specified by:
getExcutionStrategiesin interfaceExecutive- Returns:
ExecutionStrategyinstances.
-
startManaging
Description copied from interface:ExecutiveStarts managing theOfficeFloor.- Specified by:
startManagingin interfaceExecutive- Parameters:
context-ExecutiveStartContext.- Throws:
Exception- If fails to start managing.
-
createExecutor
Description copied from interface:ExecutiveCreates an
ExecutorthatMUSTexecute theRunnablein a differentThreadto the caller.This is used in various places within
OfficeFloor:- By
ManagedFunctionin executingRunnablein anotherThread - To avoid stack over flow issues, the stack call chain is broken by
invoking further
FunctionStatedelegation in anotherThread. This allows further depth to a thread stack than offered by a singleThread.
- Specified by:
createExecutorin interfaceExecutive- Parameters:
processIdentifier-ProcessIdentifierofProcessStaterequiring theExecutor.- Returns:
Executorthat will executeRunnableinstances in a differentThreadto caller.
- By
-
schedule
Description copied from interface:ExecutiveSchedules the
Runnableto execute so many milliseconds in the future.Note that the
Executivemay determine theProcessStatecomplete and not execute theRunnable.- Specified by:
schedulein interfaceExecutive- Parameters:
processIdentifier-ProcessIdentifierof theProcessStaterequiring the scheduled execution.delay- Delay in milliseconds to execute theRunnable.runnable-Runnableto execute.
-
stopManaging
Description copied from interface:ExecutiveStops managing theOfficeFloor.- Specified by:
stopManagingin interfaceExecutive- Throws:
Exception- If fails to stop managing.
-
schedule
Description copied from interface:BackgroundSchedulerSchedules theRunnableto be executed after the delay.- Specified by:
schedulein interfaceBackgroundScheduler- Parameters:
delay- Delay in milliseconds.runnable-Runnable.
-
getExecutionStrategyName
Description copied from interface:ExecutionStrategyObtains the name of theExecutionStrategy.- Specified by:
getExecutionStrategyNamein interfaceExecutionStrategy- Returns:
- Name of the
ExecutionStrategy.
-
getThreadFactories
Description copied from interface:ExecutionStrategy- Specified by:
getThreadFactoriesin interfaceExecutionStrategy- Returns:
ThreadFactoryinstances.
-