All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cloud.sb.broker.6.18.6.source-code.beans.notgroovy Maven / Gradle / Ivy

There is a newer version: 6.21.6
Show newest version
package com.swisscom.cloud.sb.broker

import com.swisscom.cloud.sb.broker.provisioning.ServiceInstanceCleanup
import com.swisscom.cloud.sb.broker.backup.BackupCleanup


beans {
    flyway(org.flywaydb.core.Flyway) { bean ->
        table = 'FLYWAY_schema_version'
        dataSource = ref('dataSource')
        validateOnMigrate = true
        bean.initMethod = 'migrate'
    }

    cleanUpZombieServiceInstanceBean(ServiceInstanceCleanup) {}

    jobServiceInstanceCleanup(org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean) {
        targetObject = ref('cleanUpZombieServiceInstanceBean')
        targetMethod = 'cleanOrphanedServiceInstances'
    }

    triggerServiceInstanceCleanup(org.springframework.scheduling.quartz.CronTriggerFactoryBean) {
        jobDetail = ref('jobServiceInstanceCleanup')
        cronExpression = "0 0 0 * * ?" //once per day
    }

    backupCleanupBean(BackupCleanup) {}

    jobBackupCleanup(org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean) {
        targetObject = ref('backupCleanupBean')
        targetMethod = 'run'
    }

    triggerBackupCleanup(org.springframework.scheduling.quartz.CronTriggerFactoryBean) {
        jobDetail = ref('jobBackupCleanup')
        cronExpression = "0 0 0 * * ?" //once per day
    }

    quartzSchedulerWithPersistence(org.springframework.scheduling.quartz.SchedulerFactoryBean) { bean ->
        autoStartup = false
        dataSource = ref('dataSource')
        transactionManager = ref('transactionManager')
        configLocation = 'classpath:quartzWithDbPersistence.properties'
        schedulerName = 'quartzSchedulerWithPersistence'
        jobFactory = ref('autowiringSpringBeanJobFactory')
        startupDelay = 30
        waitForJobsToCompleteOnShutdown = true
        bean.dependsOn = 'flyway'
    }

    quartzScheduler(org.springframework.scheduling.quartz.SchedulerFactoryBean) { bean ->
        autoStartup = true
        configLocation = 'classpath:quartz.properties'
        schedulerName = 'quartzScheduler'
        jobFactory = ref('autowiringSpringBeanJobFactory')
        startupDelay = 30
        waitForJobsToCompleteOnShutdown = false
        bean.dependsOn = 'flyway'
        triggers = [ref('triggerServiceInstanceCleanup')]
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy