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

io.mongock.driver.mongodb.springdata.v4.config.SpringDataMongoV4Context Maven / Gradle / Ivy

There is a newer version: 5.5.0
Show newest version
package io.mongock.driver.mongodb.springdata.v4.config;

import io.mongock.api.config.*;
import io.mongock.driver.mongodb.springdata.v4.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.boot.autoconfigure.condition.*;
import org.springframework.boot.context.properties.*;
import org.springframework.data.mongodb.core.*;
import org.springframework.transaction.*;

import java.util.*;

@AutoConfiguration
@ConditionalOnExpression("${mongock.enabled:true}")
@ConditionalOnBean(MongockConfiguration.class)
@EnableConfigurationProperties(MongoDBConfiguration.class)
public class SpringDataMongoV4Context extends SpringDataMongoV4ContextBase {

  @Override
  protected SpringDataMongoV4Driver buildDriver(MongoTemplate mongoTemplate,
                                                MongockConfiguration config,
                                                MongoDBConfiguration mongoDbConfig,
                                                Optional txManagerOpt) {
    return SpringDataMongoV4Driver.withLockStrategy(
        mongoTemplate,
        config.getLockAcquiredForMillis(),
        config.getLockQuitTryingAfterMillis(),
        config.getLockTryFrequencyMillis());
  }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy