Class org.as2lib.app.exec.BatchProcess

Implemented Interfaces

Batch ProcessUpdateListener ProcessPauseListener ProcessResumeListener ProcessStartListener ProcessFinishListener ProcessErrorListener

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.

It supports beneath all listeners of Process seperate events for Batch processing: BatchStartListener, BatchFinishListener, BatchUpdateListener and BatchErrorListener

Field Index

Inherited from LogSupport

Method Index

new BatchProcess()
addProcess(), getAllAddedProcesses(), getCurrentProcess(), getParentProcess(), getPercentage(), onProcessError(), onProcessFinish(), onProcessPause(), onProcessResume(), onProcessStart(), onProcessUpdate(), removeProcess(), removeProcessById(), setParentProcess(), start()

Inherited from AbstractProcess

Inherited from AbstractTimeConsumer

Inherited from EventSupport

Inherited from LogSupport

Inherited from BasicClass

Constructor Detail

BatchProcess

public function BatchProcess(Void)

Constructs 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).

Specified By

setParentProcess() in org.as2lib.app.exec.Process

Overrides

setParentProcess() in org.as2lib.app.exec.AbstractProcess

getParentProcess

public function getParentProcess(Void):Process

Getter for the applied parent process.

Return

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

Specified By

getParentProcess() in org.as2lib.app.exec.Process

Overrides

getParentProcess() in org.as2lib.app.exec.AbstractProcess

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.

onProcessFinish

public function onProcessFinish(info:Process):Void

To be executed if one child process has been finished.

Parameters

infoFinished Process.

Specified By

onProcessFinish() in org.as2lib.app.exec.ProcessFinishListener

Overrides

onProcessFinish() in org.as2lib.app.exec.AbstractProcess

onProcessStart

public function onProcessStart(info:Process):Void

Void implementation of ProcessStartListener.onProcessStart

Parameters

infoto the process that has been started.

Specified By

onProcessStart() in org.as2lib.app.exec.ProcessStartListener

onProcessPause

public function onProcessPause(info:Process):Void

Implementation of ProcessPauseListener.onProcessPause that redirects to internal eventbroadcasting.

Parameters

infoto the process that has been paused.

Specified By

onProcessPause() in org.as2lib.app.exec.ProcessPauseListener

onProcessResume

public function onProcessResume(info:Process):Void

Implementation of ProcessResumeListener.onProcessResume that redirects to internal eventbroadcasting.

Parameters

infoto the process that has been resumed.

Specified By

onProcessResume() in org.as2lib.app.exec.ProcessResumeListener

onProcessError

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

Implementation of ProcessErrorListener.onProcessError that redirects to internal eventbroadcasting.

Parameters

infoto the process that has thrown the error.

Specified By

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

Overrides

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

onProcessUpdate

public function onProcessUpdate(info:Process):Void

Implementation of ProcessUpdateListener.onProcessUpdate that redirects to internal eventbroadcasting.

Parameters

infoto the process that got updated.

Specified By

onProcessUpdate() in org.as2lib.app.exec.ProcessUpdateListener

start

public function start()

Starts the execution of the Batch.

Specified By

start() in org.as2lib.app.exec.Process

Overrides

start() in org.as2lib.app.exec.AbstractProcess

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

See Also

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

See Also

getPercentage

public function getPercentage(Void):Number

Getter for the current percentage of execution.

Specified By

getPercentage() in org.as2lib.app.exec.Process

Overrides

getPercentage() in org.as2lib.app.exec.AbstractTimeConsumer