Interface org.as2lib.app.exec.Batch

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

Description

Batch is the definition for a list of processes that will be executed after each other.

Batch allows with addProcess to define a list of processes that will be started after each other. The execution will follow in the order of the arrival.

Batch is a composite (it implements Process), so you can even add one Batch with addProcess to another Batch.

Additionally to addProcessListener method of Process you can add a BatchListener with addBatchListener that allows to get a more detailed information about the batch execution. Example: import org.as2lib.app.exec.Batch; import org.as2lib.app.exec.BatchProcess; var b:Batch = new BatchProcess(); b.addBatchListener(new MyStartUpController()); b.addProcess(new MyStartUpProcess()); b.addProcess(new MyXMLParsingProcess()); b.start();

Method Index

addAllBatchListeners(), addBatchListener(), addProcess(), getAllAddedProcesses(), getAllBatchListeners(), getCurrentProcess(), removeAllBatchListeners(), removeBatchListener(), removeProcess(), removeProcessById()

Inherited from Process

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

Inherited from BasicInterface

toString()

Method Detail

addProcess

public function addProcess(process:Process):Number

Adds a Process to the list of processes to execute. Its possible to at the same process more than one times.

Parameters

processProcess to be added.

Return

Internal identifier of the process.

removeProcess

public function removeProcess(process:Process):Void

Removes all instances of a process that were added to the batch.

Parameters

processProcess to be removed.

removeProcessById

public function removeProcessById(id:Number):Void

Removes a process with a certain id from the batch.

Parameters

idIdentifier for the certain process.

getCurrentProcess

public function getCurrentProcess(Void):Process

Getter for the currently execution Process.

Return

Currently executing process.

getAllAddedProcesses

public function getAllAddedProcesses(Void):Array

Getter for all added processes.

Return

List of all added processes.

addBatchListener

public function addBatchListener(listener:BatchListener):Void

Adds a BatchListener as Observer to the Batch.

Parameters

listenerBatchListener to be added.

addAllBatchListeners

public function addAllBatchListeners(list:Array):Void

Adds a BatchListener as Observer to the Batch.

Parameters

removeBatchListener

public function removeBatchListener(listener:BatchListener):Void

Removes a certain BatchListener as Observer from the Batch.

Parameters

listenerBatchListener to be removed.

removeAllBatchListeners

public function removeAllBatchListeners(Void):Void

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

getAllBatchListeners

public function getAllBatchListeners(Void):Array

Getter for all added listeners in form of a Array.

Return

Added listeners in form of a array.