Class org.as2lib.app.exec.Processor

Implemented Interfaces

FrameImpulseListener

Description

Processor executes any StepByStepProcess for step based code execution.

MM Flash Player has got a time limit for the execution of code. Processor allows to seperate code into steps.

It executes every step of a added StepByStepProcess. If the StepByStepProcess reaches the (@link #MAX_EXECUTION_TIME} limit during the exeuction, the Processor pauses for one frame as workaround for this time limitation.

Within the pause, anything may happen. It may require a complex implemnetation strategy within the StepByStepProcess.

Processor observes FrameImpulse if any StepByStepProcess has to be executed. It automatically removes itself as observer if all processes have finished.

Processor is built as singleton. It is possible to access it by Processor.getInstance().

Field Index

MAX_EXECUTION_TIME

Inherited from LogSupport

Method Index

addStepByStepProcess(), getInstance(), onFrameImpulse(), removeStepByStepProcess()

Inherited from EventSupport

Inherited from LogSupport

Inherited from BasicClass

Field Detail

MAX_EXECUTION_TIME

static public MAX_EXECUTION_TIME:Number
Time until pause of the execution.

Method Detail

getInstance

static public function getInstance(Void):Processor

Singleton - returns the default instance of the Processor

Return

instance of the Processor

addStepByStepProcess

public function addStepByStepProcess(p:StepByStepProcess):Void

Adds a new StepByStepProcess to the execution list.

It is possible that a StepByStepProcess can be added twice.

The Processor will automatically awake from stand-by.

Parameters

p StepByStepProcess to be added

removeStepByStepProcess

public function removeStepByStepProcess(p:StepByStepProcess):Void

Removes all occurances of StepByStepProcess.

Parameters

p StepByStepProcess to be removed

onFrameImpulse

public function onFrameImpulse(impulse:FrameImpulse):Void

Handling of the event of FrameImpulse.

Parameters

impulse FrameImpulse that executes the impulse

Specified By

onFrameImpulse() in org.as2lib.env.event.impulse.FrameImpulseListener