Class DatabaseMySQLModule
java.lang.Object
com.google.inject.AbstractModule
io.github.devlibx.easy.lock.module.LockModule
io.github.devlibx.easy.database.mysql.module.DatabaseMySQLModule
- All Implemented Interfaces:
com.google.inject.Module
This module provides all the dependencies to support MySQL related functions.
Yoy can customize the following:TransactionInterceptor- this class handles how methods annotated with @Transactionalhandle transactionsITransactionManagerResolver- this class resolves the transaction manager to be used by methods annotated byTransactionalNOTE - by default transaction aware data source is enabled. You must mark it false if you don't want to use it: If you want to disable it then you must set "enable-transaction-aware-datasource=false" using following codeOptionalBinder.newOptionalBinder(binder(), Key.get(Boolean.class, Names.named("enable-transaction-aware-datasource"))) .setBinding() .toInstance(Boolean.FALSE);Also use DatabaseMySQLModule(false) to disable transaction manager.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDatabaseMySQLModule(boolean enableTransactionInterceptor, int defaultTimeout) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected Stringorg.jdbi.v3.core.Jdbijdbi(DataSource dataSource) protected TransactionInterceptorprotected ITransactionManagerResolverMethods inherited from class io.github.devlibx.easy.lock.module.LockModule
distributedLockInterceptorMethods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
Constructor Details
-
DatabaseMySQLModule
public DatabaseMySQLModule() -
DatabaseMySQLModule
public DatabaseMySQLModule(boolean enableTransactionInterceptor, int defaultTimeout)
-
-
Method Details
-
configure
protected void configure()- Overrides:
configurein classLockModule
-
healthCheckRegistrationName
-
transactionManagerResolver
- Returns:
- DefaultTransactionManagerResolver - application can override this method to provide custom resolver.
-
transactionInterceptor
- Returns:
- TransactionInterceptor which will handle method annotated with @
Transactional
-
jdbi
-