Interface org.as2lib.app.exec.Process

org.as2lib.core.BasicInterface
   +--org.as2lib.app.exec.Process

Description

Process is a definition for all lacy processes like for loading files having serverside responses or algorithms that take a little longer.

Any Process implementation can be started with start. Due to flash ist not possible to allow system processes it is build as Observable that responses if the process was started (ProcessListener.onStartProcess), finished (ProcessListener.onFinishProcess), paused (ProcessListener.onPauseProcess), resumed (ProcessListener.onResumeProcess) or if the properties changed (ProcessListener.onUpdateProcess).

To observe Process you can add one or more listener to the process with addProcessListener or addAllProcessListeners.

Method Index

addAllProcessListeners(), addProcessListener(), getAllProcessListeners(), getParentProcess(), getPercentage(), hasFinished(), hasStarted(), isPaused(), isRunning(), removeAllProcessListeners(), removeProcessListener(), setParentProcess(), start()

Inherited from BasicInterface

toString()

Method Detail

start

public function start()

Starts the execution of this process.

Return

result for the start (implementation specific).

addProcessListener

public function addProcessListener(listener:ProcessListener):Void

Adds a ProcessListener as Observer to the process.

Parameters

listenerProcessListener to be added.

addAllProcessListeners

public function addAllProcessListeners(list:Array):Void

Adds a list of ProcessListeners as Observer to the process.

Parameters

listList of listeners to be added.

removeProcessListener

public function removeProcessListener(listener:ProcessListener):Void

Removes a ProcessListener as Observer from the process.

Parameters

listenerProcessListener to be added.

removeAllProcessListeners

public function removeAllProcessListeners(Void):Void

Removes all added Observers.

getAllProcessListeners

public function getAllProcessListeners(Void):Array

Getter for all added Observers.

Return

List that contains all registered listeners

hasStarted

public function hasStarted(Void):Boolean

Flag if the process has been started.

Return

true if the process has been started and isn't finish yet else false.

hasFinished

public function hasFinished(Void):Boolean

Flag if the process has been finished.

Return

true if the process has been finished else false

isPaused

public function isPaused(Void):Boolean

Flag if the process has been paused.

Return

true if the process has been started and has been paused

isRunning

public function isRunning(Void):Boolean

Flag if the process has been paused.

Return

true if the process has been started and is not paused

getPercentage

public function getPercentage(Void):Number

Getter for the currently executed percentage of the process.

Return

Percentage of execution. Null if percentage was not evaluateable.

setParentProcess

public function setParentProcess(process:Process):Void

Possibility to tell the process what parent process started its execution.

Parameters

process Process that started the current process.

Throws

IllegalArgumentExceptionif the passed-in process has the current process within the parent process list or if the passed-in process is the same process as the current process.

getParentProcess

public function getParentProcess(Void):Process

Getter for the parent process that executed the process.

Return

Parent process if available, else null.