def __init__(self, module):
        '''
        Constructor
        '''
        
        ActionBundle.__init__(self, module)
  
        # Check if JBOSS is running
        if getProcessPIDByPath(module.targetDeploymentPath):die("The JBOSS server at '" + module.targetDeploymentPath + "' is up. Installation will not continue")    
        
        # Generate a unique ActionBundle execution id
        guid = generateGUID()    
        log.info("Unique ActionBundle execution ID generated: " + guid)    

        unzippedPackagePath = module.subModule.unzippedPackagePath

        # Import Clean DB script to Postgres DB
        dbUsername = readPropertyFromPropertiesFile("TARGET_POSTGRES_SRV_DB_OWNER", module.name, lib.OptParser.options.envprops)
        dbPassword = readPropertyFromPropertiesFile("TARGET_POSTGRES_SRV_DB_PASSWORD", module.name, lib.OptParser.options.envprops)
        dbHostName = readPropertyFromPropertiesFile("TARGET_POSTGRES_SRV_HOSTNAME", module.name, lib.OptParser.options.envprops)
        dbName = readPropertyFromPropertiesFile("TARGET_POSTGRES_SRV_DB_NAME", module.name, lib.OptParser.options.envprops)
        dbPort = readPropertyFromPropertiesFile("TARGET_POSTGRES_SRV_PORT", module.name, lib.OptParser.options.envprops)
        tmpC = "jdbc:postgresql://" + dbHostName + ":" + dbPort + "/" + dbName
        
        
        
        # Find version/revision info
        versionInfo = grepFile(module.versionInformationRegex, unzippedPackagePath + scriptGlobals.osDirSeparator + "MANIFEST.MF")
        revisionInfo = grepFile(module.revisionInformationRegex, unzippedPackagePath + scriptGlobals.osDirSeparator + "MANIFEST.MF")
        
        versionInfo = (versionInfo.replace(module.versionInformationRegex, "")).strip()
        revisionInfo = (revisionInfo.replace(module.revisionInformationRegex, "")).strip()

        # Determine last executed script in DB
        dbUsername = readPropertyFromPropertiesFile("TARGET_POSTGRES_SRV_DB_OWNER", module.name, lib.OptParser.options.envprops)
        dbPassword = readPropertyFromPropertiesFile("TARGET_POSTGRES_SRV_DB_PASSWORD", module.name, lib.OptParser.options.envprops)
        dbHostName = readPropertyFromPropertiesFile("TARGET_POSTGRES_SRV_HOSTNAME", module.name, lib.OptParser.options.envprops)
        dbName = readPropertyFromPropertiesFile("TARGET_POSTGRES_SRV_DB_NAME", module.name, lib.OptParser.options.envprops)
        dbPort = readPropertyFromPropertiesFile("TARGET_POSTGRES_SRV_PORT", module.name, lib.OptParser.options.envprops)
        tmpC = "jdbc:postgresql://" + dbHostName + ":" + dbPort + "/" + dbName
        result = runPostgresScript("SELECT EXECUTED_SCRIPT FROM FIREWORKS_SCRIPT_LOG WHERE EXECUTED_ON IN (SELECT MAX(EXECUTED_ON) FROM FIREWORKS_SCRIPT_LOG);", dbUsername, dbPassword, tmpC)
        lastExecutedPath, lastExecutedFilename = os.path.split(result.strip());
        log.info("According to log table, the last script executed on '" + tmpC + "' was '" + lastExecutedFilename + "'")
        
        # Run scripts on DB
        ls = os.listdir(unzippedPackagePath + scriptGlobals.osDirSeparator + module.relativeDatabaseUpgradeFilePath)
        ls.sort()
        found = False
        for patch in ls:
            if found: 
                #Replace Owner
                exactExtractedLocation = unzippedPackagePath + scriptGlobals.osDirSeparator + module.relativeDatabaseUpgradeFilePath + scriptGlobals.osDirSeparator + patch
                ConfigureTemplateFile(module.name, lib.OptParser.options.envprops, exactExtractedLocation)
                CheckFileConfigurationIsComplete(exactExtractedLocation)
                #Run Script
                RunPostgresScriptFromFile(unzippedPackagePath + scriptGlobals.osDirSeparator + module.relativeDatabaseUpgradeFilePath + scriptGlobals.osDirSeparator + patch, dbUsername, dbPassword, tmpC)
                # Log executed scripts                
                RunPostgresScript("INSERT INTO FIREWORKS_SCRIPT_LOG (INSTALLATION_ID, ACTION, MODULE_NAME, MODULE_VERSION, MODULE_REVISION, EXECUTED_SCRIPT, EXECUTED_ON) VALUES ('" + guid + "', '" + lib.OptParser.options.action + "', '" + module.name + "', '" + versionInfo + "', '" + revisionInfo + "', '" + patch + "', CURRENT_TIMESTAMP);", dbUsername, dbPassword, tmpC)                
            if  lastExecutedFilename.find(patch) > -1: found = True
 def __call__(self):
     runPostgresScript(self.script, self.username, self.password, self.connectionString)