org.mindswap.owls.process.execution
Class DefaultProcessMonitor

java.lang.Object
  extended by org.mindswap.owls.process.execution.DefaultProcessMonitor
All Implemented Interfaces:
ProcessMonitor
Direct Known Subclasses:
ExecutionMonitor.CustomProcessMonitor

public class DefaultProcessMonitor
extends java.lang.Object
implements ProcessMonitor

A simple process monitor implementation that prints the progress to console

Author:
Evren Sirin

Constructor Summary
DefaultProcessMonitor()
           
DefaultProcessMonitor(java.io.Writer writer)
           
 
Method Summary
 void executionFailed(ExecutionException e)
          Called when the execution fails due to an execption.
 void executionFinished()
          Called only once when the execution of the top-most process finishes.
 void executionFinished(Process process, ValueMap inputs, ValueMap outputs)
          Called after the execution of a process finishes.
 void executionStarted()
          Called only once when the execution of the top-most process starts
 void executionStarted(Process process, ValueMap inputs)
          Called before the execution of a process starts.
 int getMonitorFilter()
           
 void setMonitorFilter(int processType)
          Control if executionStarted and executionFinished will be called for all the processes or only for a specific type of processes.
 void setWriter(java.io.Writer writer)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultProcessMonitor

public DefaultProcessMonitor()

DefaultProcessMonitor

public DefaultProcessMonitor(java.io.Writer writer)
Method Detail

setWriter

public void setWriter(java.io.Writer writer)

executionStarted

public void executionStarted()
Description copied from interface: ProcessMonitor
Called only once when the execution of the top-most process starts

Specified by:
executionStarted in interface ProcessMonitor

executionFinished

public void executionFinished()
Description copied from interface: ProcessMonitor
Called only once when the execution of the top-most process finishes. Note that if execution fails for any reason this function will not be called. Instead executionFailed() will be called.

Specified by:
executionFinished in interface ProcessMonitor

executionStarted

public void executionStarted(Process process,
                             ValueMap inputs)
Description copied from interface: ProcessMonitor
Called before the execution of a process starts. The user has the option to modify the contents of the inputs. setMonitorFilter function can be used to control if this function will be called for all the processes or only for a specific type of processes (e.g. only atomic processes).

Specified by:
executionStarted in interface ProcessMonitor

executionFinished

public void executionFinished(Process process,
                              ValueMap inputs,
                              ValueMap outputs)
Description copied from interface: ProcessMonitor
Called after the execution of a process finishes. The user has the option to modify the contents of outputs. setMonitorFilter function can be used to control if this function will be called for all the processes or only for a specific type of processes (e.g. only atomic processes).

Specified by:
executionFinished in interface ProcessMonitor

executionFailed

public void executionFailed(ExecutionException e)
Description copied from interface: ProcessMonitor
Called when the execution fails due to an execption. This function is intended to be hook where the user can do something to fix the problem, i.e. ask for additional inputs. There is no such support at the moment. The execution engine will throw the exception right after this function returns.

Specified by:
executionFailed in interface ProcessMonitor

setMonitorFilter

public void setMonitorFilter(int processType)
Description copied from interface: ProcessMonitor
Control if executionStarted and executionFinished will be called for all the processes or only for a specific type of processes. The constant values are defined in Process interface:

Bitwise combinations (bitwise or) of these values are also valid.

Specified by:
setMonitorFilter in interface ProcessMonitor

getMonitorFilter

public int getMonitorFilter()
Specified by:
getMonitorFilter in interface ProcessMonitor


Copyright © 2004 Evren Sirin. All Rights Reserved.