Package org.openbravo.base
Class ExecutionLimitBaseProcess
- java.lang.Object
-
- org.openbravo.base.ExecutionLimitBaseProcess
-
- Direct Known Subclasses:
BuildValidation
,ModuleScript
public abstract class ExecutionLimitBaseProcess extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.log4j.Logger
log4j
-
Constructor Summary
Constructors Constructor Description ExecutionLimitBaseProcess()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
doExecute()
Override this method to implement the actions to be executed by the process.protected boolean
executeOnInstall()
This method can be overridden by the subclasses of this class, to specify if they should be executed when installing the dependent module.protected ConnectionProvider
getConnectionProvider()
This method returns a connection provider, which can be used to execute statements in the databaseprotected abstract ExecutionLimits
getExecutionLimits()
This method can be overridden by the subclasses of this class, to specify the module and the limit versions to define whether they should be executed or not.protected File
getPropertiesFile()
protected String
getSourcePath()
Get the source path using the user.dir System Property.protected abstract String
getTypeName()
This method is overridden to retrieve the name of the process type which is extending this class.void
preExecute(Map<String,OpenbravoVersion> modulesVersionMap)
This method checks whether the doExecute() method should be executed or not according to the execution limits and the executeOnInstall() method when it applies.
-
-
-
Method Detail
-
doExecute
protected abstract void doExecute()
Override this method to implement the actions to be executed by the process.
-
preExecute
public void preExecute(Map<String,OpenbravoVersion> modulesVersionMap)
This method checks whether the doExecute() method should be executed or not according to the execution limits and the executeOnInstall() method when it applies. If eventually the doExecute() method should be executed, it is invoked in this very same method.- Parameters:
modulesVersionMap
- A data structure that contains module versions mapped by module id
-
getTypeName
protected abstract String getTypeName()
This method is overridden to retrieve the name of the process type which is extending this class.- Returns:
- Name of the process type.
-
getExecutionLimits
protected abstract ExecutionLimits getExecutionLimits()
This method can be overridden by the subclasses of this class, to specify the module and the limit versions to define whether they should be executed or not.- Returns:
- a ExecutionLimits object which contains the dependent module id and the first and last versions of the module that define the execution logic.
-
executeOnInstall
protected boolean executeOnInstall()
This method can be overridden by the subclasses of this class, to specify if they should be executed when installing the dependent module.- Returns:
- a boolean that indicates if they should be executed when installing the dependent module.
-
getConnectionProvider
protected ConnectionProvider getConnectionProvider()
This method returns a connection provider, which can be used to execute statements in the database- Returns:
- a ConnectionProvider
-
getPropertiesFile
protected File getPropertiesFile()
-
getSourcePath
protected String getSourcePath() throws NoSuchFileException
Get the source path using the user.dir System Property. Navigates two folders backwards and checks the config directory is available to ensure the directory is an Openbravo instance, throwing an exception otherwise- Returns:
- String the source path
- Throws:
NoSuchFileException
- when the source path directory is not valid
-
-