Class org.as2lib.app.exec.BatchProcess

org.as2lib.core.BasicClass
   +--org.as2lib.app.exec.BatchProcess

Implemented Interfaces

Batch ProcessListener

Description

BatchProcess is a implementation of Batch for a list of Processes.

A BatchProcess acts like a row execution of Process instances. All listed processes will be executed after each other.

As BatchProcess itself acts like a Process you can use it as a composite to execute a BatchProcess within another BatchProcess.

Method Index

new BatchProcess()

addAllBatchListeners(), addAllProcessListeners(), addBatchListener(), addProcess(), addProcessListener(), getAllAddedProcesses(), getAllBatchListeners(), getAllProcessListeners(), getCurrentProcess(), getParentProcess(), getPercentage(), hasFinished(), hasStarted(), isPaused(), isRunning(), onFinishProcess(), onPauseProcess(), onProcessError(), onResumeProcess(), onStartProcess(), onUpdateProcess(), removeAllBatchListeners(), removeAllProcessListeners(), removeBatchListener(), removeProcess(), removeProcessById(), removeProcessListener(), setParentProcess(), start()

Inherited from BasicClass

toString()

Constructor Detail

BatchProcess

public function BatchProcess(Void)

Creates a new BatchProcess

Method Detail

setParentProcess

public function setParentProcess(p:Process):Void

Setter for the parent process

Parameters

pProcess to be set as parent

Throws

IllegalArgumentExceptionif the passed process has the current instance as a parent process (recursion safe).

getParentProcess

public function getParentProcess(Void):Process

Getter for the applied parent process.

Return

Parent process or null if no parent process has been set.

getCurrentProcess

public function getCurrentProcess(Void):Process

Getter for the currently execution process.

Return

Currently processing Process.

Specified By

getCurrentProcess() in org.as2lib.app.exec.Batch

getAllAddedProcesses

public function getAllAddedProcesses(Void):Array

Getter for a list of all added processes with addProcess in form of a array.

Return

Array that contains all processes that has been added.

Specified By

getAllAddedProcesses() in org.as2lib.app.exec.Batch

onFinishProcess

public function onFinishProcess(info:Process):Void

To be executed if one child process has been finished.

Parameters

infoFinished Process.

Specified By

onFinishProcess() in org.as2lib.app.exec.ProcessListener

onStartProcess

public function onStartProcess(info:Process):Void

Void implementation of ProcessListener.onStartProcess

Parameters

infoto the process that has been started.

Specified By

onStartProcess() in org.as2lib.app.exec.ProcessListener

onPauseProcess

public function onPauseProcess(info:Process):Void

Implementation of ProcessListener.onPauseProcess that redirects to internal eventbroadcasting.

Parameters

infoto the process that has been paused.

Specified By

onPauseProcess() in org.as2lib.app.exec.ProcessListener

onResumeProcess

public function onResumeProcess(info:Process):Void

Implementation of ProcessListener.onResumeProcess that redirects to internal eventbroadcasting.

Parameters

infoto the process that has been resumed.

Specified By

onResumeProcess() in org.as2lib.app.exec.ProcessListener

onProcessError

public function onProcessError(info:Process, error):Void

Implementation of ProcessListener.onProcessError that redirects to internal eventbroadcasting.

Parameters

infoto the process that has thrown the error.

Specified By

onProcessError() in org.as2lib.app.exec.ProcessListener

onUpdateProcess

public function onUpdateProcess(info:Process):Void

Implementation of ProcessListener.onUpdateProcess that redirects to internal eventbroadcasting.

Parameters

infoto the process that got updated.

Specified By

onUpdateProcess() in org.as2lib.app.exec.ProcessListener

start

public function start()

Starts the execution of the Batch.

addProcess

public function addProcess(p:Process):Number

Adds a process to the list of processes.

Parameters

pProcess to be added.

Return

Internal Id of the process.

Specified By

addProcess() in org.as2lib.app.exec.Batch

removeProcess

public function removeProcess(p:Process):Void

Removes a process from the list of executed processes.

If a process has been added more than one times, it removes all executions.

Parameters

pProcess to be removed.

Specified By

removeProcess() in org.as2lib.app.exec.Batch

removeProcessById

public function removeProcessById(id:Number):Void

Removes a process by its internal id.

addProcess returns the internal id of a added process. This method helps to remove concrete reference to the process.

Parameters

idInternal Id of the process.

Specified By

removeProcessById() in org.as2lib.app.exec.Batch

addProcessListener

public function addProcessListener(listener:ProcessListener):Void

Adds a ProcessListener as Observer to the process.

Parameters

listenerProcessListener 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.

addAllProcessListeners

public function addAllProcessListeners(list:Array):Void

Adds a list of ProcessListeners as Observer to the process.

Parameters

listList of listeners to be added.

getAllProcessListeners

public function getAllProcessListeners(Void):Array

Getter for all added Observers.

Return

List that contains all registered listeners

addBatchListener

public function addBatchListener(listener:BatchListener):Void

Adds a BatchListener as Observer to the Batch.

Parameters

listenerBatchListener to be added.

Specified By

addBatchListener() in org.as2lib.app.exec.Batch

removeBatchListener

public function removeBatchListener(listener:BatchListener):Void

Removes a certain BatchListener as Observer from the Batch.

Parameters

listenerBatchListener to be removed.

Specified By

removeBatchListener() in org.as2lib.app.exec.Batch

removeAllBatchListeners

public function removeAllBatchListeners(Void):Void

Removes all added batchlisteners that were added with addBatchListener or addAllBatchListeners.

Specified By

removeAllBatchListeners() in org.as2lib.app.exec.Batch

addAllBatchListeners

public function addAllBatchListeners(list:Array):Void

Adds a BatchListener as Observer to the Batch.

Parameters

Specified By

addAllBatchListeners() in org.as2lib.app.exec.Batch

getAllBatchListeners

public function getAllBatchListeners(Void):Array

Getter for all added listeners in form of a Array.

Return

Added listeners in form of a array.

Specified By

getAllBatchListeners() in org.as2lib.app.exec.Batch

getPercentage

public function getPercentage(Void):Number

Getter for the current percentage of execution.

hasFinished

public function hasFinished(Void):Boolean

Returns false if the Batch finished execution.

Return

false if the Batch finished execution.

hasStarted

public function hasStarted(Void):Boolean

Returns true if the Batch has been started and is not finished yet.

Will return false if the batch has been finished

Return

true if the Batch has been started with start

isRunning

public function isRunning(Void):Boolean

Returns true if the Batch has been started and is currently running.

Return

true if the Batch is currently running.

isPaused

public function isPaused(Void):Boolean

Returns if the Batch is paused or not.

Return

true if the batch has been started and the current subprocess is not paused.