├── public ├── spring-boot2 │ ├── transactions-spring-boot │ │ ├── .gitignore │ │ └── src │ │ │ ├── main │ │ │ ├── resources │ │ │ │ └── META-INF │ │ │ │ │ └── spring.factories │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── atomikos │ │ │ │ └── spring │ │ │ │ ├── AtomikosXADataSourceWrapper.java │ │ │ │ ├── AtomikosXAConnectionFactoryWrapper.java │ │ │ │ ├── AtomikosDataSourceBeanMetadata.java │ │ │ │ ├── AtomikosNonXADataSourceBeanMetadata.java │ │ │ │ ├── AtomikosDataSourceBean.java │ │ │ │ └── AtomikosConnectionFactoryBean.java │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── atomikos │ │ │ └── spring │ │ │ ├── AtomikosXADataSourceWrapperTestJUnit.java │ │ │ ├── AtomikosXAConnectionFactoryWrapperTestJUnit.java │ │ │ ├── AtomikosDataSourceBeanTestJUnit.java │ │ │ ├── AtomikosConnectionFactoryBeanTestJUnit.java │ │ │ └── AtomikosAutoConfigurationJUnit.java │ ├── transactions-spring-boot-integration-tests │ │ ├── .gitignore │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── application.properties │ │ │ └── java │ │ │ └── com │ │ │ └── atomikos │ │ │ └── spring │ │ │ └── integrationtest │ │ │ ├── AccountRepository.java │ │ │ ├── Messages.java │ │ │ ├── Account.java │ │ │ ├── AccountService.java │ │ │ └── SampleAtomikosApplication.java │ ├── pom.xml │ └── transactions-spring-boot-starter │ │ └── pom.xml ├── spring-boot3 │ ├── transactions-spring-boot3 │ │ ├── .gitignore │ │ └── src │ │ │ ├── main │ │ │ ├── resources │ │ │ │ └── META-INF │ │ │ │ │ └── spring │ │ │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── atomikos │ │ │ │ └── spring │ │ │ │ ├── AtomikosXADataSourceWrapper.java │ │ │ │ ├── AtomikosXAConnectionFactoryWrapper.java │ │ │ │ ├── AtomikosDataSourceBeanMetadata.java │ │ │ │ ├── AtomikosNonXADataSourceBeanMetadata.java │ │ │ │ ├── AtomikosDataSourceBean.java │ │ │ │ └── AtomikosConnectionFactoryBean.java │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── atomikos │ │ │ └── spring │ │ │ ├── AtomikosXADataSourceWrapperTestJUnit.java │ │ │ ├── AtomikosXAConnectionFactoryWrapperTestJUnit.java │ │ │ ├── AtomikosDataSourceBeanTestJUnit.java │ │ │ ├── AtomikosConnectionFactoryBeanTestJUnit.java │ │ │ └── AtomikosAutoConfigurationJUnit.java │ └── transactions-spring-boot3-integration-tests │ │ ├── .gitignore │ │ ├── run.sh │ │ └── src │ │ └── main │ │ ├── resources │ │ └── application.properties │ │ └── java │ │ └── com │ │ └── atomikos │ │ └── spring │ │ └── integrationtest │ │ ├── AccountRepository.java │ │ ├── Messages.java │ │ ├── Account.java │ │ ├── AccountService.java │ │ └── SampleAtomikosApplication.java ├── transactions │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── META-INF │ │ │ │ │ └── services │ │ │ │ │ │ └── com.atomikos.icatch.provider.Assembler │ │ │ │ └── transactions-defaults.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── atomikos │ │ │ │ ├── finitestates │ │ │ │ ├── Stateful.java │ │ │ │ ├── FSMTransitionEventSource.java │ │ │ │ ├── StateMutable.java │ │ │ │ ├── FSMEnterEventSource.java │ │ │ │ ├── FSMEnterEvent.java │ │ │ │ ├── FSMTransitionEvent.java │ │ │ │ ├── FSMEnterListener.java │ │ │ │ ├── Transition.java │ │ │ │ ├── FSMTransitionListener.java │ │ │ │ └── FSM.java │ │ │ │ ├── icatch │ │ │ │ └── imp │ │ │ │ │ ├── ForgetResult.java │ │ │ │ │ ├── TxActiveStateHandler.java │ │ │ │ │ ├── RollbackCallback.java │ │ │ │ │ ├── CommitCallback.java │ │ │ │ │ ├── SubTransactionRecoveryCoordinator.java │ │ │ │ │ └── ForgetMessage.java │ │ │ │ ├── persistence │ │ │ │ ├── StateRecoveryManager.java │ │ │ │ └── RecoverableCoordinator.java │ │ │ │ └── recovery │ │ │ │ └── fs │ │ │ │ └── Repository.java │ │ └── test │ │ │ ├── resources │ │ │ ├── custom.properties │ │ │ ├── transactions.properties │ │ │ ├── jta.properties │ │ │ └── transactions-defaults.properties │ │ │ └── java │ │ │ └── com │ │ │ └── atomikos │ │ │ ├── icatch │ │ │ └── imp │ │ │ │ ├── ConditionalWaiterTestJUnit.java │ │ │ │ └── SysExceptionTestJUnit.java │ │ │ ├── finitestates │ │ │ └── TestListener.java │ │ │ └── persistence │ │ │ └── imp │ │ │ └── LogFileLockTestJUnit.java │ └── pom.xml ├── transactions-jta │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── META-INF │ │ │ │ │ └── services │ │ │ │ │ └── com.atomikos.icatch.TransactionServicePlugin │ │ │ ├── reference │ │ │ │ ├── jdbc20.stdext.pdf │ │ │ │ ├── jta-spec1_0_1.pdf │ │ │ │ ├── jts1_0-spec.pdf │ │ │ │ ├── jms-1_0_2b-spec.pdf │ │ │ │ ├── jdbc-3.0-spec.df.pdf │ │ │ │ ├── SunJca1.0License.rtfd │ │ │ │ │ ├── a.gif │ │ │ │ │ ├── TXT.rtf │ │ │ │ │ ├── dot.gif │ │ │ │ │ ├── 1__#$!@%!#__a.gif │ │ │ │ │ ├── 2__#$!@%!#__a.gif │ │ │ │ │ ├── 3__#$!@%!#__a.gif │ │ │ │ │ ├── 4__#$!@%!#__a.gif │ │ │ │ │ ├── 5__#$!@%!#__a.gif │ │ │ │ │ ├── s976981862111.gif │ │ │ │ │ ├── v3_pixel-trans.gif │ │ │ │ │ ├── 1__#$!@%!#__v3_pixel-trans.gif │ │ │ │ │ ├── 2__#$!@%!#__v3_pixel-trans.gif │ │ │ │ │ ├── 3__#$!@%!#__v3_pixel-trans.gif │ │ │ │ │ └── 4__#$!@%!#__v3_pixel-trans.gif │ │ │ │ ├── j2ee_connector-1_0-fr-spec.pdf │ │ │ │ ├── j2ee_connector-1_5-fr-spec.pdf │ │ │ │ ├── SunJcaSpecLicense.rtf │ │ │ │ ├── SunJmsSpecLicense.rtf │ │ │ │ ├── SunJtaSpecLicense.rtf │ │ │ │ ├── SunServlet2.3SpecLicense.rtf │ │ │ │ └── SunJdbc2.0ExtensionsLicense.rtf │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── atomikos │ │ │ │ ├── datasource │ │ │ │ ├── xa │ │ │ │ │ ├── session │ │ │ │ │ │ ├── SessionHandleStateChangeListener.java │ │ │ │ │ │ ├── UnexpectedTransactionContextException.java │ │ │ │ │ │ ├── InvalidSessionHandleStateException.java │ │ │ │ │ │ └── TerminatedStateHandler.java │ │ │ │ │ ├── DefaultXidFactory.java │ │ │ │ │ ├── XidFactory.java │ │ │ │ │ ├── ResourceTransactionSuspender.java │ │ │ │ │ └── AbstractXidFactory.java │ │ │ │ └── pool │ │ │ │ │ ├── XPooledConnectionEventListener.java │ │ │ │ │ ├── PoolExhaustedException.java │ │ │ │ │ ├── CreateConnectionException.java │ │ │ │ │ ├── ConnectionPoolException.java │ │ │ │ │ └── ConnectionFactory.java │ │ │ │ ├── icatch │ │ │ │ └── jta │ │ │ │ │ ├── ExtendedSystemException.java │ │ │ │ │ ├── template │ │ │ │ │ ├── NeverTemplate.java │ │ │ │ │ ├── SupportsTemplate.java │ │ │ │ │ ├── MandatoryTemplate.java │ │ │ │ │ ├── NotSupportedTemplate.java │ │ │ │ │ ├── NestedTemplate.java │ │ │ │ │ ├── RequiresNewTemplate.java │ │ │ │ │ └── RequiredTemplate.java │ │ │ │ │ └── XAResourceKey.java │ │ │ │ └── recovery │ │ │ │ └── xa │ │ │ │ ├── PreviousXidRepository.java │ │ │ │ └── InMemoryPreviousXidRepository.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── atomikos │ │ │ └── datasource │ │ │ └── xa │ │ │ ├── DefaultXidFactoryTestJUnit.java │ │ │ └── Issue10086TestJUnit.java │ └── pom.xml ├── util │ └── src │ │ ├── main │ │ ├── reference │ │ │ └── Slf4jLicense.pdf │ │ └── java │ │ │ └── com │ │ │ └── atomikos │ │ │ ├── logging │ │ │ ├── LoggerFactoryDelegate.java │ │ │ ├── Log4JLoggerFactoryDelegate.java │ │ │ ├── Slf4JLoggerFactoryDelegate.java │ │ │ ├── JULLoggerFactoryDelegate.java │ │ │ ├── Log4j2LoggerFactoryDelegate.java │ │ │ ├── StackTrace.java │ │ │ └── Logger.java │ │ │ ├── util │ │ │ ├── Assert.java │ │ │ ├── Proxied.java │ │ │ ├── DateHelper.java │ │ │ └── Atomikos.java │ │ │ ├── timing │ │ │ ├── AlarmTimerListener.java │ │ │ └── AlarmTimer.java │ │ │ ├── thread │ │ │ └── InterruptedExceptionHelper.java │ │ │ └── beans │ │ │ └── PropertyException.java │ │ └── test │ │ ├── resources │ │ └── META-INF │ │ │ └── maven │ │ │ └── com.atomikos │ │ │ └── atomikos-util │ │ │ └── pom.properties │ │ └── java │ │ ├── com │ │ └── atomikos │ │ │ ├── util │ │ │ ├── ProductVersionTestJUnit.java │ │ │ └── UniqueIdMgrTestJUnit.java │ │ │ ├── logging │ │ │ └── LoggerFactoryTestJUnit.java │ │ │ └── publish │ │ │ └── EventPublisherTestJUnit.java │ │ └── org │ │ └── slf4j │ │ └── impl │ │ ├── StaticMarkerBinder.java │ │ └── StaticLoggerBinder.java ├── transactions-remoting │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ ├── services │ │ │ └── com.atomikos.icatch.TransactionServicePlugin │ │ │ └── dubbo │ │ │ └── org.apache.dubbo.rpc.Filter │ │ └── java │ │ └── com │ │ └── atomikos │ │ └── remoting │ │ ├── support │ │ └── HeaderNames.java │ │ └── taas │ │ └── RestTransactionService.java ├── header.txt ├── transactions-osgi │ ├── osgi.bnd │ └── src.xml ├── transactions-api │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── atomikos │ │ │ │ ├── recovery │ │ │ │ ├── OltpLog.java │ │ │ │ ├── LogWriteException.java │ │ │ │ ├── LogException.java │ │ │ │ ├── LogReadException.java │ │ │ │ ├── OltpLogFactory.java │ │ │ │ └── RecoveryLog.java │ │ │ │ ├── icatch │ │ │ │ ├── HeuristicException.java │ │ │ │ ├── event │ │ │ │ │ ├── Event.java │ │ │ │ │ ├── transaction │ │ │ │ │ │ ├── TransactionEvent.java │ │ │ │ │ │ ├── ParticipantHeuristicEvent.java │ │ │ │ │ │ └── TransactionHeuristicEvent.java │ │ │ │ │ └── EventListener.java │ │ │ │ ├── HeurCommitException.java │ │ │ │ ├── HeurRollbackException.java │ │ │ │ ├── HeurHazardException.java │ │ │ │ ├── provider │ │ │ │ │ ├── TransactionServiceProvider.java │ │ │ │ │ └── Assembler.java │ │ │ │ ├── SysException.java │ │ │ │ ├── RollbackException.java │ │ │ │ ├── HeurMixedException.java │ │ │ │ ├── RecoveryCoordinator.java │ │ │ │ ├── CompositeCoordinator.java │ │ │ │ ├── OrderedLifecycleComponent.java │ │ │ │ ├── SubTxAwareParticipant.java │ │ │ │ ├── Synchronization.java │ │ │ │ ├── config │ │ │ │ │ └── UserTransactionService.java │ │ │ │ ├── TransactionServicePlugin.java │ │ │ │ ├── RecoveryService.java │ │ │ │ └── ExportingTransactionManager.java │ │ │ │ └── datasource │ │ │ │ ├── ResourceException.java │ │ │ │ ├── ResourceTransaction.java │ │ │ │ └── TransactionalResource.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── atomikos │ │ │ └── icatch │ │ │ └── JDependTestJunit.java │ └── pom.xml ├── transactions-jdbc │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── atomikos │ │ │ └── jdbc │ │ │ ├── internal │ │ │ ├── NonXaConnectionProxy.java │ │ │ └── JdbcConnectionProxyHelper.java │ │ │ └── nonxa │ │ │ └── AtomikosNonXADataSourceBean.java │ └── pom.xml ├── transactions-jndi-provider │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── atomikos │ │ │ └── jndi │ │ │ └── AtomikosContextFactory.java │ └── pom.xml ├── transactions-jms │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── atomikos │ │ │ │ └── jms │ │ │ │ ├── extra │ │ │ │ ├── MessageConsumerSessionProperties.java │ │ │ │ ├── JmsSenderTemplateCallback.java │ │ │ │ ├── RetrieveDestinationCallback.java │ │ │ │ ├── JmsSenderTemplate.java │ │ │ │ └── MessageCallback.java │ │ │ │ ├── internal │ │ │ │ ├── AbstractJmsSessionProxy.java │ │ │ │ └── AtomikosTransactionRequiredJMSException.java │ │ │ │ └── SessionCreationMode.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── atomikos │ │ │ └── jms │ │ │ ├── TestQueue.java │ │ │ └── AtomikosJMSExceptionTestJUnit.java │ └── pom.xml ├── transactions-hibernate2 │ ├── src │ │ ├── test │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── atomikos │ │ │ │ └── icatch │ │ │ │ └── jta │ │ │ │ └── hibernate │ │ │ │ └── TransactionManagerLookupTestJUnit.java │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── atomikos │ │ │ └── icatch │ │ │ └── jta │ │ │ └── hibernate │ │ │ └── TransactionManagerLookup.java │ └── pom.xml ├── transactions-hibernate3 │ └── src │ │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── atomikos │ │ │ └── icatch │ │ │ └── jta │ │ │ └── hibernate3 │ │ │ ├── TransactionManagerLookupTestJUnit.java │ │ │ └── AtomikosJTATransactionFactoryTestJUnit.java │ │ └── main │ │ └── java │ │ └── com │ │ └── atomikos │ │ └── icatch │ │ └── jta │ │ └── hibernate3 │ │ └── TransactionManagerLookup.java └── transactions-eclipselink │ ├── src │ └── main │ │ └── java │ │ └── com │ │ └── atomikos │ │ └── eclipselink │ │ └── platform │ │ ├── AtomikosPlatform.java │ │ └── AtomikosTransactionController.java │ └── pom.xml ├── .github ├── inconsistency.jpg ├── Atomikos_Logo_Background.png ├── atomikos_horizontal_logo.jpg ├── pull_request_template.md ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md └── workflows │ └── maven.yml ├── LICENSE.txt ├── .gitignore ├── .travis.yml ├── CODE-OF-CONDUCT.MD └── Jenkinsfile /public/spring-boot2/transactions-spring-boot/.gitignore: -------------------------------------------------------------------------------- 1 | transaction-logs 2 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3/.gitignore: -------------------------------------------------------------------------------- 1 | transaction-logs 2 | -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot-integration-tests/.gitignore: -------------------------------------------------------------------------------- 1 | transaction-logs 2 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3-integration-tests/.gitignore: -------------------------------------------------------------------------------- 1 | transaction-logs 2 | -------------------------------------------------------------------------------- /.github/inconsistency.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/.github/inconsistency.jpg -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | LICENSE CONDITIONS 2 | 3 | See http://www.atomikos.com/Main/WhichLicenseApplies for details. 4 | 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | private/ 2 | specs/ 3 | target/ 4 | .hg/ 5 | .settings/ 6 | .classpath 7 | .hgignore 8 | .hgtags 9 | .project 10 | -------------------------------------------------------------------------------- /.github/Atomikos_Logo_Background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/.github/Atomikos_Logo_Background.png -------------------------------------------------------------------------------- /.github/atomikos_horizontal_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/.github/atomikos_horizontal_logo.jpg -------------------------------------------------------------------------------- /public/transactions/src/main/resources/META-INF/services/com.atomikos.icatch.provider.Assembler: -------------------------------------------------------------------------------- 1 | com.atomikos.icatch.provider.imp.AssemblerImp -------------------------------------------------------------------------------- /public/transactions-jta/src/main/resources/META-INF/services/com.atomikos.icatch.TransactionServicePlugin: -------------------------------------------------------------------------------- 1 | com.atomikos.icatch.jta.JtaTransactionServicePlugin -------------------------------------------------------------------------------- /public/util/src/main/reference/Slf4jLicense.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/util/src/main/reference/Slf4jLicense.pdf -------------------------------------------------------------------------------- /public/transactions-remoting/src/main/resources/META-INF/services/com.atomikos.icatch.TransactionServicePlugin: -------------------------------------------------------------------------------- 1 | com.atomikos.remoting.RemotingTransactionServicePlugin -------------------------------------------------------------------------------- /public/header.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2000-2024 Atomikos 2 | 3 | LICENSE CONDITIONS 4 | 5 | See http://www.atomikos.com/Main/WhichLicenseApplies for details. 6 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/jdbc20.stdext.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/jdbc20.stdext.pdf -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/jta-spec1_0_1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/jta-spec1_0_1.pdf -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/jts1_0-spec.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/jts1_0-spec.pdf -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | com.atomikos.spring.AtomikosAutoConfiguration -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/jms-1_0_2b-spec.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/jms-1_0_2b-spec.pdf -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/jdbc-3.0-spec.df.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/jdbc-3.0-spec.df.pdf -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 2 | com.atomikos.spring.AtomikosAutoConfiguration 3 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/a.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/a.gif -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/TXT.rtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/TXT.rtf -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/dot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/dot.gif -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/j2ee_connector-1_0-fr-spec.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/j2ee_connector-1_0-fr-spec.pdf -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/j2ee_connector-1_5-fr-spec.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/j2ee_connector-1_5-fr-spec.pdf -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/1__#$!@%!#__a.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/1__#$!@%!#__a.gif -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/2__#$!@%!#__a.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/2__#$!@%!#__a.gif -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/3__#$!@%!#__a.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/3__#$!@%!#__a.gif -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/4__#$!@%!#__a.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/4__#$!@%!#__a.gif -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/5__#$!@%!#__a.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/5__#$!@%!#__a.gif -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/s976981862111.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/s976981862111.gif -------------------------------------------------------------------------------- /public/transactions-remoting/src/main/resources/META-INF/dubbo/org.apache.dubbo.rpc.Filter: -------------------------------------------------------------------------------- 1 | com.atomikos.remoting.dubbo.DubboConsumerTransactionPropagationFilter 2 | com.atomikos.remoting.dubbo.DubboProviderTransactionPropagationFilter -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/v3_pixel-trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/v3_pixel-trans.gif -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/1__#$!@%!#__v3_pixel-trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/1__#$!@%!#__v3_pixel-trans.gif -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/2__#$!@%!#__v3_pixel-trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/2__#$!@%!#__v3_pixel-trans.gif -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/3__#$!@%!#__v3_pixel-trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/3__#$!@%!#__v3_pixel-trans.gif -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/4__#$!@%!#__v3_pixel-trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/atomikos/transactions-essentials/HEAD/public/transactions-jta/src/main/reference/SunJca1.0License.rtfd/4__#$!@%!#__v3_pixel-trans.gif -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | 3 | jdk: 4 | - openjdk6 5 | 6 | install: mvn install -DskipTests=true -Popensource 7 | 8 | script: mvn clean test -Popensource 9 | 10 | 11 | notifications: 12 | email: 13 | - guy@atomikos.com 14 | - pascal.leclercq@gmail.com -------------------------------------------------------------------------------- /public/util/src/test/resources/META-INF/maven/com.atomikos/atomikos-util/pom.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2024 Atomikos 3 | # 4 | # LICENSE CONDITIONS 5 | # 6 | # See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | # 8 | 9 | version=X.Y.Z 10 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3-integration-tests/run.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2024 Atomikos 3 | # 4 | # LICENSE CONDITIONS 5 | # 6 | # See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | # 8 | 9 | mvn exec:java -Dexec.mainClass="com.atomikos.spring.integrationtest.SampleAtomikosApplication" 10 | -------------------------------------------------------------------------------- /public/transactions/src/test/resources/custom.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2024 Atomikos 3 | # 4 | # LICENSE CONDITIONS 5 | # 6 | # See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | # 8 | 9 | com.atomikos.icatch.jta.to.override.by.custom=custom.properties.override 10 | com.atomikos.icatch.custom.to.override.by.system=default -------------------------------------------------------------------------------- /public/transactions/src/test/resources/transactions.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2024 Atomikos 3 | # 4 | # LICENSE CONDITIONS 5 | # 6 | # See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | # 8 | 9 | com.atomikos.icatch.default.to.override.by.transactions=transactions.properties.override 10 | com.atomikos.icatch.transactions.to.override.by.jta=default -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot-integration-tests/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2024 Atomikos 3 | # 4 | # LICENSE CONDITIONS 5 | # 6 | # See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | # 8 | 9 | logging.level.com.atomikos=DEBUG 10 | spring.artemis.embedded.queues=accounts 11 | spring.jpa.open-in-view=true 12 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3-integration-tests/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2024 Atomikos 3 | # 4 | # LICENSE CONDITIONS 5 | # 6 | # See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | # 8 | 9 | logging.level.com.atomikos=DEBUG 10 | spring.artemis.embedded.queues=accounts 11 | spring.jpa.open-in-view=true 12 | -------------------------------------------------------------------------------- /public/util/src/main/java/com/atomikos/logging/LoggerFactoryDelegate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.logging; 10 | 11 | interface LoggerFactoryDelegate { 12 | 13 | Logger createLogger(Class clazz); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | _Write your description here. BTW we're really honoured to receive your help, but please understand that some pull requests may be rejected for several reasons - in particular because it might conflict with the commercial offerings of Atomikos. Without making money on something, we would not have been able to give TransactionsEssentials for free in the first place! Thanks for understanding..._ 2 | 3 | 4 | -------------------------------------------------------------------------------- /CODE-OF-CONDUCT.MD: -------------------------------------------------------------------------------- 1 | # Our Code of Conduct 2 | 3 | We try to manage this community with 2 simple rules: 4 | 5 | 1. Focus on improving TransactionsEssentials and its user-friendliness. 6 | 1. Intend no harm towards fellow members. 7 | 8 | Let these rules guide everything you say and do here. 9 | 10 | ## Reporting Violations 11 | 12 | If you suspect any violations then let us know by emailing to webmaster at atomikos dot com. -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJcaSpecLicense.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf380 2 | {\fonttbl\f0\fswiss\fcharset77 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \margl1440\margr1440\vieww9000\viewh8400\viewkind0 5 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural 6 | 7 | \f0\fs24 \cf0 See the specs PDF for the license conditions concerning the specification.} -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJmsSpecLicense.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf380 2 | {\fonttbl\f0\fswiss\fcharset77 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \margl1440\margr1440\vieww9000\viewh8400\viewkind0 5 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural 6 | 7 | \f0\fs24 \cf0 See the specs PDF for the license conditions concerning the specification.} -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJtaSpecLicense.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf380 2 | {\fonttbl\f0\fswiss\fcharset77 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \margl1440\margr1440\vieww9000\viewh8400\viewkind0 5 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural 6 | 7 | \f0\fs24 \cf0 See the specs PDF for the license conditions concerning the specification.} -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunServlet2.3SpecLicense.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf380 2 | {\fonttbl\f0\fswiss\fcharset77 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \margl1440\margr1440\vieww9000\viewh8400\viewkind0 5 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural 6 | 7 | \f0\fs24 \cf0 See the specs PDF for the license conditions concerning the specification.} -------------------------------------------------------------------------------- /public/transactions-jta/src/main/reference/SunJdbc2.0ExtensionsLicense.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf380 2 | {\fonttbl\f0\froman\fcharset77 TimesNewRomanMS;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \margl1440\margr1440\vieww9000\viewh8400\viewkind0 5 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural 6 | 7 | \f0\fs32 \cf0 See the 2.0 extensions PDF spec for the license: nothing is said about restrictions. } -------------------------------------------------------------------------------- /public/util/src/main/java/com/atomikos/util/Assert.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.util; 10 | 11 | public abstract class Assert { 12 | 13 | 14 | public static void notNull(String message, Object o) { 15 | if (o == null) { 16 | throw new IllegalArgumentException(message); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/finitestates/Stateful.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.finitestates; 10 | 11 | import com.atomikos.recovery.TxState; 12 | 13 | 14 | public interface Stateful{ 15 | /** 16 | *@return The object representing the state. 17 | */ 18 | public TxState getState(); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | tools { 4 | maven 'maven-3.6.0' 5 | } 6 | // Use the pomfix tool to validate that bundle dependencies are properly declared 7 | stage('Build') { 8 | steps { 9 | retry(3) { 10 | checkout scm 11 | } 12 | withMaven(maven: 'maven-3.6.0', jdk: 'jdk8-latest', mavenOpts: '-Xmx1024m -Xms512m') { 13 | sh 'mvn clean install' 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot-integration-tests/src/main/java/com/atomikos/spring/integrationtest/AccountRepository.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring.integrationtest; 10 | 11 | import org.springframework.data.jpa.repository.JpaRepository; 12 | 13 | public interface AccountRepository extends JpaRepository { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3-integration-tests/src/main/java/com/atomikos/spring/integrationtest/AccountRepository.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring.integrationtest; 10 | 11 | import org.springframework.data.jpa.repository.JpaRepository; 12 | 13 | public interface AccountRepository extends JpaRepository { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /public/transactions-osgi/osgi.bnd: -------------------------------------------------------------------------------- 1 | Bundle-Activator: com.atomikos.transactions.internal.AtomikosActivator 2 | Embed-Transitive: true 3 | Embed-Dependency: *;groupId=com.atomikos;inline=true 4 | Import-Package: javax.transaction;version="1.0.1",javax.transaction.xa;version="1.0.1",org.osgi.framework,javax.management;resolution:=optional,javax.naming.*,*;resolution:=optional 5 | Export-Package: com.atomikos.jdbc,com.atomikos.jdbc.nonxa,com.atomikos.jms,com.atomikos.jms.extra,com.atomikos.icatch.jta,com.atomikos.icatch.jta.template 6 | DynamicImport-Package: * 7 | -------------------------------------------------------------------------------- /public/transactions-jta/src/test/java/com/atomikos/datasource/xa/DefaultXidFactoryTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource.xa; 10 | 11 | public class DefaultXidFactoryTestJUnit extends AbstractXidFactoryTestCase { 12 | 13 | protected XidFactory createXidFactory() { 14 | return new DefaultXidFactory(); 15 | } 16 | 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/recovery/OltpLog.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.recovery; 10 | 11 | 12 | /** 13 | * Handle to the transaction logs for writing during transaction processing. 14 | */ 15 | public interface OltpLog { 16 | 17 | void write(PendingTransactionRecord pendingTransactionRecord) throws LogWriteException; 18 | 19 | void close(); 20 | } 21 | -------------------------------------------------------------------------------- /public/transactions-jdbc/src/main/java/com/atomikos/jdbc/internal/NonXaConnectionProxy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.jdbc.internal; 10 | 11 | import java.sql.SQLException; 12 | 13 | interface NonXaConnectionProxy 14 | { 15 | 16 | void transactionTerminated ( boolean committed ) throws SQLException; 17 | 18 | boolean isAvailableForReuseByPool(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /public/util/src/main/java/com/atomikos/logging/Log4JLoggerFactoryDelegate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.logging; 10 | 11 | class Log4JLoggerFactoryDelegate implements LoggerFactoryDelegate { 12 | 13 | public Logger createLogger(Class clazz) { 14 | 15 | return new Log4JLogger(clazz); 16 | } 17 | 18 | @Override 19 | public String toString() { 20 | 21 | return "Log4j"; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /public/util/src/main/java/com/atomikos/logging/Slf4JLoggerFactoryDelegate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.logging; 10 | 11 | class Slf4JLoggerFactoryDelegate implements LoggerFactoryDelegate { 12 | 13 | public Logger createLogger(Class clazz) { 14 | 15 | return new Slf4jLogger(clazz); 16 | } 17 | 18 | @Override 19 | public String toString() { 20 | 21 | return "Slf4J"; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/datasource/xa/session/SessionHandleStateChangeListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource.xa.session; 10 | 11 | 12 | public interface SessionHandleStateChangeListener { 13 | 14 | /** 15 | * fired when all contexts of the SessionHandleState changed to terminated state 16 | */ 17 | void onTerminated(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/HeuristicException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch; 10 | 11 | /** 12 | * Common superclass for heuristics. 13 | */ 14 | 15 | public class HeuristicException extends Exception { 16 | 17 | private static final long serialVersionUID = 1L; 18 | 19 | public HeuristicException(String message) { 20 | super(message); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /public/util/src/main/java/com/atomikos/logging/JULLoggerFactoryDelegate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.logging; 10 | 11 | class JULLoggerFactoryDelegate implements LoggerFactoryDelegate { 12 | 13 | public Logger createLogger(Class clazz) { 14 | 15 | return new JULLogger(clazz); 16 | } 17 | 18 | @Override 19 | public String toString() { 20 | 21 | return "Java Util Logging"; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/finitestates/FSMTransitionEventSource.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.finitestates; 10 | 11 | import com.atomikos.recovery.TxState; 12 | 13 | 14 | 15 | public interface FSMTransitionEventSource extends Stateful 16 | { 17 | public void addFSMTransitionListener(FSMTransitionListener l, 18 | TxState from, TxState to); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/recovery/LogWriteException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.recovery; 10 | 11 | public class LogWriteException extends LogException { 12 | 13 | private static final long serialVersionUID = 5648208124041649641L; 14 | 15 | public LogWriteException() { 16 | super(); 17 | } 18 | public LogWriteException(Throwable cause) { 19 | super(cause); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /public/util/src/test/java/com/atomikos/util/ProductVersionTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.util; 10 | 11 | import static com.atomikos.util.Atomikos.VERSION; 12 | import static org.junit.Assert.assertEquals; 13 | 14 | import org.junit.Test; 15 | 16 | public class ProductVersionTestJUnit { 17 | 18 | @Test 19 | public void checkAtomikosVersion() { 20 | assertEquals("X.Y.Z", VERSION); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/event/Event.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.event; 10 | 11 | /** 12 | * Significant core events that are communicated to plugged-in listeners. 13 | */ 14 | public abstract class Event { 15 | 16 | public final long eventCreationTimestamp; 17 | 18 | protected Event() { 19 | this.eventCreationTimestamp = System.currentTimeMillis(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /public/util/src/main/java/com/atomikos/logging/Log4j2LoggerFactoryDelegate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.logging; 10 | 11 | public class Log4j2LoggerFactoryDelegate implements LoggerFactoryDelegate { 12 | 13 | @Override 14 | public Logger createLogger(Class clazz) { 15 | 16 | return new Log4j2Logger(clazz); 17 | } 18 | 19 | @Override 20 | public String toString() { 21 | 22 | return "Log4j2"; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/datasource/xa/DefaultXidFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource.xa; 10 | 11 | 12 | 13 | /** 14 | * A default Xid factory. 15 | */ 16 | 17 | class DefaultXidFactory extends AbstractXidFactory implements 18 | java.io.Serializable 19 | { 20 | 21 | 22 | private static final long serialVersionUID = -8667085263366123575L; 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /public/transactions/src/test/resources/jta.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2024 Atomikos 3 | # 4 | # LICENSE CONDITIONS 5 | # 6 | # See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | # 8 | 9 | com.atomikos.icatch.bla=bla 10 | com.atomikos.icatch.default.to.override.by.jta=jta.properties.override 11 | com.atomikos.icatch.transactions.to.override.by.jta=jta.properties.override 12 | com.atomikos.icatch.jta.to.override.by.system=default 13 | com.atomikos.icatch.jta.to.override.by.custom=default 14 | com.atomikos.icatch.jta.to.substitute=${com.atomikos.icatch.jta.to.override.by.system} -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/HeurCommitException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch; 10 | 11 | /** 12 | * Exception signaling heuristic commit. 13 | */ 14 | 15 | public class HeurCommitException extends HeuristicException { 16 | 17 | private static final long serialVersionUID = 1L; 18 | 19 | public HeurCommitException() { 20 | super("Heuristic Commit Exception"); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/recovery/LogException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.recovery; 10 | 11 | public class LogException extends Exception { 12 | 13 | private static final long serialVersionUID = 3259337218182873867L; 14 | 15 | public LogException() { 16 | super(); 17 | } 18 | 19 | public LogException(String message) { 20 | super(message); 21 | } 22 | 23 | public LogException(Throwable cause) { 24 | super(cause); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/datasource/pool/XPooledConnectionEventListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource.pool; 10 | 11 | 12 | public interface XPooledConnectionEventListener 13 | { 14 | 15 | /** 16 | * fired when a connection changed its state to terminated 17 | * @param connection 18 | */ 19 | void onXPooledConnectionTerminated(XPooledConnection connection); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/finitestates/StateMutable.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.finitestates; 10 | 11 | import com.atomikos.recovery.TxState; 12 | 13 | 14 | public interface StateMutable extends Stateful{ 15 | 16 | /** 17 | *@exception IllegalStateException if the new state transition to 18 | *the new state is not allowed. 19 | */ 20 | 21 | public void setState(TxState s) throws IllegalStateException; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /public/util/src/test/java/com/atomikos/logging/LoggerFactoryTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.logging; 10 | 11 | import junit.framework.TestCase; 12 | 13 | public class LoggerFactoryTestJUnit extends TestCase { 14 | 15 | public void testCreateLogger() { 16 | System.out.println(LoggerFactory.loggerFactoryDelegate); 17 | 18 | assertEquals(com.atomikos.logging.Slf4JLoggerFactoryDelegate.class, LoggerFactory.loggerFactoryDelegate.getClass()); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Describe alternatives you've considered** 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /public/util/src/main/java/com/atomikos/timing/AlarmTimerListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | 10 | package com.atomikos.timing; 11 | 12 | 13 | /** 14 | * 15 | * 16 | *A listener for timer events. 17 | */ 18 | 19 | public interface AlarmTimerListener 20 | { 21 | /** 22 | *Notify the instance of an alarm coming from a timer. 23 | * 24 | *@param timer The timer raising the alarm. 25 | */ 26 | 27 | public void alarm(AlarmTimer timer); 28 | } 29 | -------------------------------------------------------------------------------- /public/transactions-remoting/src/main/java/com/atomikos/remoting/support/HeaderNames.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.remoting.support; 10 | 11 | public class HeaderNames { 12 | 13 | public static class MimeType { 14 | public static final String APPLICATION_VND_ATOMIKOS_JSON = "application/vnd.atomikos+json"; 15 | } 16 | 17 | public static final String PROPAGATION_HEADER_NAME = "Atomikos-Propagation"; 18 | public static final String EXTENT_HEADER_NAME = "Atomikos-Extent"; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/recovery/LogReadException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.recovery; 10 | 11 | public class LogReadException extends LogException { 12 | 13 | private static final long serialVersionUID = -4835268355879075429L; 14 | 15 | public LogReadException() { 16 | super(); 17 | } 18 | 19 | public LogReadException(Throwable cause) { 20 | super(cause); 21 | } 22 | 23 | public LogReadException(String message) { 24 | super(message); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/HeurRollbackException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch; 10 | 11 | /** 12 | * An exception signaling that the transaction's work has been rolled back 13 | * heuristically. 14 | */ 15 | 16 | public class HeurRollbackException extends HeuristicException { 17 | 18 | private static final long serialVersionUID = 1L; 19 | 20 | public HeurRollbackException() { 21 | super("Heuristic Rollback Exception"); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/finitestates/FSMEnterEventSource.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.finitestates; 10 | 11 | import com.atomikos.recovery.TxState; 12 | 13 | 14 | public interface FSMEnterEventSource extends Stateful 15 | { 16 | 17 | /** 18 | *Add an enter event listener. 19 | *@param l The listener. 20 | *@param state The state to listen on. 21 | * 22 | */ 23 | 24 | public void addFSMEnterListener(FSMEnterListener l, TxState state); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot-integration-tests/src/main/java/com/atomikos/spring/integrationtest/Messages.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring.integrationtest; 10 | 11 | import org.springframework.jms.annotation.JmsListener; 12 | import org.springframework.stereotype.Component; 13 | 14 | @Component 15 | public class Messages { 16 | 17 | @JmsListener(destination = "accounts") 18 | public void onMessage(String content) { 19 | System.out.println("----> " + content); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3-integration-tests/src/main/java/com/atomikos/spring/integrationtest/Messages.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring.integrationtest; 10 | 11 | import org.springframework.jms.annotation.JmsListener; 12 | import org.springframework.stereotype.Component; 13 | 14 | @Component 15 | public class Messages { 16 | 17 | @JmsListener(destination = "accounts") 18 | public void onMessage(String content) { 19 | System.out.println("----> " + content); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /public/util/src/main/java/com/atomikos/util/Proxied.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.util; 10 | 11 | import java.lang.annotation.ElementType; 12 | import java.lang.annotation.Retention; 13 | import java.lang.annotation.RetentionPolicy; 14 | import java.lang.annotation.Target; 15 | 16 | /** 17 | * Annotation for marking a specific method as being a dynamic proxy implementation. 18 | */ 19 | 20 | @Retention(value=RetentionPolicy.RUNTIME) 21 | @Target(value=ElementType.METHOD) 22 | public @interface Proxied { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/datasource/xa/session/UnexpectedTransactionContextException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource.xa.session; 10 | 11 | 12 | /** 13 | * 14 | * 15 | * 16 | * An exception to signal that an unexpected 17 | * transaction context exists for the current thread. 18 | */ 19 | 20 | class UnexpectedTransactionContextException 21 | extends Exception 22 | { 23 | 24 | private static final long serialVersionUID = -1180906964991835993L; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /public/util/src/test/java/com/atomikos/util/UniqueIdMgrTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.util; 10 | 11 | import junit.framework.TestCase; 12 | 13 | public class UniqueIdMgrTestJUnit extends TestCase { 14 | 15 | private UniqueIdMgr idmgr; 16 | 17 | protected void setUp() throws Exception { 18 | super.setUp(); 19 | idmgr = new UniqueIdMgr ( "./testserver" ); 20 | } 21 | 22 | 23 | public void testGetReturnsUniqueId() { 24 | assertFalse(idmgr.get().equals(idmgr.get())); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /public/transactions-api/src/test/java/com/atomikos/icatch/JDependTestJunit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch; 10 | 11 | import java.io.IOException; 12 | 13 | import org.junit.Assert; 14 | import org.junit.Test; 15 | 16 | import jdepend.framework.JDepend; 17 | 18 | public class JDependTestJunit { 19 | 20 | @Test 21 | public void test() throws IOException { 22 | JDepend jdepend = new JDepend(); 23 | jdepend.addDirectory("target/classes"); 24 | jdepend.analyze(); 25 | Assert.assertFalse(jdepend.containsCycles()); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /public/transactions-jndi-provider/src/main/java/com/atomikos/jndi/AtomikosContextFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.jndi; 10 | 11 | import java.util.Hashtable; 12 | 13 | import javax.naming.Context; 14 | import javax.naming.NamingException; 15 | import javax.naming.spi.InitialContextFactory; 16 | 17 | public class AtomikosContextFactory implements InitialContextFactory { 18 | 19 | @Override 20 | public Context getInitialContext(Hashtable arg0) 21 | throws NamingException { 22 | return new AtomikosContext(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/icatch/imp/ForgetResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.imp; 10 | 11 | class ForgetResult extends Result 12 | { 13 | 14 | public ForgetResult ( int numberOfRepliesToWaitFor ) 15 | { 16 | super ( numberOfRepliesToWaitFor ); 17 | 18 | } 19 | 20 | protected synchronized void calculateResultFromAllReplies() throws IllegalStateException, 21 | InterruptedException 22 | 23 | { 24 | // nothing to do here 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /public/util/src/main/java/com/atomikos/timing/AlarmTimer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.timing; 10 | 11 | 12 | /** 13 | * A common interface for timers. 14 | * 15 | * @author Lars J. Nilsson 16 | */ 17 | public interface AlarmTimer extends Runnable { 18 | 19 | public long getTimeout(); 20 | 21 | public boolean isActive(); 22 | 23 | public void stopTimer(); 24 | 25 | public void addAlarmTimerListener(AlarmTimerListener lstnr); 26 | 27 | public void removeAlarmTimerListener(AlarmTimerListener lstnr); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/recovery/OltpLogFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.recovery; 10 | 11 | 12 | /** 13 | * Non-default OLTP logging can be enabled by registering an instance 14 | * of this interface via the ServiceLoader mechanism of the JDK. 15 | * At most one instance is allowed. If none is found, then default logging will be used. 16 | */ 17 | 18 | public interface OltpLogFactory { 19 | 20 | /** 21 | * @param properties The init properties picked up . 22 | */ 23 | public OltpLog createOltpLog(); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/event/transaction/TransactionEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.event.transaction; 10 | 11 | import com.atomikos.icatch.event.Event; 12 | 13 | 14 | /** 15 | * Domain event raised whenever something significant happens in the transaction life cycle. 16 | * 17 | */ 18 | 19 | public abstract class TransactionEvent extends Event { 20 | 21 | public final String transactionId; 22 | 23 | protected TransactionEvent(String transactionId) { 24 | this.transactionId = transactionId; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /public/transactions-jms/src/main/java/com/atomikos/jms/extra/MessageConsumerSessionProperties.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.jms.extra; 10 | 11 | 12 | /** 13 | * Configuration properties for the consumer session. 14 | * 15 | * An interface like this allows for the detection of hot-changes in settings. 16 | * 17 | */ 18 | 19 | interface MessageConsumerSessionProperties 20 | { 21 | 22 | public int getTransactionTimeout(); 23 | 24 | public boolean getUnsubscribeOnClose(); 25 | 26 | public int getReceiveTimeout(); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/datasource/pool/PoolExhaustedException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource.pool; 10 | 11 | 12 | /** 13 | * Exception signaling pool exhaustion. 14 | * 15 | */ 16 | public class PoolExhaustedException extends ConnectionPoolException { 17 | 18 | 19 | private static final long serialVersionUID = 7266245068986719051L; 20 | 21 | PoolExhaustedException ( String reason ) { 22 | super ( reason ); 23 | } 24 | 25 | public PoolExhaustedException() { 26 | super(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/icatch/jta/ExtendedSystemException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.jta; 10 | 11 | import javax.transaction.SystemException; 12 | 13 | /** 14 | * A better system exception, containing throwable cause. 15 | */ 16 | 17 | public class ExtendedSystemException extends SystemException { 18 | 19 | private static final long serialVersionUID = 1475357523769839371L; 20 | 21 | public ExtendedSystemException(String msg, Throwable cause) { 22 | super(msg); 23 | initCause(cause); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/icatch/imp/TxActiveStateHandler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.imp; 10 | 11 | import com.atomikos.recovery.TxState; 12 | 13 | /** 14 | * An active state handler. 15 | */ 16 | 17 | class TxActiveStateHandler extends TransactionStateHandler 18 | { 19 | 20 | protected TxActiveStateHandler ( CompositeTransactionImp ct ) 21 | { 22 | super ( ct ); 23 | 24 | } 25 | 26 | protected TxState getState () 27 | { 28 | 29 | return TxState.ACTIVE; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/HeurHazardException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch; 10 | 11 | /** 12 | * Exception signaling that two-phase commit was not acknowledged by some 13 | * participants. 14 | */ 15 | 16 | public class HeurHazardException extends HeuristicException { 17 | 18 | private static final long serialVersionUID = 1L; 19 | 20 | public HeurHazardException() { 21 | super("Heuristic Hazard Exception"); 22 | } 23 | 24 | public HeurHazardException(String msg) { 25 | super(msg); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/provider/TransactionServiceProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.provider; 10 | 11 | import java.util.Properties; 12 | 13 | import com.atomikos.icatch.RecoveryService; 14 | import com.atomikos.icatch.SysException; 15 | import com.atomikos.icatch.TransactionService; 16 | 17 | public interface TransactionServiceProvider extends TransactionService { 18 | 19 | void init(Properties properties) throws SysException; 20 | 21 | RecoveryService getRecoveryService(); 22 | 23 | void shutdown(boolean force); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /public/transactions-jms/src/test/java/com/atomikos/jms/TestQueue.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.jms; 10 | 11 | import javax.jms.JMSException; 12 | import javax.jms.Queue; 13 | 14 | /** 15 | * 16 | * 17 | * 18 | * 19 | * 20 | * 21 | */ 22 | public class TestQueue implements Queue 23 | { 24 | 25 | private String name = "TESTQUEUE"; 26 | 27 | public String getQueueName() throws JMSException 28 | { 29 | return name; 30 | } 31 | 32 | public String toString() 33 | { 34 | return name; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/datasource/ResourceException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource; 10 | 11 | 12 | /** 13 | * Exception on the level of the resource manager. 14 | * Contains more detailed info of actual underlying exception. 15 | */ 16 | 17 | public class ResourceException extends com.atomikos.icatch.SysException 18 | { 19 | 20 | public ResourceException(String msg){ 21 | super(msg); 22 | 23 | } 24 | 25 | public ResourceException(String msg, Throwable cause) { 26 | super(msg, cause); 27 | } 28 | 29 | } 30 | 31 | -------------------------------------------------------------------------------- /public/util/src/main/java/com/atomikos/util/DateHelper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.util; 10 | 11 | import java.text.SimpleDateFormat; 12 | import java.util.Date; 13 | 14 | public class DateHelper { 15 | 16 | private static ThreadLocal threadSafeSimpleDateFormat = new ThreadLocal() { 17 | protected SimpleDateFormat initialValue() { 18 | 19 | return new SimpleDateFormat("yyyy.MM.dd HH:mm:ss:SSS"); 20 | 21 | }; 22 | 23 | }; 24 | 25 | public static String format(Date date) { 26 | return threadSafeSimpleDateFormat.get().format(date); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /public/transactions-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | com.atomikos 6 | ate 7 | 6.0.1-SNAPSHOT 8 | 9 | transactions-api 10 | Transactions API 11 | 12 | 13 | 14 | jdepend 15 | jdepend 16 | 2.9.1 17 | test 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/finitestates/FSMEnterEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.finitestates; 10 | 11 | import java.util.EventObject; 12 | 13 | import com.atomikos.recovery.TxState; 14 | 15 | public class FSMEnterEvent extends EventObject{ 16 | 17 | private static final long serialVersionUID = -7910459829127232977L; 18 | 19 | protected final TxState newState; 20 | 21 | public FSMEnterEvent(Object source, TxState state){ 22 | super(source); 23 | newState=state; 24 | } 25 | 26 | public TxState getState(){ 27 | return newState; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/provider/Assembler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.provider; 10 | 11 | import com.atomikos.icatch.CompositeTransactionManager; 12 | 13 | /** 14 | * Abstraction of how the API is instantiated. 15 | * Instances are found by the Configuration class, 16 | * via the ServiceLoader mechanism of the JDK. 17 | */ 18 | 19 | public interface Assembler { 20 | 21 | ConfigProperties initializeProperties(); 22 | 23 | TransactionServiceProvider assembleTransactionService(); 24 | 25 | CompositeTransactionManager assembleCompositeTransactionManager(); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/recovery/xa/PreviousXidRepository.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.recovery.xa; 10 | 11 | import java.util.List; 12 | 13 | import com.atomikos.datasource.xa.XID; 14 | 15 | public interface PreviousXidRepository { 16 | 17 | List findXidsExpiredAt(long startOfRecoveryScan); 18 | 19 | /** 20 | * Remembers the given XID for later. 21 | * @param xidToStoreForNextScan 22 | * @param expiration 23 | */ 24 | void remember(XID xidToStoreForNextScan, long expiration); 25 | 26 | void forgetXidsExpiredAt(long startOfRecoveryScan); 27 | 28 | boolean isEmpty(); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/event/EventListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.event; 10 | 11 | 12 | /** 13 | * Observer interface for transaction-related domain events. 14 | * 15 | * External applications/modules can implement this functionality to 16 | * be notified of significant events. Implementations are registered 17 | * via the JDK 6+ ServiceLoader mechanism. 18 | * 19 | * CAUTION: event notification is synchronous, so registering listeners 20 | * may impact performance of the core! 21 | */ 22 | public interface EventListener { 23 | 24 | void eventOccurred(Event event); 25 | 26 | } -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/icatch/imp/RollbackCallback.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.imp; 10 | 11 | import com.atomikos.icatch.HeurCommitException; 12 | import com.atomikos.icatch.HeurHazardException; 13 | import com.atomikos.icatch.HeurMixedException; 14 | import com.atomikos.icatch.SysException; 15 | 16 | /** 17 | * Callback interface for logic inside the rollback template. 18 | * 19 | */ 20 | 21 | interface RollbackCallback { 22 | 23 | public void doRollback() throws HeurCommitException, 24 | HeurMixedException, SysException, HeurHazardException, 25 | java.lang.IllegalStateException; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /public/util/src/main/java/com/atomikos/thread/InterruptedExceptionHelper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.thread; 10 | 11 | import com.atomikos.logging.Logger; 12 | import com.atomikos.logging.LoggerFactory; 13 | 14 | public class InterruptedExceptionHelper 15 | { 16 | private static final Logger LOGGER = LoggerFactory.createLogger(InterruptedExceptionHelper.class); 17 | 18 | public static void handleInterruptedException ( InterruptedException e ) 19 | { 20 | LOGGER.logWarning ( "Thread interrupted " , e ); 21 | // interrupt again - cf http://www.javaspecialists.co.za/archive/Issue056.html 22 | Thread.currentThread().interrupt(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/SysException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch; 10 | 11 | 12 | /** 13 | * An exception for unexpected system errors with nested information. 14 | */ 15 | 16 | 17 | public class SysException extends RuntimeException 18 | { 19 | 20 | private static final long serialVersionUID = -9183281406145817016L; 21 | 22 | public SysException (String msg) 23 | { 24 | super(msg); 25 | } 26 | 27 | public SysException(String msg, Throwable cause) { 28 | super(msg,cause); 29 | } 30 | 31 | public SysException(Throwable cause) { 32 | super(cause); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve our next community release! 4 | 5 | --- 6 | 7 | **Describe the bug** 8 | A clear and concise description of what the bug is. 9 | 10 | **To Reproduce** 11 | Steps to reproduce the behavior: 12 | 13 | 1. What you were doing (or trying to do) 14 | 1. What happened 15 | 1. What you expected to happen instead 16 | 1. What TransactionsEssentials version you are using 17 | 18 | **Additional context** 19 | Add any other context about the problem here. 20 | 21 | _I understand that this project is not intended for support - because bug reports may or may not be considered for inclusion some day (in a future release). If this is issue is important to me then I can go to https://www.atomikos.com/Main/SupportOverview and arrange a paid support subscription._ 22 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/RollbackException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch; 10 | 11 | 12 | 13 | /** 14 | * An exception indicating that a transaction has already been rolled back. 15 | */ 16 | 17 | public class RollbackException extends Exception 18 | { 19 | 20 | private static final long serialVersionUID = 1L; 21 | 22 | public RollbackException(String msg) 23 | { 24 | super (msg); 25 | } 26 | 27 | public RollbackException(String msg, Throwable cause) { 28 | super(msg,cause); 29 | } 30 | 31 | public RollbackException() 32 | { 33 | super(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /public/transactions-jdbc/src/main/java/com/atomikos/jdbc/nonxa/AtomikosNonXADataSourceBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.jdbc.nonxa; 10 | 11 | /** 12 | * 13 | * @deprecated This class is preserved for backward compatibility of existing configurations 14 | * and Spring Boot. It will be removed in some future release. 15 | * 16 | * @see com.atomikos.jdbc.AtomikosNonXADataSourceBean com.atomikos.jdbc.AtomikosNonXADataSourceBean should be used instead. 17 | * 18 | */ 19 | 20 | @Deprecated 21 | public class AtomikosNonXADataSourceBean extends com.atomikos.jdbc.AtomikosNonXADataSourceBean { 22 | 23 | private static final long serialVersionUID = 1L; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/datasource/pool/CreateConnectionException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource.pool; 10 | 11 | 12 | /** 13 | * An exception to signal errors during the creation of connections. 14 | * 15 | * 16 | */ 17 | 18 | public class CreateConnectionException extends ConnectionPoolException 19 | { 20 | 21 | private static final long serialVersionUID = 1858243647893576738L; 22 | public CreateConnectionException ( String reason , Exception cause ) 23 | { 24 | super ( reason , cause ); 25 | } 26 | public CreateConnectionException ( String reason ) 27 | { 28 | super ( reason ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot-integration-tests/src/main/java/com/atomikos/spring/integrationtest/Account.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring.integrationtest; 10 | 11 | import javax.persistence.Entity; 12 | import javax.persistence.GeneratedValue; 13 | import javax.persistence.Id; 14 | 15 | @Entity 16 | public class Account { 17 | 18 | @Id 19 | @GeneratedValue 20 | private Long id; 21 | 22 | private String username; 23 | 24 | Account() { 25 | } 26 | 27 | public Account(String username) { 28 | this.username = username; 29 | } 30 | 31 | public String getUsername() { 32 | return this.username; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/datasource/pool/ConnectionPoolException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource.pool; 10 | 11 | 12 | /** 13 | * Common superclass for all exceptions thrown by the 14 | * pooling mechanism. 15 | * 16 | */ 17 | 18 | public class ConnectionPoolException extends Exception 19 | { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | ConnectionPoolException ( String reason , Exception cause ) 24 | { 25 | super ( reason , cause ); 26 | } 27 | ConnectionPoolException ( String reason ) 28 | { 29 | super ( reason ); 30 | } 31 | public ConnectionPoolException() { 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3-integration-tests/src/main/java/com/atomikos/spring/integrationtest/Account.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring.integrationtest; 10 | 11 | import jakarta.persistence.Entity; 12 | import jakarta.persistence.GeneratedValue; 13 | import jakarta.persistence.Id; 14 | 15 | @Entity 16 | public class Account { 17 | 18 | @Id 19 | @GeneratedValue 20 | private Long id; 21 | 22 | private String username; 23 | 24 | Account() { 25 | } 26 | 27 | public Account(String username) { 28 | this.username = username; 29 | } 30 | 31 | public String getUsername() { 32 | return this.username; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/datasource/pool/ConnectionFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource.pool; 10 | 11 | 12 | 13 | public interface ConnectionFactory 14 | { 15 | 16 | /** 17 | * Opens a new physical connection to the underlying resource and wraps it in a 18 | * pooling-capable {@link XPooledConnection}. 19 | * 20 | * @return the {@link XPooledConnection} wrapping the physical connection. 21 | * 22 | * @throws CreateConnectionException If no connection could be created. 23 | * 24 | */ 25 | XPooledConnection createPooledConnection() throws CreateConnectionException; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/icatch/imp/CommitCallback.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.imp; 10 | 11 | import com.atomikos.icatch.HeurHazardException; 12 | import com.atomikos.icatch.HeurMixedException; 13 | import com.atomikos.icatch.HeurRollbackException; 14 | import com.atomikos.icatch.RollbackException; 15 | import com.atomikos.icatch.SysException; 16 | 17 | /** 18 | * Callback interface for logic inside the commit template. 19 | */ 20 | 21 | interface CommitCallback { 22 | 23 | public void doCommit() throws HeurRollbackException, HeurMixedException, 24 | HeurHazardException, java.lang.IllegalStateException, 25 | RollbackException, SysException; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/HeurMixedException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | 10 | // 11 | //Revision 1.2 2001/03/01 19:26:57 pardon 12 | //Added more. 13 | // 14 | //Revision 1.1 2001/02/21 19:51:23 pardon 15 | //Redesign! 16 | // 17 | 18 | package com.atomikos.icatch; 19 | 20 | 21 | 22 | /** 23 | * An exception signaling that some participants 24 | * have committed whereas others performed a rollback. 25 | */ 26 | 27 | public class HeurMixedException extends HeuristicException 28 | { 29 | private static final long serialVersionUID = 1L; 30 | 31 | public HeurMixedException () 32 | { 33 | super("Heuristic Mixed Exception"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/finitestates/FSMTransitionEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.finitestates; 10 | 11 | import java.util.EventObject; 12 | 13 | import com.atomikos.recovery.TxState; 14 | 15 | public class FSMTransitionEvent extends EventObject{ 16 | 17 | private static final long serialVersionUID = 7629493293234798149L; 18 | 19 | protected final Transition transition; 20 | 21 | public FSMTransitionEvent(Object source,Transition transition){ 22 | super(source); 23 | this.transition = transition; 24 | } 25 | 26 | public TxState fromState(){ 27 | return transition.from; 28 | } 29 | 30 | public TxState toState(){ 31 | return transition.to; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /public/transactions-osgi/src.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | sources 14 | false 15 | 16 | jar 17 | 18 | 19 | 20 | ${project.build.directory}/sources 21 | / 22 | true 23 | 24 | 25 | -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot/src/main/java/com/atomikos/spring/AtomikosXADataSourceWrapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import javax.sql.XADataSource; 12 | 13 | import org.springframework.boot.jdbc.XADataSourceWrapper; 14 | 15 | /** 16 | * {@link XADataSourceWrapper} that uses an {@link AtomikosDataSourceBean} to wrap a 17 | * {@link XADataSource}. 18 | */ 19 | public class AtomikosXADataSourceWrapper implements XADataSourceWrapper { 20 | 21 | @Override 22 | public AtomikosDataSourceBean wrapDataSource(XADataSource dataSource) throws Exception { 23 | AtomikosDataSourceBean bean = new AtomikosDataSourceBean(); 24 | bean.setXaDataSource(dataSource); 25 | return bean; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3/src/main/java/com/atomikos/spring/AtomikosXADataSourceWrapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import javax.sql.XADataSource; 12 | 13 | import org.springframework.boot.jdbc.XADataSourceWrapper; 14 | 15 | /** 16 | * {@link XADataSourceWrapper} that uses an {@link AtomikosDataSourceBean} to wrap a 17 | * {@link XADataSource}. 18 | */ 19 | public class AtomikosXADataSourceWrapper implements XADataSourceWrapper { 20 | 21 | @Override 22 | public AtomikosDataSourceBean wrapDataSource(XADataSource dataSource) throws Exception { 23 | AtomikosDataSourceBean bean = new AtomikosDataSourceBean(); 24 | bean.setXaDataSource(dataSource); 25 | return bean; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/RecoveryCoordinator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch; 10 | 11 | 12 | /** 13 | * The coordinator who knows the outcome for recovery purposes. 14 | */ 15 | 16 | public interface RecoveryCoordinator 17 | { 18 | 19 | 20 | /** 21 | * Gets the URI identifier for this coordinator. 22 | * @return String The URI identifier. 23 | */ 24 | 25 | String getURI(); 26 | 27 | /** 28 | * 29 | * @return The recovery domain of this coordinator; a different one indicates a foreign transaction 30 | * (i.e., one whose commit decision is unknown in our logs). 31 | */ 32 | String getRecoveryDomainName(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /public/util/src/test/java/org/slf4j/impl/StaticMarkerBinder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package org.slf4j.impl; 10 | 11 | import org.slf4j.IMarkerFactory; 12 | import org.slf4j.helpers.BasicMarkerFactory; 13 | import org.slf4j.spi.MarkerFactoryBinder; 14 | 15 | public class StaticMarkerBinder implements MarkerFactoryBinder { 16 | 17 | /** 18 | * The unique instance of this class. 19 | */ 20 | public static final StaticMarkerBinder SINGLETON = new StaticMarkerBinder(); 21 | 22 | final IMarkerFactory markerFactory = new BasicMarkerFactory(); 23 | 24 | @Override 25 | public IMarkerFactory getMarkerFactory() { 26 | return markerFactory; 27 | } 28 | 29 | @Override 30 | public String getMarkerFactoryClassStr() { 31 | return BasicMarkerFactory.class.getName(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/datasource/xa/XidFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource.xa; 10 | 11 | 12 | /** 13 | * 14 | * 15 | * A factory for creating new Xid instances. This allows different factories for 16 | * different resources, which is needed because some resources need a custom Xid 17 | * format. 18 | */ 19 | 20 | public interface XidFactory 21 | { 22 | /** 23 | * Creates a new Xid instance for a given composite transaction id and 24 | * branch identifier. 25 | * 26 | * @param tid 27 | * @param branchIdentifier 28 | * @param uniqueResourceName 29 | */ 30 | 31 | public XID createXid (String tid , String branchIdentifier, String uniqueResourceName); 32 | } 33 | -------------------------------------------------------------------------------- /public/transactions/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | com.atomikos 6 | ate 7 | 6.0.1-SNAPSHOT 8 | 9 | transactions 10 | Transactions Core 11 | 12 | 13 | 14 | com.atomikos 15 | transactions-api 16 | 6.0.1-SNAPSHOT 17 | 18 | 19 | com.atomikos 20 | atomikos-util 21 | 6.0.1-SNAPSHOT 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/finitestates/FSMEnterListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.finitestates; 10 | 11 | import java.util.EventListener; 12 | 13 | 14 | 15 | public interface FSMEnterListener extends EventListener 16 | { 17 | 18 | /** 19 | *Called BEFORE the FSM enters the new state, so that 20 | *the callee is sure that nobody has seen the new state yet. 21 | * 22 | *@exception IllegalStateException on failure. 23 | *The callee can use this to prevent the state change from 24 | *happening. 25 | */ 26 | 27 | public void preEnter(FSMEnterEvent e) throws IllegalStateException; 28 | 29 | /** 30 | *Called when the FSM has entered a new state. 31 | * 32 | */ 33 | 34 | public void entered(FSMEnterEvent e); 35 | } 36 | -------------------------------------------------------------------------------- /public/util/src/test/java/org/slf4j/impl/StaticLoggerBinder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package org.slf4j.impl; 10 | 11 | import org.mockito.Mockito; 12 | import org.slf4j.ILoggerFactory; 13 | import org.slf4j.Logger; 14 | import org.slf4j.spi.LoggerFactoryBinder; 15 | 16 | public class StaticLoggerBinder implements LoggerFactoryBinder { 17 | 18 | public static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder(); 19 | 20 | public static Logger mockito; 21 | 22 | public ILoggerFactory getLoggerFactory() { 23 | return new ILoggerFactory() { 24 | 25 | public Logger getLogger(String clazz) { 26 | mockito = Mockito.mock(Logger.class); 27 | return mockito; 28 | } 29 | 30 | }; 31 | } 32 | 33 | public String getLoggerFactoryClassStr() { 34 | return null; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/datasource/ResourceTransaction.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource; 10 | 11 | 12 | /** 13 | * The notion of a local transaction executed on a resource. 14 | * Serves as a handle towards the transaction management module. 15 | */ 16 | 17 | public interface ResourceTransaction 18 | { 19 | 20 | 21 | /** 22 | * Suspends the work, so that underlying resources can 23 | * be used for a next (sibling) invocation. 24 | * 25 | */ 26 | 27 | void suspend() throws IllegalStateException,ResourceException; 28 | 29 | /** 30 | * Resumes a previously suspended tx. 31 | * 32 | */ 33 | 34 | void resume() throws IllegalStateException,ResourceException; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/icatch/jta/template/NeverTemplate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.jta.template; 10 | 11 | import java.util.concurrent.Callable; 12 | 13 | import javax.transaction.Transaction; 14 | import javax.transaction.TransactionManager; 15 | 16 | class NeverTemplate extends TransactionTemplate { 17 | 18 | public NeverTemplate(TransactionManager utm, int timeout) { 19 | super(utm, timeout); 20 | } 21 | 22 | public T execute(Callable work) throws Exception { 23 | Transaction existingTransaction = utm.getTransaction(); 24 | if (existingTransaction != null) { 25 | throw new IllegalStateException("A transaction exists but none is allowed."); 26 | } 27 | return work.call(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/CompositeCoordinator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch; 10 | 11 | 12 | /** 13 | * Represents the per-server work done 14 | * as part of the same global (root) transaction scope. 15 | */ 16 | 17 | public interface CompositeCoordinator 18 | { 19 | 20 | /** 21 | * @return The coordinatorId. 22 | */ 23 | 24 | String getCoordinatorId(); 25 | 26 | /** 27 | * 28 | * @return The top-level root's coordinatorId. 29 | */ 30 | String getRootId(); 31 | 32 | 33 | /** 34 | * 35 | *@return RecoveryCoordinator. 36 | */ 37 | 38 | RecoveryCoordinator getRecoveryCoordinator(); 39 | 40 | } 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/icatch/jta/template/SupportsTemplate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.jta.template; 10 | 11 | import java.util.concurrent.Callable; 12 | 13 | import javax.transaction.Transaction; 14 | import javax.transaction.TransactionManager; 15 | 16 | class SupportsTemplate extends TransactionTemplate { 17 | 18 | public SupportsTemplate(TransactionManager utm, int timeout) { 19 | super(utm, timeout); 20 | } 21 | 22 | public T execute(Callable work) throws Exception { 23 | Transaction existingTransaction = utm.getTransaction(); 24 | if (existingTransaction != null) { 25 | return super.execute(work); 26 | } else { 27 | return work.call(); 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /public/util/src/main/java/com/atomikos/logging/StackTrace.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.logging; 10 | 11 | public class StackTrace { 12 | 13 | private static final String TAB = "\t"; 14 | static final String EMPTY_STRING = ""; 15 | public static final String LINE_SEPARATOR = System.getProperty("line.separator"); 16 | 17 | public static String toString(StackTraceElement[] stackTrace) { 18 | if (stackTrace != null) { 19 | StringBuffer stackTraces = new StringBuffer(); 20 | String lineSeparator = EMPTY_STRING; 21 | for (StackTraceElement ste : stackTrace) { 22 | stackTraces.append(lineSeparator); 23 | lineSeparator = LINE_SEPARATOR; 24 | stackTraces.append(TAB); 25 | stackTraces.append(ste); 26 | } 27 | return stackTraces.toString(); 28 | } 29 | return EMPTY_STRING; 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /public/transactions-hibernate2/src/test/java/com/atomikos/icatch/jta/hibernate/TransactionManagerLookupTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.jta.hibernate; 10 | 11 | import junit.framework.TestCase; 12 | import net.sf.hibernate.HibernateException; 13 | 14 | public class TransactionManagerLookupTestJUnit extends TestCase { 15 | 16 | private TransactionManagerLookup lookup; 17 | 18 | protected void setUp() throws Exception { 19 | super.setUp(); 20 | lookup = new TransactionManagerLookup(); 21 | } 22 | 23 | public void testTransactionManager() throws HibernateException { 24 | assertNotNull ( lookup.getTransactionManager( null) ); 25 | } 26 | 27 | public void testName() throws Exception 28 | { 29 | assertNull ( lookup.getUserTransactionName() ); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /public/transactions-hibernate3/src/test/java/com/atomikos/icatch/jta/hibernate3/TransactionManagerLookupTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.jta.hibernate3; 10 | 11 | import org.hibernate.HibernateException; 12 | 13 | import junit.framework.TestCase; 14 | 15 | public class TransactionManagerLookupTestJUnit extends TestCase { 16 | 17 | private TransactionManagerLookup lookup; 18 | 19 | protected void setUp() throws Exception { 20 | super.setUp(); 21 | lookup = new TransactionManagerLookup(); 22 | } 23 | 24 | public void testTransactionManager() throws HibernateException { 25 | assertNotNull ( lookup.getTransactionManager( null) ); 26 | } 27 | 28 | public void testName() throws Exception 29 | { 30 | assertNull ( lookup.getUserTransactionName() ); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/icatch/jta/template/MandatoryTemplate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.jta.template; 10 | 11 | import java.util.concurrent.Callable; 12 | 13 | import javax.transaction.Transaction; 14 | import javax.transaction.TransactionManager; 15 | 16 | class MandatoryTemplate extends TransactionTemplate { 17 | 18 | public MandatoryTemplate(TransactionManager utm, int timeout) { 19 | super(utm, timeout); 20 | } 21 | 22 | public T execute(Callable work) throws Exception { 23 | Transaction existingTransaction = utm.getTransaction(); 24 | if (existingTransaction == null) { 25 | throw new IllegalStateException("A transaction is required but none exists."); 26 | } 27 | return super.execute(work); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/icatch/imp/SubTransactionRecoveryCoordinator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.imp; 10 | 11 | import com.atomikos.icatch.RecoveryCoordinator; 12 | 13 | class SubTransactionRecoveryCoordinator implements RecoveryCoordinator { 14 | 15 | private String superiorCoordinatorId; 16 | private String recoveryDomainName; 17 | 18 | public SubTransactionRecoveryCoordinator(String superiorCoordinatorId, String recoveryDomainName) { 19 | this.superiorCoordinatorId = superiorCoordinatorId; 20 | this.recoveryDomainName = recoveryDomainName; 21 | } 22 | 23 | 24 | @Override 25 | public String getURI() { 26 | return superiorCoordinatorId; 27 | } 28 | 29 | 30 | @Override 31 | public String getRecoveryDomainName() { 32 | return recoveryDomainName; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/OrderedLifecycleComponent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch; 10 | 11 | /** 12 | * Marker interface for system components whose order of init 13 | * and close is important for correct behavior of the 14 | * transaction system. The knowledge of ordering is supposed to 15 | * be present elsewhere - in the system configuration. 16 | */ 17 | 18 | public interface OrderedLifecycleComponent { 19 | 20 | /** 21 | * 22 | * @throws Exception Implementations are free to narrow the exception 23 | * or even not throw anything. 24 | */ 25 | 26 | void init() throws Exception; 27 | 28 | /** 29 | * 30 | * @throws Exception Implementations are free to narrow the exception 31 | * or even not throw anything. 32 | */ 33 | 34 | void close() throws Exception; 35 | } 36 | -------------------------------------------------------------------------------- /public/transactions-eclipselink/src/main/java/com/atomikos/eclipselink/platform/AtomikosPlatform.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.eclipselink.platform; 10 | 11 | import org.eclipse.persistence.platform.server.ServerPlatformBase; 12 | import org.eclipse.persistence.sessions.DatabaseSession; 13 | 14 | import com.atomikos.util.Atomikos; 15 | 16 | public class AtomikosPlatform extends ServerPlatformBase { 17 | 18 | public AtomikosPlatform(DatabaseSession newDatabaseSession) { 19 | super(newDatabaseSession); 20 | disableRuntimeServices(); 21 | } 22 | 23 | @Override 24 | public Class getExternalTransactionControllerClass() { 25 | 26 | return AtomikosTransactionController.class; 27 | } 28 | 29 | @Override 30 | protected void initializeServerNameAndVersion() { 31 | this.serverNameAndVersion="Atomikos: "+Atomikos.VERSION; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/datasource/xa/session/InvalidSessionHandleStateException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource.xa.session; 10 | 11 | 12 | /** 13 | * 14 | * 15 | * 16 | * Exception signaling that the state has 17 | * been corrupted. Occurrences should almost 18 | * invariably cause the session handle to be 19 | * discarded. 20 | * 21 | * 22 | */ 23 | 24 | public class InvalidSessionHandleStateException 25 | extends Exception 26 | { 27 | 28 | private static final long serialVersionUID = 2838873552114439968L; 29 | 30 | 31 | InvalidSessionHandleStateException ( String msg ) 32 | { 33 | super ( msg ); 34 | } 35 | 36 | 37 | InvalidSessionHandleStateException ( String msg , Exception cause ) 38 | { 39 | super ( msg , cause ); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/icatch/jta/template/NotSupportedTemplate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.jta.template; 10 | 11 | import java.util.concurrent.Callable; 12 | 13 | import javax.transaction.Transaction; 14 | import javax.transaction.TransactionManager; 15 | 16 | class NotSupportedTemplate extends TransactionTemplate { 17 | 18 | public NotSupportedTemplate(TransactionManager utm, int timeout) { 19 | super(utm, timeout); 20 | } 21 | 22 | public T execute(Callable work) throws Exception { 23 | T ret = null; 24 | Transaction tx = null; 25 | try { 26 | tx = utm.suspend(); 27 | ret = work.call(); 28 | } finally { 29 | if (tx != null) { 30 | utm.resume(tx); 31 | } 32 | } 33 | return ret; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /public/transactions/src/test/java/com/atomikos/icatch/imp/ConditionalWaiterTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.imp; 10 | 11 | import static org.junit.Assert.assertFalse; 12 | import static org.junit.Assert.assertTrue; 13 | 14 | import org.junit.Before; 15 | import org.junit.Test; 16 | 17 | public class ConditionalWaiterTestJUnit { 18 | 19 | private ConditionalWaiter waiter; 20 | 21 | @Before 22 | public void setUp() { 23 | waiter = new ConditionalWaiter(1000); 24 | } 25 | 26 | @Test 27 | public void testTimeout() { 28 | boolean timeout = waiter.waitWhile(() -> {return true;}); 29 | assertTrue(timeout); 30 | } 31 | 32 | @Test 33 | public void testNoTimeout() { 34 | boolean timeout = waiter.waitWhile(() -> {return false;}); 35 | assertFalse(timeout); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/SubTxAwareParticipant.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch; 10 | 11 | 12 | /** 13 | * A participant that wants to be notified of local termination of a node in a 14 | * nested transaction tree. 15 | */ 16 | 17 | public interface SubTxAwareParticipant 18 | { 19 | /** 20 | * Notification of termination. 21 | * 22 | * @param transaction The composite transaction that has terminated 23 | * locally at its node. 24 | */ 25 | 26 | void committed ( CompositeTransaction transaction ); 27 | 28 | /** 29 | * Notification that some transaction has been rolledback. 30 | * 31 | * @param parent The transaction that has rolled back at its node. 32 | */ 33 | 34 | void rolledback ( CompositeTransaction transaction ); 35 | } 36 | -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot/src/main/java/com/atomikos/spring/AtomikosXAConnectionFactoryWrapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import javax.jms.ConnectionFactory; 12 | import javax.jms.XAConnectionFactory; 13 | 14 | import org.springframework.boot.jms.XAConnectionFactoryWrapper; 15 | 16 | /** 17 | * {@link XAConnectionFactoryWrapper} that uses an {@link AtomikosConnectionFactoryBean} 18 | * to wrap a {@link XAConnectionFactory}. 19 | */ 20 | public class AtomikosXAConnectionFactoryWrapper implements XAConnectionFactoryWrapper { 21 | 22 | @Override 23 | public ConnectionFactory wrapConnectionFactory(XAConnectionFactory connectionFactory) { 24 | AtomikosConnectionFactoryBean bean = new AtomikosConnectionFactoryBean(); 25 | bean.setXaConnectionFactory(connectionFactory); 26 | return bean; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/Synchronization.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch; 10 | 11 | import com.atomikos.recovery.TxState; 12 | 13 | 14 | 15 | /** 16 | * A synchronization inferface for transaction termination callbacks. 17 | * Instances are volatile, i.e. not recovered after a crash/restart. 18 | */ 19 | 20 | public interface Synchronization { 21 | /** 22 | * Called before prepare decision is made. 23 | */ 24 | 25 | void beforeCompletion (); 26 | 27 | /** 28 | * Called after the overall outcome is known. 29 | * 30 | * @param txstate The state of the coordinator after preparing. 31 | * Equals either null ( readonly ), TxState.COMMITTING or TxState.ABORTING. 32 | */ 33 | 34 | void afterCompletion ( TxState txstate ); 35 | } 36 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3/src/main/java/com/atomikos/spring/AtomikosXAConnectionFactoryWrapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import jakarta.jms.ConnectionFactory; 12 | import jakarta.jms.XAConnectionFactory; 13 | 14 | import org.springframework.boot.jms.XAConnectionFactoryWrapper; 15 | 16 | /** 17 | * {@link XAConnectionFactoryWrapper} that uses an {@link AtomikosConnectionFactoryBean} 18 | * to wrap a {@link XAConnectionFactory}. 19 | */ 20 | public class AtomikosXAConnectionFactoryWrapper implements XAConnectionFactoryWrapper { 21 | 22 | @Override 23 | public ConnectionFactory wrapConnectionFactory(XAConnectionFactory connectionFactory) { 24 | AtomikosConnectionFactoryBean bean = new AtomikosConnectionFactoryBean(); 25 | bean.setXaConnectionFactory(connectionFactory); 26 | return bean; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /public/util/src/main/java/com/atomikos/logging/Logger.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.logging; 10 | 11 | public interface Logger { 12 | 13 | void logFatal(String message); 14 | 15 | void logError(String message); 16 | 17 | void logWarning(String message); 18 | 19 | void logInfo(String message); 20 | 21 | void logDebug(String message); 22 | 23 | void logTrace(String message); 24 | 25 | void logFatal(String message, Throwable error); 26 | 27 | void logError(String message, Throwable error); 28 | 29 | void logWarning(String message, Throwable error); 30 | 31 | void logInfo(String message, Throwable error); 32 | 33 | void logDebug(String message, Throwable error); 34 | 35 | void logTrace(String message, Throwable error); 36 | 37 | boolean isTraceEnabled(); 38 | 39 | boolean isDebugEnabled(); 40 | 41 | boolean isErrorEnabled(); 42 | 43 | boolean isInfoEnabled(); 44 | 45 | } -------------------------------------------------------------------------------- /public/transactions-jta/src/test/java/com/atomikos/datasource/xa/Issue10086TestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource.xa; 10 | 11 | import java.util.concurrent.atomic.AtomicLong; 12 | 13 | import junit.framework.TestCase; 14 | 15 | public class Issue10086TestJUnit extends TestCase { 16 | 17 | private XidFactory factory; 18 | 19 | protected void setUp() throws Exception { 20 | super.setUp(); 21 | //set counter to max value for max length of branch id 22 | AbstractXidFactory.counter = new AtomicLong ( Long.MAX_VALUE -1) ; 23 | factory = new DefaultXidFactory(); 24 | } 25 | 26 | //assert that at least 45 characters are supported in branch identifier 27 | public void testResourceNameLength45() 28 | { 29 | 30 | String bname = "abcdefghijklmnopqrstuvwxyz1234567890123456789"; 31 | factory.createXid ( "abc" , bname , "resource"); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /public/transactions-jms/src/main/java/com/atomikos/jms/internal/AbstractJmsSessionProxy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.jms.internal; 10 | 11 | import javax.jms.Session; 12 | 13 | import com.atomikos.icatch.CompositeTransaction; 14 | import com.atomikos.util.DynamicProxySupport; 15 | 16 | public abstract class AbstractJmsSessionProxy extends DynamicProxySupport { 17 | 18 | public AbstractJmsSessionProxy(Session delegate) { 19 | super(delegate); 20 | } 21 | 22 | protected abstract boolean isAvailable(); 23 | 24 | protected abstract boolean isErroneous(); 25 | 26 | protected abstract boolean isInTransaction(CompositeTransaction ct); 27 | 28 | protected boolean isInactiveTransaction(CompositeTransaction ct) { 29 | // default to false: be pessimistic and disallow reuse if not sure 30 | return false; 31 | } 32 | 33 | public abstract void recycle(); 34 | } 35 | -------------------------------------------------------------------------------- /public/transactions-eclipselink/src/main/java/com/atomikos/eclipselink/platform/AtomikosTransactionController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.eclipselink.platform; 10 | 11 | import javax.transaction.TransactionManager; 12 | 13 | import org.eclipse.persistence.transaction.JTATransactionController; 14 | 15 | import com.atomikos.icatch.jta.UserTransactionManager; 16 | 17 | public class AtomikosTransactionController extends JTATransactionController { 18 | 19 | private UserTransactionManager utm; 20 | 21 | public AtomikosTransactionController() { 22 | utm = new UserTransactionManager(); 23 | } 24 | /** 25 | * INTERNAL: Obtain and return the JTA TransactionManager on this platform 26 | */ 27 | protected TransactionManager acquireTransactionManager() throws Exception { 28 | return utm; 29 | } 30 | 31 | @Override 32 | public TransactionManager getTransactionManager() { 33 | 34 | return utm; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /public/transactions-jms/src/main/java/com/atomikos/jms/internal/AtomikosTransactionRequiredJMSException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.jms.internal; 10 | 11 | import com.atomikos.logging.Logger; 12 | import com.atomikos.logging.LoggerFactory; 13 | 14 | public class AtomikosTransactionRequiredJMSException extends AtomikosJMSException { 15 | private static final long serialVersionUID = 1L; 16 | 17 | private static final Logger LOGGER = LoggerFactory.createLogger(AtomikosTransactionRequiredJMSException.class); 18 | 19 | public static void throwAtomikosTransactionRequiredJMSException(String reason) 20 | throws AtomikosTransactionRequiredJMSException { 21 | LOGGER.logWarning(reason); 22 | throw new AtomikosTransactionRequiredJMSException(reason); 23 | } 24 | 25 | AtomikosTransactionRequiredJMSException(String reason) { 26 | super(reason); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/persistence/StateRecoveryManager.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.persistence; 10 | 11 | import com.atomikos.recovery.LogException; 12 | /** 13 | * A state recovery manager is responsible for reconstructing StateRecoverable 14 | * instances based on the history. 15 | */ 16 | 17 | public interface StateRecoveryManager 18 | { 19 | 20 | /** 21 | * Register a staterecoverable with the recovery manager service. 22 | * 23 | * @param staterecoverable 24 | * The object that wants recoverable states. 25 | */ 26 | 27 | public void register ( RecoverableCoordinator staterecoverable ); 28 | 29 | /** 30 | * Shutdown. 31 | * 32 | * @exception LogException 33 | * For underlying log failure. 34 | */ 35 | 36 | public void close () throws com.atomikos.recovery.LogException; 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /public/transactions-eclipselink/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | ate 5 | com.atomikos 6 | 6.0.1-SNAPSHOT 7 | 8 | transactions-eclipselink 9 | 10 | 11 | org.eclipse.persistence 12 | eclipselink 13 | 2.7.12 14 | provided 15 | 16 | 17 | com.atomikos 18 | transactions-jta 19 | 6.0.1-SNAPSHOT 20 | 21 | 22 | org.apache.geronimo.specs 23 | geronimo-jta_1.0.1B_spec 24 | 1.0 25 | provided 26 | 27 | 28 | -------------------------------------------------------------------------------- /public/transactions-hibernate3/src/test/java/com/atomikos/icatch/jta/hibernate3/AtomikosJTATransactionFactoryTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.jta.hibernate3; 10 | 11 | import junit.framework.TestCase; 12 | 13 | public class AtomikosJTATransactionFactoryTestJUnit extends TestCase 14 | { 15 | 16 | private AtomikosJTATransactionFactory hibernate; 17 | 18 | protected void setUp() throws Exception 19 | { 20 | super.setUp(); 21 | hibernate = new AtomikosJTATransactionFactory(); 22 | } 23 | 24 | public void testIssue58114() 25 | { 26 | try { 27 | hibernate.configure ( null ); 28 | } catch ( NullPointerException bug58114 ) { 29 | fail ( "Calling configure should not throw exceptions or Hibernate-JTA will not work!" ); 30 | } 31 | 32 | testUserTransaction(); 33 | } 34 | 35 | public void testUserTransaction() 36 | { 37 | assertNotNull ( hibernate.getUserTransaction() ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /public/transactions-jms/src/main/java/com/atomikos/jms/extra/JmsSenderTemplateCallback.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.jms.extra; 10 | 11 | import javax.jms.JMSException; 12 | import javax.jms.Session; 13 | 14 | /** 15 | * This is a call-back interface for doing more advanced 16 | * and non-standard processing with the JmsSenderTemplate classes. 17 | * 18 | * Application code can implement this interface to get full access 19 | * to the underlying (and managed!) JMS Session object. 20 | * 21 | */ 22 | 23 | @FunctionalInterface 24 | public interface JmsSenderTemplateCallback 25 | { 26 | 27 | /** 28 | * Performs some application-specific processing on the 29 | * underlying JMS session. 30 | * 31 | * @param session The JMS session, as managed by the JmsSenderTemplate classes. 32 | * @throws JMSException On errors. 33 | */ 34 | 35 | public void doInJmsSession ( Session session ) throws JMSException; 36 | } 37 | -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot/src/test/java/com/atomikos/spring/AtomikosXADataSourceWrapperTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import javax.sql.DataSource; 12 | import javax.sql.XADataSource; 13 | 14 | import org.junit.Test; 15 | 16 | import static org.assertj.core.api.Assertions.assertThat; 17 | import static org.mockito.Mockito.mock; 18 | 19 | /** 20 | * Tests for {@link AtomikosXADataSourceWrapper}. 21 | */ 22 | public class AtomikosXADataSourceWrapperTestJUnit { 23 | 24 | @Test 25 | public void wrap() throws Exception { 26 | XADataSource dataSource = mock(XADataSource.class); 27 | AtomikosXADataSourceWrapper wrapper = new AtomikosXADataSourceWrapper(); 28 | DataSource wrapped = wrapper.wrapDataSource(dataSource); 29 | assertThat(wrapped).isInstanceOf(AtomikosDataSourceBean.class); 30 | assertThat(((AtomikosDataSourceBean) wrapped).getXaDataSource()).isSameAs(dataSource); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3/src/test/java/com/atomikos/spring/AtomikosXADataSourceWrapperTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import javax.sql.DataSource; 12 | import javax.sql.XADataSource; 13 | 14 | import org.junit.Test; 15 | 16 | import static org.assertj.core.api.Assertions.assertThat; 17 | import static org.mockito.Mockito.mock; 18 | 19 | /** 20 | * Tests for {@link AtomikosXADataSourceWrapper}. 21 | */ 22 | public class AtomikosXADataSourceWrapperTestJUnit { 23 | 24 | @Test 25 | public void wrap() throws Exception { 26 | XADataSource dataSource = mock(XADataSource.class); 27 | AtomikosXADataSourceWrapper wrapper = new AtomikosXADataSourceWrapper(); 28 | DataSource wrapped = wrapper.wrapDataSource(dataSource); 29 | assertThat(wrapped).isInstanceOf(AtomikosDataSourceBean.class); 30 | assertThat(((AtomikosDataSourceBean) wrapped).getXaDataSource()).isSameAs(dataSource); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/icatch/jta/template/NestedTemplate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.jta.template; 10 | 11 | import java.lang.reflect.UndeclaredThrowableException; 12 | import java.util.concurrent.Callable; 13 | 14 | import javax.transaction.TransactionManager; 15 | 16 | class NestedTemplate extends TransactionTemplate { 17 | 18 | protected NestedTemplate(TransactionManager utm, int timeout) { 19 | super(utm, timeout); 20 | } 21 | 22 | public T execute(Callable work) throws Exception { 23 | T ret = null; 24 | try { 25 | beginTransaction(); 26 | ret = work.call(); 27 | utm.commit(); 28 | } catch (Exception e) { 29 | utm.rollback(); 30 | throw e; 31 | } catch (Throwable e) { 32 | utm.rollback(); 33 | throw new UndeclaredThrowableException(e); 34 | } 35 | return ret; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/recovery/fs/Repository.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.recovery.fs; 10 | 11 | import java.util.Collection; 12 | 13 | import com.atomikos.recovery.LogException; 14 | import com.atomikos.recovery.LogReadException; 15 | import com.atomikos.recovery.LogWriteException; 16 | import com.atomikos.recovery.PendingTransactionRecord; 17 | 18 | public interface Repository { 19 | 20 | void init() throws LogException; 21 | 22 | void put(String id,PendingTransactionRecord pendingTransactionRecord) throws LogWriteException; 23 | 24 | PendingTransactionRecord get(String coordinatorId) throws LogReadException; 25 | 26 | Collection findAllCommittingCoordinatorLogEntries() throws LogReadException; 27 | 28 | Collection getAllCoordinatorLogEntries() throws LogReadException; 29 | 30 | void writeCheckpoint(Collection checkpointContent) throws LogWriteException; 31 | 32 | void close(); 33 | } 34 | -------------------------------------------------------------------------------- /public/transactions/src/main/resources/transactions-defaults.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2024 Atomikos 3 | # 4 | # LICENSE CONDITIONS 5 | # 6 | # See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | # 8 | 9 | com.atomikos.icatch.enable_logging=true 10 | com.atomikos.icatch.force_shutdown_on_vm_exit=false 11 | com.atomikos.icatch.checkpoint_interval=500 12 | com.atomikos.icatch.serial_jta_transactions=true 13 | com.atomikos.icatch.default_jta_timeout=10000 14 | com.atomikos.icatch.max_timeout=300000 15 | com.atomikos.icatch.log_base_dir=./ 16 | com.atomikos.icatch.max_actives=50 17 | com.atomikos.icatch.log_base_name=tmlog 18 | com.atomikos.icatch.forget_orphaned_log_entries_delay=86400000 19 | com.atomikos.icatch.recovery_delay=${com.atomikos.icatch.default_jta_timeout} 20 | com.atomikos.icatch.oltp_max_retries=5 21 | com.atomikos.icatch.oltp_retry_interval=10000 22 | com.atomikos.icatch.allow_subtransactions=true 23 | com.atomikos.icatch.logcloud_datasource_name=logCloudDS 24 | com.atomikos.icatch.throw_on_heuristic=false 25 | com.atomikos.icatch.log_lock_acquisition_max_attempts=3 26 | com.atomikos.icatch.log_lock_acquisition_retry_delay=1000 27 | -------------------------------------------------------------------------------- /public/transactions-jdbc/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | com.atomikos 6 | ate 7 | 6.0.1-SNAPSHOT 8 | 9 | transactions-jdbc 10 | Transactions JDBC 11 | 12 | false 13 | 14 | 15 | 16 | com.atomikos 17 | transactions-jta 18 | 6.0.1-SNAPSHOT 19 | provided 20 | 21 | 22 | org.apache.geronimo.specs 23 | geronimo-jta_1.0.1B_spec 24 | 1.0 25 | provided 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/datasource/TransactionalResource.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource; 10 | 11 | import com.atomikos.icatch.CompositeTransaction; 12 | 13 | /** 14 | * Represents the abstraction of a data source that 15 | * supports transactions and recovery. 16 | */ 17 | 18 | public interface TransactionalResource extends RecoverableResource 19 | { 20 | /** 21 | * Gets or creates a ResourceTransaction. This instructs the resource 22 | * to internally start a context for a new transaction. 23 | * If the resource decides to return a new instance, it should 24 | * also make sure that before returning, the new resource 25 | * transaction is registered as a participant for the supplied 26 | * composite transaction. 27 | * 28 | */ 29 | 30 | ResourceTransaction 31 | getResourceTransaction ( CompositeTransaction compositeTransaction ) 32 | throws IllegalStateException, ResourceException; 33 | 34 | 35 | 36 | } 37 | -------------------------------------------------------------------------------- /public/transactions-jms/src/main/java/com/atomikos/jms/extra/RetrieveDestinationCallback.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.jms.extra; 10 | 11 | import javax.jms.Destination; 12 | import javax.jms.JMSException; 13 | import javax.jms.Session; 14 | 15 | import com.atomikos.jms.internal.AtomikosJMSException; 16 | 17 | class RetrieveDestinationCallback implements JmsSenderTemplateCallback 18 | { 19 | 20 | private String destinationName; 21 | private Destination destination; 22 | 23 | RetrieveDestinationCallback ( String destinationName ) { 24 | this.destinationName = destinationName; 25 | } 26 | 27 | public void doInJmsSession ( Session session ) throws JMSException 28 | { 29 | if ( destinationName == null ) 30 | AtomikosJMSException.throwAtomikosJMSException ( 31 | "Property 'destinationName' was not set" ); 32 | 33 | destination = DestinationHelper.findDestination ( destinationName , session ); 34 | } 35 | 36 | Destination getDestination() 37 | { 38 | return destination; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/finitestates/Transition.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.finitestates; 10 | 11 | import com.atomikos.recovery.TxState; 12 | 13 | public class Transition { 14 | 15 | public final TxState from; 16 | public final TxState to; 17 | public Transition(TxState from, TxState to) { 18 | super(); 19 | this.from = from; 20 | this.to = to; 21 | } 22 | @Override 23 | public int hashCode() { 24 | final int prime = 31; 25 | int result = 1; 26 | result = prime * result + ((from == null) ? 0 : from.hashCode()); 27 | result = prime * result + ((to == null) ? 0 : to.hashCode()); 28 | return result; 29 | } 30 | @Override 31 | public boolean equals(Object obj) { 32 | if (this == obj) 33 | return true; 34 | if (obj == null) 35 | return false; 36 | if (getClass() != obj.getClass()) 37 | return false; 38 | Transition other = (Transition) obj; 39 | if (from != other.from) 40 | return false; 41 | if (to != other.to) 42 | return false; 43 | return true; 44 | } 45 | 46 | 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot-integration-tests/src/main/java/com/atomikos/spring/integrationtest/AccountService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring.integrationtest; 10 | 11 | import javax.transaction.Transactional; 12 | 13 | import org.springframework.jms.core.JmsTemplate; 14 | import org.springframework.stereotype.Service; 15 | 16 | @Service 17 | @Transactional 18 | public class AccountService { 19 | 20 | private final JmsTemplate jmsTemplate; 21 | 22 | private final AccountRepository accountRepository; 23 | 24 | public AccountService(JmsTemplate jmsTemplate, AccountRepository accountRepository) { 25 | this.jmsTemplate = jmsTemplate; 26 | this.accountRepository = accountRepository; 27 | } 28 | 29 | public void createAccountAndNotify(String username) { 30 | this.jmsTemplate.convertAndSend("accounts", username); 31 | this.accountRepository.save(new Account(username)); 32 | if ("error".equals(username)) { 33 | throw new RuntimeException("Simulated error"); 34 | } 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /public/transactions-jms/src/test/java/com/atomikos/jms/AtomikosJMSExceptionTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.jms; 10 | 11 | import javax.jms.JMSException; 12 | 13 | import com.atomikos.jms.internal.AtomikosJMSException; 14 | 15 | import junit.framework.TestCase; 16 | 17 | public class AtomikosJMSExceptionTestJUnit extends TestCase { 18 | 19 | 20 | public void testLinkedException() { 21 | JMSException linked = new JMSException ( "test" ); 22 | AtomikosJMSException e = new AtomikosJMSException ( getName() ); 23 | e.setLinkedException ( linked ); 24 | assertSame ( linked , e.getLinkedException() ); 25 | assertNull ( e.getCause() ); 26 | assertEquals ( getName() , e.getMessage() ); 27 | } 28 | 29 | public void testCause() { 30 | Exception cause = new Exception ( getName() ); 31 | AtomikosJMSException e = new AtomikosJMSException ( getName() , cause ); 32 | assertSame ( cause , e.getCause() ); 33 | assertSame ( cause , e.getLinkedException() ); 34 | assertEquals ( getName() , e.getMessage() ); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot/src/test/java/com/atomikos/spring/AtomikosXAConnectionFactoryWrapperTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import javax.jms.ConnectionFactory; 12 | import javax.jms.XAConnectionFactory; 13 | 14 | import org.junit.Test; 15 | 16 | import static org.assertj.core.api.Assertions.assertThat; 17 | import static org.mockito.Mockito.mock; 18 | 19 | /** 20 | * Tests for {@link AtomikosXAConnectionFactoryWrapper}. 21 | */ 22 | public class AtomikosXAConnectionFactoryWrapperTestJUnit { 23 | 24 | @Test 25 | public void wrap() { 26 | XAConnectionFactory connectionFactory = mock(XAConnectionFactory.class); 27 | AtomikosXAConnectionFactoryWrapper wrapper = new AtomikosXAConnectionFactoryWrapper(); 28 | ConnectionFactory wrapped = wrapper.wrapConnectionFactory(connectionFactory); 29 | assertThat(wrapped).isInstanceOf(AtomikosConnectionFactoryBean.class); 30 | assertThat(((AtomikosConnectionFactoryBean) wrapped).getXaConnectionFactory()).isSameAs(connectionFactory); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3-integration-tests/src/main/java/com/atomikos/spring/integrationtest/AccountService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring.integrationtest; 10 | 11 | import jakarta.transaction.Transactional; 12 | 13 | import org.springframework.jms.core.JmsTemplate; 14 | import org.springframework.stereotype.Service; 15 | 16 | @Service 17 | @Transactional 18 | public class AccountService { 19 | 20 | private final JmsTemplate jmsTemplate; 21 | 22 | private final AccountRepository accountRepository; 23 | 24 | public AccountService(JmsTemplate jmsTemplate, AccountRepository accountRepository) { 25 | this.jmsTemplate = jmsTemplate; 26 | this.accountRepository = accountRepository; 27 | } 28 | 29 | public void createAccountAndNotify(String username) { 30 | this.jmsTemplate.convertAndSend("accounts", username); 31 | this.accountRepository.save(new Account(username)); 32 | if ("error".equals(username)) { 33 | throw new RuntimeException("Simulated error"); 34 | } 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3/src/test/java/com/atomikos/spring/AtomikosXAConnectionFactoryWrapperTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import jakarta.jms.ConnectionFactory; 12 | import jakarta.jms.XAConnectionFactory; 13 | 14 | import org.junit.Test; 15 | 16 | import static org.assertj.core.api.Assertions.assertThat; 17 | import static org.mockito.Mockito.mock; 18 | 19 | /** 20 | * Tests for {@link AtomikosXAConnectionFactoryWrapper}. 21 | */ 22 | public class AtomikosXAConnectionFactoryWrapperTestJUnit { 23 | 24 | @Test 25 | public void wrap() { 26 | XAConnectionFactory connectionFactory = mock(XAConnectionFactory.class); 27 | AtomikosXAConnectionFactoryWrapper wrapper = new AtomikosXAConnectionFactoryWrapper(); 28 | ConnectionFactory wrapped = wrapper.wrapConnectionFactory(connectionFactory); 29 | assertThat(wrapped).isInstanceOf(AtomikosConnectionFactoryBean.class); 30 | assertThat(((AtomikosConnectionFactoryBean) wrapped).getXaConnectionFactory()).isSameAs(connectionFactory); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/event/transaction/ParticipantHeuristicEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.event.transaction; 10 | 11 | import com.atomikos.recovery.TxState; 12 | 13 | /** 14 | * Signals heuristic outcome on behalf of a participant. 15 | */ 16 | public class ParticipantHeuristicEvent extends TransactionEvent { 17 | 18 | public final String participantUri; 19 | public final TxState state; 20 | 21 | public ParticipantHeuristicEvent(String transactionId, String participantUri, TxState state) { 22 | super(transactionId); 23 | this.participantUri = participantUri; 24 | this.state = state; 25 | } 26 | 27 | @Override 28 | public String toString() { 29 | StringBuffer ret = new StringBuffer(); 30 | ret.append("Heuristic state detected: ").append(state). 31 | append(" for participant ").append(participantUri). 32 | append(" in transaction: ").append(transactionId). 33 | append(" (HINT: check https://www.atomikos.com/Documentation/HowToHandleHeuristics to learn more on how to handle heuristics...)"); 34 | 35 | return ret.toString(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/finitestates/FSMTransitionListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.finitestates; 10 | 11 | import java.util.EventListener; 12 | 13 | public interface FSMTransitionListener extends EventListener 14 | { 15 | /** 16 | *A method to be called BEFORE the specified transition takes place. 17 | *Since the transition still has to happen, no listener can be sure 18 | *that the event notification eventually leads to the transition. 19 | *This is because the state machine process can fail after the notice, 20 | *or the target state can be prevented somehow. 21 | * 22 | *@param e The transition that will be attempted. 23 | *@exception IllegalStateException on failure. 24 | */ 25 | 26 | public void beforeTransition(FSMTransitionEvent e) 27 | throws IllegalStateException; 28 | 29 | 30 | /** 31 | *A method to be called AFTER the specified transition is done. 32 | * 33 | *@param e The transition that was made. 34 | * 35 | */ 36 | 37 | public void transitionPerformed(FSMTransitionEvent e); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /public/transactions/src/test/java/com/atomikos/finitestates/TestListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.finitestates; 10 | 11 | /** 12 | * 13 | * 14 | *A test listener for FSMImp testing. 15 | */ 16 | 17 | public class TestListener implements FSMEnterListener, 18 | FSMTransitionListener 19 | { 20 | private boolean notified_=false; 21 | 22 | // public TestListener() 23 | // { 24 | // 25 | // } 26 | 27 | public boolean isNotified() 28 | { 29 | return notified_; 30 | } 31 | 32 | public void resetNotified() 33 | { 34 | notified_=false; 35 | } 36 | 37 | public void entered (FSMEnterEvent e) 38 | { 39 | notified_=true; 40 | } 41 | 42 | public void preEnter (FSMEnterEvent e) 43 | { 44 | notified_=true; 45 | } 46 | 47 | public void beforeTransition (FSMTransitionEvent e) 48 | { 49 | notified_=true; 50 | } 51 | 52 | public void transitionPerformed (FSMTransitionEvent e) 53 | { 54 | notified_=true; 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot/src/main/java/com/atomikos/spring/AtomikosDataSourceBeanMetadata.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import org.springframework.boot.jdbc.metadata.AbstractDataSourcePoolMetadata; 12 | 13 | import com.atomikos.jdbc.AtomikosDataSourceBean; 14 | 15 | public class AtomikosDataSourceBeanMetadata extends AbstractDataSourcePoolMetadata { 16 | 17 | 18 | public AtomikosDataSourceBeanMetadata(AtomikosDataSourceBean dataSource) { 19 | super(dataSource); 20 | } 21 | 22 | 23 | @Override 24 | public Integer getActive() { 25 | return getDataSource().poolTotalSize() - getDataSource().poolAvailableSize(); 26 | } 27 | 28 | @Override 29 | public Integer getMax() { 30 | return getDataSource().getMaxPoolSize(); 31 | } 32 | 33 | @Override 34 | public Integer getMin() { 35 | return getDataSource().getMinPoolSize(); 36 | } 37 | 38 | @Override 39 | public String getValidationQuery() { 40 | return getDataSource().getTestQuery(); 41 | } 42 | 43 | @Override 44 | public Boolean getDefaultAutoCommit() { 45 | return false; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3/src/main/java/com/atomikos/spring/AtomikosDataSourceBeanMetadata.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import org.springframework.boot.jdbc.metadata.AbstractDataSourcePoolMetadata; 12 | 13 | import com.atomikos.jdbc.AtomikosDataSourceBean; 14 | 15 | public class AtomikosDataSourceBeanMetadata extends AbstractDataSourcePoolMetadata { 16 | 17 | 18 | public AtomikosDataSourceBeanMetadata(AtomikosDataSourceBean dataSource) { 19 | super(dataSource); 20 | } 21 | 22 | 23 | @Override 24 | public Integer getActive() { 25 | return getDataSource().poolTotalSize() - getDataSource().poolAvailableSize(); 26 | } 27 | 28 | @Override 29 | public Integer getMax() { 30 | return getDataSource().getMaxPoolSize(); 31 | } 32 | 33 | @Override 34 | public Integer getMin() { 35 | return getDataSource().getMinPoolSize(); 36 | } 37 | 38 | @Override 39 | public String getValidationQuery() { 40 | return getDataSource().getTestQuery(); 41 | } 42 | 43 | @Override 44 | public Boolean getDefaultAutoCommit() { 45 | return false; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/icatch/imp/ForgetMessage.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.imp; 10 | 11 | import com.atomikos.icatch.Participant; 12 | 13 | /** 14 | * A forget message implementation. 15 | */ 16 | 17 | class ForgetMessage extends PropagationMessage 18 | { 19 | 20 | ForgetMessage ( Participant p , ForgetResult result ) 21 | { 22 | super ( p , result ); 23 | } 24 | 25 | /** 26 | * A forget message. 27 | * 28 | * @return Object The participant to whom this was sent. 29 | * @exception PropagationException 30 | * Never returned; we don't care now. 31 | */ 32 | 33 | protected Object send () throws PropagationException 34 | { 35 | try { 36 | Participant part = getParticipant (); 37 | part.forget (); 38 | 39 | } catch ( Exception e ) { 40 | } 41 | 42 | return getParticipant (); 43 | } 44 | 45 | public String toString () 46 | { 47 | return ("ForgetMessage to " + getParticipant ()); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/persistence/RecoverableCoordinator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.persistence; 10 | 11 | import com.atomikos.finitestates.FSMEnterEventSource; 12 | import com.atomikos.recovery.PendingTransactionRecord; 13 | import com.atomikos.recovery.TxState; 14 | 15 | /** 16 | * A type of stateful objects whose state is guaranteed to be recoverable. The 17 | * logging is done based on PreEnter events. The guarantee offered is the 18 | * following: IF a recoverable state is reached by the instance, then its image 19 | * is GUARANTEED to be recoverable. The inverse does NOT hold: the fact that an 20 | * object is recovered in some state does NOT mean that the state was reached. 21 | * Indeed, other PreEnter listeners may still have prevented the transition in 22 | * the last moment. However, this should not be a real problem; applications 23 | * should take this into account. 24 | */ 25 | 26 | public interface RecoverableCoordinator extends FSMEnterEventSource 27 | { 28 | 29 | PendingTransactionRecord getPendingTransactionRecord(TxState state); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/datasource/xa/session/TerminatedStateHandler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource.xa.session; 10 | 11 | import com.atomikos.icatch.CompositeTransaction; 12 | import com.atomikos.logging.Logger; 13 | import com.atomikos.logging.LoggerFactory; 14 | 15 | class TerminatedStateHandler 16 | extends TransactionContextStateHandler 17 | { 18 | private static final Logger LOGGER = LoggerFactory.createLogger(TerminatedStateHandler.class); 19 | 20 | TerminatedStateHandler() 21 | { 22 | super ( null , null ); 23 | } 24 | 25 | TransactionContextStateHandler checkEnlistBeforeUse ( CompositeTransaction ct) throws InvalidSessionHandleStateException 26 | { 27 | String msg = "Detected illegal attempt to use a terminated XA session"; 28 | LOGGER.logError ( msg ); 29 | throw new InvalidSessionHandleStateException ( msg ); 30 | } 31 | 32 | TransactionContextStateHandler sessionClosed() 33 | { 34 | return null; 35 | } 36 | 37 | TransactionContextStateHandler transactionTerminated ( CompositeTransaction ct ) 38 | { 39 | return null; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot/src/main/java/com/atomikos/spring/AtomikosNonXADataSourceBeanMetadata.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import org.springframework.boot.jdbc.metadata.AbstractDataSourcePoolMetadata; 12 | 13 | import com.atomikos.jdbc.AtomikosNonXADataSourceBean; 14 | 15 | public class AtomikosNonXADataSourceBeanMetadata extends AbstractDataSourcePoolMetadata { 16 | 17 | 18 | public AtomikosNonXADataSourceBeanMetadata(AtomikosNonXADataSourceBean dataSource) { 19 | super(dataSource); 20 | } 21 | 22 | 23 | @Override 24 | public Integer getActive() { 25 | return getDataSource().poolTotalSize() - getDataSource().poolAvailableSize(); 26 | } 27 | 28 | @Override 29 | public Integer getMax() { 30 | return getDataSource().getMaxPoolSize(); 31 | } 32 | 33 | @Override 34 | public Integer getMin() { 35 | return getDataSource().getMinPoolSize(); 36 | } 37 | 38 | @Override 39 | public String getValidationQuery() { 40 | return getDataSource().getTestQuery(); 41 | } 42 | 43 | @Override 44 | public Boolean getDefaultAutoCommit() { 45 | return false; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3/src/main/java/com/atomikos/spring/AtomikosNonXADataSourceBeanMetadata.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import org.springframework.boot.jdbc.metadata.AbstractDataSourcePoolMetadata; 12 | 13 | import com.atomikos.jdbc.AtomikosNonXADataSourceBean; 14 | 15 | public class AtomikosNonXADataSourceBeanMetadata extends AbstractDataSourcePoolMetadata { 16 | 17 | 18 | public AtomikosNonXADataSourceBeanMetadata(AtomikosNonXADataSourceBean dataSource) { 19 | super(dataSource); 20 | } 21 | 22 | 23 | @Override 24 | public Integer getActive() { 25 | return getDataSource().poolTotalSize() - getDataSource().poolAvailableSize(); 26 | } 27 | 28 | @Override 29 | public Integer getMax() { 30 | return getDataSource().getMaxPoolSize(); 31 | } 32 | 33 | @Override 34 | public Integer getMin() { 35 | return getDataSource().getMinPoolSize(); 36 | } 37 | 38 | @Override 39 | public String getValidationQuery() { 40 | return getDataSource().getTestQuery(); 41 | } 42 | 43 | @Override 44 | public Boolean getDefaultAutoCommit() { 45 | return false; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /public/transactions-hibernate2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | com.atomikos 6 | ate 7 | 6.0.1-SNAPSHOT 8 | 9 | transactions-hibernate2 10 | Transactions Hibernate2 11 | 12 | 13 | com.atomikos 14 | transactions-jta 15 | 6.0.1-SNAPSHOT 16 | 17 | 18 | net.sf.hibernate 19 | hibernate 20 | 2.1.8 21 | provided 22 | 23 | 24 | org.apache.geronimo.specs 25 | geronimo-jta_1.0.1B_spec 26 | 1.0 27 | provided 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /public/transactions/src/test/java/com/atomikos/persistence/imp/LogFileLockTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.persistence.imp; 10 | 11 | import java.io.File; 12 | 13 | import org.junit.After; 14 | import org.junit.Before; 15 | import org.junit.Test; 16 | 17 | import com.atomikos.recovery.LogException; 18 | 19 | 20 | public class LogFileLockTestJUnit { 21 | 22 | private LogFileLock lock; 23 | 24 | @Before 25 | public void setUp() throws Exception { 26 | lock = new LogFileLock("." + File.separatorChar, "LogFileLockTest"); 27 | } 28 | 29 | @After 30 | public void tearDown() throws Exception { 31 | if (lock != null) lock.releaseLock(); 32 | } 33 | 34 | @Test 35 | public void testLockWorksForFirstAcquisition() throws LogException { 36 | lock.acquireLock(); 37 | } 38 | 39 | @Test(expected=LogException.class) 40 | public void testLockFailsForSecondAcquisition() throws LogException { 41 | lock.acquireLock(); 42 | lock.acquireLock(); 43 | } 44 | 45 | @Test 46 | public void testLockWorksAfterAcquisitionAndRelease() throws LogException { 47 | lock.acquireLock(); 48 | lock.releaseLock(); 49 | lock.acquireLock(); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /public/util/src/main/java/com/atomikos/util/Atomikos.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.util; 10 | 11 | import java.io.InputStream; 12 | import java.util.Properties; 13 | 14 | import com.atomikos.logging.Logger; 15 | import com.atomikos.logging.LoggerFactory; 16 | 17 | public final class Atomikos { 18 | final private static Logger LOGGER = LoggerFactory.createLogger(Atomikos.class); 19 | 20 | private Atomikos() { 21 | //Nobody can load me !!! 22 | } 23 | public final static String VERSION = loadVersion(); 24 | 25 | private static String loadVersion() { 26 | final Properties properties = new Properties(); 27 | try { 28 | InputStream inStream = Atomikos.class.getClassLoader().getResourceAsStream("META-INF/maven/com.atomikos/atomikos-util/pom.properties"); 29 | properties.load(inStream); 30 | } catch (Exception e) { 31 | LOGGER.logWarning("Unable to load version.properties using Util.class.getClassLoader().getResourceAsStream(...)", e); 32 | return "UNKNOWN"; 33 | } 34 | 35 | return properties.getProperty("version"); 36 | } 37 | 38 | public static boolean isEvaluationVersion() { 39 | return VERSION.endsWith(".EVAL"); 40 | } 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /public/spring-boot2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.atomikos 5 | ate 6 | 6.0.1-SNAPSHOT 7 | 8 | spring-boot2 9 | pom 10 | 11 | 2.3.4.RELEASE 12 | 13 | 14 | transactions-spring-boot 15 | transactions-spring-boot-starter 16 | transactions-spring-boot-integration-tests 17 | 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-dependencies 23 | pom 24 | import 25 | ${boot.version} 26 | 27 | 28 | 29 | 30 | 31 | org.mockito 32 | mockito-core 33 | 4.4.0 34 | test 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/config/UserTransactionService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.config; 10 | import java.util.Properties; 11 | 12 | import com.atomikos.datasource.RecoverableResource; 13 | import com.atomikos.icatch.CompositeTransactionManager; 14 | import com.atomikos.icatch.SysException; 15 | import com.atomikos.icatch.TransactionServicePlugin; 16 | 17 | /** 18 | * 19 | * The user's (client program) view of the transaction manager's configuration, 20 | * with all the information the client program needs. 21 | * 22 | */ 23 | 24 | public interface UserTransactionService 25 | { 26 | void shutdown(boolean force) throws IllegalStateException; 27 | 28 | void registerResource ( RecoverableResource resource ); 29 | 30 | void removeResource ( RecoverableResource res ); 31 | 32 | void registerTransactionServicePlugin ( TransactionServicePlugin listener ); 33 | 34 | void removeTransactionServicePlugin ( TransactionServicePlugin listener ); 35 | 36 | void init ( Properties properties ) throws SysException; 37 | 38 | void init() throws SysException; 39 | 40 | CompositeTransactionManager getCompositeTransactionManager(); 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /public/transactions-remoting/src/main/java/com/atomikos/remoting/taas/RestTransactionService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.remoting.taas; 10 | 11 | import javax.ws.rs.Consumes; 12 | import javax.ws.rs.POST; 13 | import javax.ws.rs.Path; 14 | import javax.ws.rs.Produces; 15 | import javax.ws.rs.QueryParam; 16 | 17 | import com.atomikos.icatch.HeurHazardException; 18 | import com.atomikos.icatch.HeurMixedException; 19 | import com.atomikos.icatch.HeurRollbackException; 20 | import com.atomikos.icatch.RollbackException; 21 | import com.atomikos.remoting.support.HeaderNames; 22 | 23 | @Path("atomikos") 24 | @Produces(HeaderNames.MimeType.APPLICATION_VND_ATOMIKOS_JSON) 25 | @Consumes(HeaderNames.MimeType.APPLICATION_VND_ATOMIKOS_JSON) 26 | public interface RestTransactionService { 27 | 28 | @POST 29 | @Path("/begin") 30 | String begin(@QueryParam("timeout") Long timeout); 31 | 32 | @POST 33 | @Path("/commit") 34 | void commit(String... extents) 35 | throws HeurRollbackException, HeurMixedException, 36 | HeurHazardException, RollbackException; 37 | 38 | @POST 39 | @Path("/rollback") 40 | void rollback(String... extents) 41 | throws HeurRollbackException, HeurMixedException, 42 | HeurHazardException, RollbackException; 43 | 44 | } -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/TransactionServicePlugin.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch; 10 | 11 | 12 | /** 13 | * A plugin interface for transaction service extension modules. 14 | * Instances can register themselves via the ServiceLoader mechanism 15 | * in order to be notified about startup and shutdown events. 16 | */ 17 | 18 | public interface TransactionServicePlugin 19 | { 20 | /** 21 | * Called before initialization of the transaction core. 22 | * 23 | * 24 | * DISCLAIMER: only implementations that register with the ServiceLoader 25 | * mechanism are sure of receiving this notification. Other implementations 26 | * should be aware that the transaction core may already be running by the 27 | * time they register - in which case there will be no callback. 28 | * 29 | */ 30 | 31 | void beforeInit(); 32 | 33 | /** 34 | * Called after initialization of the transaction core. 35 | */ 36 | 37 | void afterInit(); 38 | 39 | /** 40 | * Called after shutdown of the transaction core. 41 | */ 42 | 43 | void afterShutdown(); 44 | } 45 | -------------------------------------------------------------------------------- /public/transactions/src/test/java/com/atomikos/icatch/imp/SysExceptionTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.imp; 10 | 11 | import com.atomikos.icatch.SysException; 12 | 13 | import junit.framework.TestCase; 14 | 15 | public class SysExceptionTestJUnit extends TestCase 16 | { 17 | 18 | public void testSysExceptionWithoutNestedErrors() 19 | { 20 | SysException se = new SysException ( "" ); 21 | StackTraceElement[] st = se.getStackTrace(); 22 | assertNotNull ( st ); 23 | assertFalse ( st.length == 0 ); 24 | } 25 | 26 | public void testSysExceptionWithNestedException() 27 | { 28 | Exception exception = new Exception ( ); 29 | exception.fillInStackTrace(); 30 | SysException se = new SysException ( null , exception ); 31 | StackTraceElement[] st = se.getStackTrace(); 32 | assertNotNull ( st ); 33 | assertFalse ( st.length == 0 ); 34 | } 35 | 36 | public void testSysExceptionWithNestedSysException() 37 | { 38 | Exception exception = new SysException ( "test" ); 39 | exception.fillInStackTrace(); 40 | SysException se = new SysException (null , exception ); 41 | StackTraceElement[] st = se.getStackTrace(); 42 | assertNotNull ( st ); 43 | assertFalse ( st.length == 0 ); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot/src/test/java/com/atomikos/spring/AtomikosDataSourceBeanTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import org.junit.Test; 12 | 13 | import static org.assertj.core.api.Assertions.assertThat; 14 | import static org.mockito.Mockito.never; 15 | import static org.mockito.Mockito.spy; 16 | import static org.mockito.Mockito.verify; 17 | 18 | /** 19 | * Tests for {@link AtomikosDataSourceBean}. 20 | */ 21 | public class AtomikosDataSourceBeanTestJUnit { 22 | 23 | @Test 24 | public void beanMethods() throws Exception { 25 | MockAtomikosDataSourceBean bean = spy(new MockAtomikosDataSourceBean()); 26 | bean.setBeanName("bean"); 27 | bean.afterPropertiesSet(); 28 | assertThat(bean.getUniqueResourceName()).isEqualTo("bean"); 29 | verify(bean).init(); 30 | verify(bean, never()).close(); 31 | bean.destroy(); 32 | verify(bean).close(); 33 | } 34 | 35 | @SuppressWarnings("serial") 36 | static class MockAtomikosDataSourceBean extends AtomikosDataSourceBean { 37 | 38 | @Override 39 | public synchronized void init() { 40 | } 41 | 42 | @Override 43 | public void close() { 44 | } 45 | 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3/src/test/java/com/atomikos/spring/AtomikosDataSourceBeanTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import org.junit.Test; 12 | 13 | import static org.assertj.core.api.Assertions.assertThat; 14 | import static org.mockito.Mockito.never; 15 | import static org.mockito.Mockito.spy; 16 | import static org.mockito.Mockito.verify; 17 | 18 | /** 19 | * Tests for {@link AtomikosDataSourceBean}. 20 | */ 21 | public class AtomikosDataSourceBeanTestJUnit { 22 | 23 | @Test 24 | public void beanMethods() throws Exception { 25 | MockAtomikosDataSourceBean bean = spy(new MockAtomikosDataSourceBean()); 26 | bean.setBeanName("bean"); 27 | bean.afterPropertiesSet(); 28 | assertThat(bean.getUniqueResourceName()).isEqualTo("bean"); 29 | verify(bean).init(); 30 | verify(bean, never()).close(); 31 | bean.destroy(); 32 | verify(bean).close(); 33 | } 34 | 35 | @SuppressWarnings("serial") 36 | static class MockAtomikosDataSourceBean extends AtomikosDataSourceBean { 37 | 38 | @Override 39 | public synchronized void init() { 40 | } 41 | 42 | @Override 43 | public void close() { 44 | } 45 | 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/icatch/jta/template/RequiresNewTemplate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.jta.template; 10 | 11 | import java.lang.reflect.UndeclaredThrowableException; 12 | import java.util.concurrent.Callable; 13 | 14 | import javax.transaction.Transaction; 15 | import javax.transaction.TransactionManager; 16 | class RequiresNewTemplate extends TransactionTemplate { 17 | 18 | 19 | public RequiresNewTemplate(TransactionManager utm, int timeout) { 20 | super(utm, timeout); 21 | } 22 | 23 | public T execute(Callable work) throws Exception { 24 | T ret = null; 25 | Transaction suspendedTransaction = null; 26 | try { 27 | suspendedTransaction = utm.suspend(); 28 | beginTransaction(); 29 | ret = work.call(); 30 | utm.commit(); 31 | } catch (Exception e) { 32 | utm.rollback(); 33 | throw e; 34 | } catch (Throwable e) { 35 | utm.rollback(); 36 | throw new UndeclaredThrowableException(e); 37 | } finally { 38 | if (suspendedTransaction != null) { 39 | utm.resume(suspendedTransaction); 40 | } 41 | } 42 | return ret; 43 | } 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot-integration-tests/src/main/java/com/atomikos/spring/integrationtest/SampleAtomikosApplication.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring.integrationtest; 10 | 11 | import java.io.Closeable; 12 | 13 | import org.springframework.boot.SpringApplication; 14 | import org.springframework.boot.autoconfigure.SpringBootApplication; 15 | import org.springframework.context.ApplicationContext; 16 | 17 | @SpringBootApplication 18 | public class SampleAtomikosApplication { 19 | 20 | public static void main(String... args) throws Exception { 21 | ApplicationContext context = SpringApplication.run(SampleAtomikosApplication.class, args); 22 | AccountService service = context.getBean(AccountService.class); 23 | AccountRepository repository = context.getBean(AccountRepository.class); 24 | service.createAccountAndNotify("josh"); 25 | System.out.println("Count is " + repository.count()); 26 | try { 27 | service.createAccountAndNotify("error"); 28 | } 29 | catch (Exception ex) { 30 | System.out.println(ex.getMessage()); 31 | } 32 | System.out.println("Count is " + repository.count()); 33 | Thread.sleep(100); 34 | ((Closeable) context).close(); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3-integration-tests/src/main/java/com/atomikos/spring/integrationtest/SampleAtomikosApplication.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring.integrationtest; 10 | 11 | import java.io.Closeable; 12 | 13 | import org.springframework.boot.SpringApplication; 14 | import org.springframework.boot.autoconfigure.SpringBootApplication; 15 | import org.springframework.context.ApplicationContext; 16 | 17 | @SpringBootApplication 18 | public class SampleAtomikosApplication { 19 | 20 | public static void main(String... args) throws Exception { 21 | ApplicationContext context = SpringApplication.run(SampleAtomikosApplication.class, args); 22 | AccountService service = context.getBean(AccountService.class); 23 | AccountRepository repository = context.getBean(AccountRepository.class); 24 | service.createAccountAndNotify("josh"); 25 | System.out.println("Count is " + repository.count()); 26 | try { 27 | service.createAccountAndNotify("error"); 28 | } 29 | catch (Exception ex) { 30 | System.out.println(ex.getMessage()); 31 | } 32 | System.out.println("Count is " + repository.count()); 33 | Thread.sleep(100); 34 | ((Closeable) context).close(); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /public/transactions/src/test/resources/transactions-defaults.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2000-2024 Atomikos 3 | # 4 | # LICENSE CONDITIONS 5 | # 6 | # See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | # 8 | 9 | com.atomikos.icatch.enable_logging=true 10 | com.atomikos.icatch.force_shutdown_on_vm_exit=false 11 | com.atomikos.icatch.checkpoint_interval=500 12 | com.atomikos.icatch.serial_jta_transactions=true 13 | com.atomikos.icatch.default_jta_timeout=10000 14 | com.atomikos.icatch.max_timeout=300000 15 | com.atomikos.icatch.log_base_dir=./ 16 | com.atomikos.icatch.threaded_2pc=false 17 | com.atomikos.icatch.max_actives=50 18 | com.atomikos.icatch.log_base_name=tmlog 19 | java.naming.factory.initial=com.sun.jndi.rmi.registry.RegistryContextFactory 20 | com.atomikos.icatch.client_demarcation=false 21 | java.naming.provider.url=rmi://localhost:1099 22 | com.atomikos.icatch.rmi_export_class=none 23 | com.atomikos.icatch.trust_client_tm=false 24 | com.atomikos.icatch.forget_orphaned_log_entries_delay=1800000 25 | com.atomikos.icatch.recovery_delay=${com.atomikos.icatch.default_jta_timeout} 26 | com.atomikos.icatch.oltp_max_retries=5 27 | com.atomikos.icatch.oltp_retry_interval=10000 28 | com.atomikos.icatch.allow_subtransactions=true 29 | com.atomikos.icatch.log_lock_acquisition_max_attempts=3 30 | com.atomikos.icatch.log_lock_acquisition_retry_delay=1000 31 | 32 | com.atomikos.icatch.default.to.override.by.jta=default 33 | com.atomikos.icatch.default.to.override.by.transactions=default -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot/src/test/java/com/atomikos/spring/AtomikosConnectionFactoryBeanTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import org.junit.Test; 12 | 13 | import static org.assertj.core.api.Assertions.assertThat; 14 | import static org.mockito.Mockito.never; 15 | import static org.mockito.Mockito.spy; 16 | import static org.mockito.Mockito.verify; 17 | 18 | /** 19 | * Tests for {@link AtomikosConnectionFactoryBean}. 20 | */ 21 | public class AtomikosConnectionFactoryBeanTestJUnit { 22 | 23 | @Test 24 | public void beanMethods() throws Exception { 25 | MockAtomikosConnectionFactoryBean bean = spy(new MockAtomikosConnectionFactoryBean()); 26 | bean.setBeanName("bean"); 27 | bean.afterPropertiesSet(); 28 | assertThat(bean.getUniqueResourceName()).isEqualTo("bean"); 29 | verify(bean).init(); 30 | verify(bean, never()).close(); 31 | bean.destroy(); 32 | verify(bean).close(); 33 | } 34 | 35 | @SuppressWarnings("serial") 36 | static class MockAtomikosConnectionFactoryBean extends AtomikosConnectionFactoryBean { 37 | 38 | @Override 39 | public synchronized void init() { 40 | } 41 | 42 | @Override 43 | public synchronized void close() { 44 | } 45 | 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3/src/test/java/com/atomikos/spring/AtomikosConnectionFactoryBeanTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import org.junit.Test; 12 | 13 | import static org.assertj.core.api.Assertions.assertThat; 14 | import static org.mockito.Mockito.never; 15 | import static org.mockito.Mockito.spy; 16 | import static org.mockito.Mockito.verify; 17 | 18 | /** 19 | * Tests for {@link AtomikosConnectionFactoryBean}. 20 | */ 21 | public class AtomikosConnectionFactoryBeanTestJUnit { 22 | 23 | @Test 24 | public void beanMethods() throws Exception { 25 | MockAtomikosConnectionFactoryBean bean = spy(new MockAtomikosConnectionFactoryBean()); 26 | bean.setBeanName("bean"); 27 | bean.afterPropertiesSet(); 28 | assertThat(bean.getUniqueResourceName()).isEqualTo("bean"); 29 | verify(bean).init(); 30 | verify(bean, never()).close(); 31 | bean.destroy(); 32 | verify(bean).close(); 33 | } 34 | 35 | @SuppressWarnings("serial") 36 | static class MockAtomikosConnectionFactoryBean extends AtomikosConnectionFactoryBean { 37 | 38 | @Override 39 | public synchronized void init() { 40 | } 41 | 42 | @Override 43 | public synchronized void close() { 44 | } 45 | 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /public/transactions-jdbc/src/main/java/com/atomikos/jdbc/internal/JdbcConnectionProxyHelper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.jdbc.internal; 10 | 11 | import java.sql.Connection; 12 | import java.sql.SQLException; 13 | 14 | import com.atomikos.datasource.pool.CreateConnectionException; 15 | import com.atomikos.logging.Logger; 16 | import com.atomikos.logging.LoggerFactory; 17 | 18 | public class JdbcConnectionProxyHelper { 19 | private static final Logger LOGGER = LoggerFactory.createLogger(JdbcConnectionProxyHelper.class); 20 | 21 | 22 | public static void setIsolationLevel ( Connection connection , int defaultIsolationLevel ) 23 | throws CreateConnectionException 24 | { 25 | 26 | if (defaultIsolationLevel < 0) 27 | return; 28 | 29 | try { 30 | if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( "setting isolation level to " + defaultIsolationLevel); 31 | connection.setTransactionIsolation ( defaultIsolationLevel ); 32 | } 33 | catch (SQLException ex) { 34 | LOGGER.logWarning ( "cannot set isolation level to " + defaultIsolationLevel, ex); 35 | throw new CreateConnectionException ( "The configured default isolation level " + defaultIsolationLevel + 36 | " seems unsupported by the driver - please check your JDBC driver documentation?" , ex ); 37 | } 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/RecoveryService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch; 10 | 11 | import com.atomikos.recovery.RecoveryLog; 12 | 13 | 14 | /** 15 | * A handle to the TM that resources can use to recover. 16 | */ 17 | 18 | public interface RecoveryService 19 | { 20 | 21 | /** 22 | * @return String The unique name of the TM. Resources can use this name to determine what resource 23 | * transactions need to be considered for recovery by this 24 | * transaction service. 25 | */ 26 | 27 | String getName(); 28 | 29 | 30 | RecoveryLog getRecoveryLog(); 31 | 32 | /** 33 | * Instructs the core to do a full recovery cycle. 34 | * 35 | * @return False if no recovery was done, 36 | * for instance if this node is not responsible for recovery 37 | * or if there was a concurrent shutdown. 38 | */ 39 | boolean performRecovery(); 40 | 41 | /** 42 | * Asks the core to do a full recovery cycle. 43 | * 44 | * @param lax True to allow for lax optimisation 45 | * so the actual overhead of recovery can be avoided in 46 | * some cases. Depending on your deployment, lax mode 47 | * may be accurate (or not). 48 | * 49 | * @return False if no recovery was done. 50 | */ 51 | boolean performRecovery(boolean lax); 52 | } 53 | -------------------------------------------------------------------------------- /public/transactions-jndi-provider/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.atomikos 5 | ate 6 | 6.0.1-SNAPSHOT 7 | 8 | transactions-jndi-provider 9 | 10 | false 11 | 12 | 13 | 14 | 15 | com.atomikos 16 | transactions-jta 17 | 6.0.1-SNAPSHOT 18 | provided 19 | 20 | 21 | com.atomikos 22 | transactions-jdbc 23 | 6.0.1-SNAPSHOT 24 | test 25 | 26 | 27 | jakarta.jms 28 | jakarta.jms-api 29 | 2.0.3 30 | provided 31 | 32 | 33 | org.apache.geronimo.specs 34 | geronimo-jta_1.0.1B_spec 35 | 1.0 36 | test 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot/src/main/java/com/atomikos/spring/AtomikosDataSourceBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import org.springframework.beans.factory.BeanNameAware; 12 | import org.springframework.beans.factory.DisposableBean; 13 | import org.springframework.beans.factory.InitializingBean; 14 | import org.springframework.boot.context.properties.ConfigurationProperties; 15 | import org.springframework.util.StringUtils; 16 | 17 | /** 18 | * Spring friendly version of {@link com.atomikos.jdbc.AtomikosDataSourceBean}. 19 | */ 20 | @SuppressWarnings("serial") 21 | @ConfigurationProperties(prefix = "spring.jta.atomikos.datasource") 22 | public class AtomikosDataSourceBean extends com.atomikos.jdbc.AtomikosDataSourceBean 23 | implements BeanNameAware, InitializingBean, DisposableBean { 24 | 25 | private String beanName; 26 | 27 | @Override 28 | public void setBeanName(String name) { 29 | this.beanName = name; 30 | } 31 | 32 | @Override 33 | public void afterPropertiesSet() throws Exception { 34 | if (!StringUtils.hasLength(getUniqueResourceName())) { 35 | setUniqueResourceName(this.beanName); 36 | } 37 | init(); 38 | } 39 | 40 | @Override 41 | public void destroy() throws Exception { 42 | close(); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3/src/main/java/com/atomikos/spring/AtomikosDataSourceBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import org.springframework.beans.factory.BeanNameAware; 12 | import org.springframework.beans.factory.DisposableBean; 13 | import org.springframework.beans.factory.InitializingBean; 14 | import org.springframework.boot.context.properties.ConfigurationProperties; 15 | import org.springframework.util.StringUtils; 16 | 17 | /** 18 | * Spring friendly version of {@link com.atomikos.jdbc.AtomikosDataSourceBean}. 19 | */ 20 | @SuppressWarnings("serial") 21 | @ConfigurationProperties(prefix = "spring.jta.atomikos.datasource") 22 | public class AtomikosDataSourceBean extends com.atomikos.jdbc.AtomikosDataSourceBean 23 | implements BeanNameAware, InitializingBean, DisposableBean { 24 | 25 | private String beanName; 26 | 27 | @Override 28 | public void setBeanName(String name) { 29 | this.beanName = name; 30 | } 31 | 32 | @Override 33 | public void afterPropertiesSet() throws Exception { 34 | if (!StringUtils.hasLength(getUniqueResourceName())) { 35 | setUniqueResourceName(this.beanName); 36 | } 37 | init(); 38 | } 39 | 40 | @Override 41 | public void destroy() throws Exception { 42 | close(); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /public/transactions-jms/src/main/java/com/atomikos/jms/SessionCreationMode.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.jms; 10 | 11 | /** 12 | * Constant values to indicate / tune the behavior in terms of JMS session creation 13 | * (i.e., under what conditions to create XA sessions vs local sessions), 14 | * so you can control backwards compatibility of your configuration. 15 | * 16 | * For historical reasons there have been several different interpretations 17 | * of the JMS session creation semantics, mainly due to unclear JMS specifications. 18 | */ 19 | 20 | public final class SessionCreationMode { 21 | 22 | static final void assertValidityOf(int value) { 23 | if (value < 0 || value > 2) { 24 | throw new IllegalArgumentException("The specified value should be between 0 and 2"); 25 | } 26 | } 27 | 28 | /** 29 | * JMS session creation like in Atomikos releases prior to 3.9. 30 | */ 31 | 32 | public static int PRE_3_9 = 0; 33 | 34 | /** 35 | * JMS session creation like in Atomikos releases [3.9-6.0). 36 | */ 37 | 38 | public static int PRE_6_0 = 1; 39 | 40 | /** 41 | * As of Atomikos release 6.0, this is the default: 42 | * JMS session creation along the clarified JMS 2.0 specification guidelines, 43 | * see https://jakarta.ee/specifications/messaging/2.0/apidocs/ for details. 44 | */ 45 | 46 | public static int JMS_2_0 = 2; 47 | } -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot/src/main/java/com/atomikos/spring/AtomikosConnectionFactoryBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import org.springframework.beans.factory.BeanNameAware; 12 | import org.springframework.beans.factory.DisposableBean; 13 | import org.springframework.beans.factory.InitializingBean; 14 | import org.springframework.boot.context.properties.ConfigurationProperties; 15 | import org.springframework.util.StringUtils; 16 | 17 | /** 18 | * Spring friendly version of {@link com.atomikos.jms.AtomikosConnectionFactoryBean}. 19 | */ 20 | @SuppressWarnings("serial") 21 | @ConfigurationProperties(prefix = "spring.jta.atomikos.connectionfactory") 22 | public class AtomikosConnectionFactoryBean extends com.atomikos.jms.AtomikosConnectionFactoryBean 23 | implements BeanNameAware, InitializingBean, DisposableBean { 24 | 25 | private String beanName; 26 | 27 | @Override 28 | public void setBeanName(String name) { 29 | this.beanName = name; 30 | } 31 | 32 | @Override 33 | public void afterPropertiesSet() throws Exception { 34 | if (!StringUtils.hasLength(getUniqueResourceName())) { 35 | setUniqueResourceName(this.beanName); 36 | } 37 | init(); 38 | } 39 | 40 | @Override 41 | public void destroy() throws Exception { 42 | close(); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3/src/main/java/com/atomikos/spring/AtomikosConnectionFactoryBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import org.springframework.beans.factory.BeanNameAware; 12 | import org.springframework.beans.factory.DisposableBean; 13 | import org.springframework.beans.factory.InitializingBean; 14 | import org.springframework.boot.context.properties.ConfigurationProperties; 15 | import org.springframework.util.StringUtils; 16 | 17 | /** 18 | * Spring friendly version of {@link com.atomikos.jms.AtomikosConnectionFactoryBean}. 19 | */ 20 | @SuppressWarnings("serial") 21 | @ConfigurationProperties(prefix = "spring.jta.atomikos.connectionfactory") 22 | public class AtomikosConnectionFactoryBean extends com.atomikos.jms.AtomikosConnectionFactoryBean 23 | implements BeanNameAware, InitializingBean, DisposableBean { 24 | 25 | private String beanName; 26 | 27 | @Override 28 | public void setBeanName(String name) { 29 | this.beanName = name; 30 | } 31 | 32 | @Override 33 | public void afterPropertiesSet() throws Exception { 34 | if (!StringUtils.hasLength(getUniqueResourceName())) { 35 | setUniqueResourceName(this.beanName); 36 | } 37 | init(); 38 | } 39 | 40 | @Override 41 | public void destroy() throws Exception { 42 | close(); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/event/transaction/TransactionHeuristicEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.event.transaction; 10 | 11 | import com.atomikos.recovery.TxState; 12 | 13 | /** 14 | * Event to signal a heuristic outcome. 15 | * 16 | */ 17 | 18 | public class TransactionHeuristicEvent extends TransactionEvent { 19 | 20 | public final String parentTransactionId; 21 | public final TxState state; 22 | 23 | public TransactionHeuristicEvent(String transactionId, String parentTransactionId, TxState state) { 24 | super(transactionId); 25 | this.parentTransactionId = parentTransactionId; 26 | this.state = state; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | StringBuffer ret = new StringBuffer(); 32 | ret.append("Detected state: ").append(state). 33 | append(" for transaction ").append(transactionId); 34 | if (parentTransactionId != null) { 35 | ret.append(" with parent transaction ").append(parentTransactionId); 36 | } 37 | if (state.isHeuristic()) { 38 | ret.append(" (HINT: check https://www.atomikos.com/Documentation/HowToHandleHeuristics to learn more on how to handle heuristics...)"); 39 | } 40 | 41 | return ret.toString(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/datasource/xa/ResourceTransactionSuspender.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource.xa; 10 | 11 | import com.atomikos.icatch.CompositeTransaction; 12 | import com.atomikos.icatch.SubTxAwareParticipant; 13 | import com.atomikos.logging.Logger; 14 | import com.atomikos.logging.LoggerFactory; 15 | 16 | class ResourceTransactionSuspender implements SubTxAwareParticipant { 17 | 18 | private static Logger LOGGER = LoggerFactory.createLogger(ResourceTransactionSuspender.class); 19 | 20 | private XAResourceTransaction branch; 21 | 22 | ResourceTransactionSuspender(XAResourceTransaction branch) { 23 | this.branch = branch; 24 | } 25 | 26 | @Override 27 | public void committed(CompositeTransaction transaction) { 28 | try { 29 | branch.suspend(); 30 | } catch (Exception e) { 31 | LOGGER.logDebug("Unexpected exception while trying to suspend the branch: ", e); 32 | //ignore: just a courtesy 33 | } 34 | } 35 | 36 | @Override 37 | public void rolledback(CompositeTransaction transaction) { 38 | try { 39 | branch.suspend(); 40 | } catch (Exception e) { 41 | LOGGER.logDebug("Unexpected exception while trying to suspend the branch: ", e); 42 | //ignore: just a courtesy 43 | } 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | name: Java CI with Maven 2 | 'on': 3 | push: 4 | branches: 5 | - master 6 | pull_request: 7 | branches: 8 | - master 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v4 14 | - name: Set up JDK 8 15 | uses: actions/setup-java@v3 16 | with: 17 | java-version: '8' 18 | distribution: temurin 19 | cache: maven 20 | - name: Install Toolchain JDK 21 | uses: battila7/jdk-via-jabba@v1 22 | with: 23 | jdk: openjdk-ri@1.17.0 24 | javaHomeEnvironmentVariable: JDK_17 25 | - name: Set up Toolchain 26 | shell: bash 27 | run: | 28 | mkdir -p $HOME/.m2 \ 29 | && cat << EOF > $HOME/.m2/toolchains.xml 30 | 31 | 32 | 33 | jdk 34 | 35 | 17 36 | adopt 37 | 38 | 39 | ${{ env.JDK_17 }} 40 | 41 | 42 | 43 | EOF 44 | - name: Build with Maven 45 | run: mvn -B install --file pom.xml -Popensource 46 | # - name: Update dependency graph 47 | # uses: >- 48 | # advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 49 | -------------------------------------------------------------------------------- /public/util/src/main/java/com/atomikos/beans/PropertyException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.beans; 10 | 11 | /** 12 | * 13 | * 14 | *An exception indicating a failure to set or get a bean property. 15 | */ 16 | 17 | public class PropertyException 18 | extends Exception 19 | { 20 | private Throwable nested_; 21 | //the nested exception 22 | 23 | 24 | public PropertyException ( String msg ) { 25 | super ( msg ); 26 | } 27 | /** 28 | *Creates a new instance with a nested exception. 29 | *@param nested The nested exception. 30 | */ 31 | 32 | public PropertyException ( Throwable nested ) 33 | { 34 | this ( null , nested ); 35 | } 36 | 37 | /** 38 | *Creates a new instance with a message and nested exception. 39 | *@param msg The message. 40 | *@param nested The nested exception. 41 | */ 42 | 43 | public PropertyException ( String msg , Throwable nested ) 44 | { 45 | super ( msg ); 46 | nested_ = nested; 47 | } 48 | 49 | /** 50 | *Get the nested exception. 51 | *@return Exception The nested exception. 52 | */ 53 | 54 | public Throwable getNestedException() 55 | { 56 | return nested_; 57 | } 58 | 59 | public void printStackTrace() 60 | { 61 | if ( nested_ != null ) nested_.printStackTrace(); 62 | super.printStackTrace(); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot-starter/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | com.atomikos 6 | spring-boot2 7 | 6.0.1-SNAPSHOT 8 | 9 | transactions-spring-boot-starter 10 | Transactions Spring Boot Starter 11 | 12 | 13 | com.atomikos 14 | transactions-spring-boot 15 | 6.0.1-SNAPSHOT 16 | 17 | 18 | com.atomikos 19 | transactions-jms 20 | 6.0.1-SNAPSHOT 21 | 22 | 23 | com.atomikos 24 | transactions-jta 25 | 6.0.1-SNAPSHOT 26 | 27 | 28 | com.atomikos 29 | transactions-jdbc 30 | 6.0.1-SNAPSHOT 31 | 32 | 33 | 34 | 35 | 36 | org.apache.maven.plugins 37 | maven-source-plugin 38 | 39 | true 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /public/transactions-jms/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | com.atomikos 6 | ate 7 | 6.0.1-SNAPSHOT 8 | 9 | transactions-jms 10 | Transactions JMS 11 | 12 | false 13 | 14 | 15 | 16 | com.atomikos 17 | transactions-jta 18 | 6.0.1-SNAPSHOT 19 | provided 20 | 21 | 22 | jakarta.jms 23 | jakarta.jms-api 24 | 2.0.3 25 | provided 26 | 27 | 28 | org.apache.geronimo.specs 29 | geronimo-jta_1.0.1B_spec 30 | 1.0 31 | provided 32 | 33 | 34 | org.slf4j 35 | slf4j-simple 36 | 1.4.3 37 | test 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /public/transactions/src/main/java/com/atomikos/finitestates/FSM.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | 10 | //$Id: FSM.java,v 1.1.1.1 2006/08/29 10:01:15 guy Exp $ 11 | //$Log: FSM.java,v $ 12 | //Revision 1.1.1.1 2006/08/29 10:01:15 guy 13 | //Import of 3.0 essentials edition. 14 | // 15 | //Revision 1.1.1.1 2006/04/29 08:55:51 guy 16 | //Initial import. 17 | // 18 | //Revision 1.1.1.1 2006/03/29 13:21:41 guy 19 | //Imported. 20 | // 21 | //Revision 1.1.1.1 2006/03/23 16:25:37 guy 22 | //Imported. 23 | // 24 | //Revision 1.1.1.1 2006/03/22 13:47:03 guy 25 | //Import. 26 | // 27 | //Revision 1.1.1.1 2006/03/09 14:59:43 guy 28 | //Imported 3.0 development into CVS repository. 29 | // 30 | //Revision 1.4 2005/08/09 15:24:57 guy 31 | //Updated javadoc. 32 | // 33 | //Revision 1.3 2004/10/12 13:04:22 guy 34 | //Updated docs (changed Guy Pardon to Atomikos in many places). 35 | // 36 | //Revision 1.2 2002/01/29 11:29:58 guy 37 | //Updated to latest state: repository seemed outdated? 38 | // 39 | //Revision 1.3 2001/03/23 10:50:44 pardon 40 | //Changed Stateful NOT to have setState; this is in StateMutable. 41 | // 42 | //Revision 1.2 2001/03/08 18:18:50 pardon 43 | //Made FSM a real state machine. 44 | // 45 | 46 | package com.atomikos.finitestates; 47 | 48 | 49 | 50 | public interface FSM extends StateMutable, 51 | FSMEnterEventSource, 52 | FSMTransitionEventSource 53 | { 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/icatch/ExportingTransactionManager.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch; 10 | 11 | 12 | /** 13 | * An interface for a TM that allows outgoing remote calls to be transactional. 14 | */ 15 | 16 | public interface ExportingTransactionManager 17 | { 18 | /** 19 | * Gets the propagation info of the transaction for the calling thread. 20 | * Should be called before doing the remote call. 21 | * 22 | * @return Propagation The propagation for the current thread's transaction. 23 | * 24 | * @throws IllegalStateException If no such transaction exists, e.g. after a prior rollback. 25 | * 26 | */ 27 | 28 | Propagation getPropagation() throws SysException, IllegalStateException; 29 | 30 | /** 31 | * Should be called after call returns successfully: 32 | * adds the extent of the call to the current transaction. 33 | * 34 | * If a remote call has failed, this method should NOT be called. 35 | * 36 | * @param extent The extent of the call. 37 | * 38 | * @throws IllegalArgumentException If the format of the supplied extent is not recognized. 39 | * @throws RollbackException If the current transaction has already rolled back. 40 | */ 41 | 42 | 43 | void addExtent(Extent extent) throws SysException, IllegalArgumentException, RollbackException; 44 | } 45 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/icatch/jta/XAResourceKey.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.jta; 10 | 11 | import javax.transaction.xa.XAException; 12 | import javax.transaction.xa.XAResource; 13 | 14 | /** 15 | * Instances of this class can be used to lookup resource transactions in a 16 | * hashtable that uses the XAResource instance for mapping. This is needed 17 | * because otherwise the JTA wouldn't work with XAResource implementations that 18 | * have overridden equals. 19 | * 20 | */ 21 | class XAResourceKey 22 | { 23 | 24 | private XAResource xares; 25 | 26 | public XAResourceKey ( XAResource xares ) 27 | { 28 | super (); 29 | this.xares = xares; 30 | } 31 | 32 | public boolean equals ( Object o ) 33 | { 34 | boolean ret = false; 35 | if ( o instanceof XAResourceKey ) { 36 | XAResourceKey other = (XAResourceKey) o; 37 | try { 38 | ret = (other.xares == xares || other.xares.isSameRM ( xares )); 39 | } catch ( XAException e ) { 40 | // just return false 41 | } 42 | } 43 | 44 | return ret; 45 | } 46 | 47 | public int hashCode () 48 | { 49 | return xares.getClass ().getName ().toString ().hashCode (); 50 | } 51 | 52 | public String toString () 53 | { 54 | return xares.toString (); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /public/transactions-hibernate3/src/main/java/com/atomikos/icatch/jta/hibernate3/TransactionManagerLookup.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.jta.hibernate3; 10 | 11 | import java.util.Properties; 12 | 13 | import javax.transaction.Transaction; 14 | import javax.transaction.TransactionManager; 15 | 16 | import org.hibernate.HibernateException; 17 | 18 | import com.atomikos.icatch.jta.UserTransactionManager; 19 | 20 | /** 21 | * 22 | * 23 | * 24 | * This class is provided for Hibernate3 integration. 25 | * To use Atomikos as the Hibernate JTA transaction manager, 26 | * specify this class as the value of the 27 | * hibernate.transaction.manager_lookup_class of the 28 | * hibernate configuration properties. 29 | * 30 | */ 31 | public class TransactionManagerLookup implements org.hibernate.transaction.TransactionManagerLookup 32 | { 33 | 34 | private UserTransactionManager utm; 35 | 36 | public TransactionManagerLookup() 37 | { 38 | utm = new UserTransactionManager(); 39 | } 40 | 41 | 42 | 43 | public TransactionManager getTransactionManager(Properties props) throws HibernateException 44 | { 45 | return utm; 46 | } 47 | 48 | public String getUserTransactionName() 49 | { 50 | return null; 51 | } 52 | 53 | 54 | // new in Hibernate 3.3 55 | public Object getTransactionIdentifier(Transaction transaction) 56 | { 57 | return transaction; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /public/util/src/test/java/com/atomikos/publish/EventPublisherTestJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.publish; 10 | 11 | import org.junit.Before; 12 | import org.junit.Test; 13 | import org.mockito.Mockito; 14 | 15 | import com.atomikos.icatch.event.Event; 16 | import com.atomikos.icatch.event.EventListener; 17 | import com.atomikos.icatch.event.transaction.ParticipantHeuristicEvent; 18 | 19 | public class EventPublisherTestJUnit { 20 | 21 | private EventListener mock; 22 | private Event event; 23 | 24 | @Before 25 | public void setUp() throws Exception { 26 | event = new ParticipantHeuristicEvent("id", null, null); 27 | mock = Mockito.mock(EventListener.class); 28 | EventPublisher.INSTANCE.registerEventListener(mock); 29 | } 30 | 31 | @Test 32 | public void testPublishNullEventDoesNotThrow() { 33 | EventPublisher.INSTANCE.publish(null); 34 | } 35 | 36 | @Test 37 | public void testPublishNullEventDoesNotNotifyListeners() { 38 | EventPublisher.INSTANCE.publish(null); 39 | Mockito.verify(mock,Mockito.times(0)).eventOccurred((Event) Mockito.any()); 40 | } 41 | 42 | @Test 43 | public void testPublishNotifiesListener() { 44 | EventPublisher.INSTANCE.publish(event); 45 | Mockito.verify(mock,Mockito.times(1)).eventOccurred((Event) Mockito.any()); 46 | } 47 | 48 | 49 | @Test 50 | public void testPublishNotifiesListenerWithSameEvent() { 51 | EventPublisher.INSTANCE.publish(event); 52 | Mockito.verify(mock,Mockito.times(1)).eventOccurred(event); 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /public/transactions-jms/src/main/java/com/atomikos/jms/extra/JmsSenderTemplate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.jms.extra; 10 | 11 | import java.io.Serializable; 12 | import java.util.Map; 13 | 14 | import javax.jms.JMSException; 15 | 16 | /** 17 | * Common interface for JMS send functionality so client can benefit from dependency injection. 18 | */ 19 | public interface JmsSenderTemplate { 20 | 21 | /** 22 | * Executes an application-level call-back within the managed session. 23 | * 24 | * @param callback 25 | * @throws JMSException 26 | */ 27 | void executeCallback(JmsSenderTemplateCallback callback) throws JMSException; 28 | 29 | /** 30 | * Sends a TextMessage. 31 | * 32 | * @param content The text as a string. 33 | * @throws JMSException 34 | */ 35 | void sendTextMessage(String content) throws JMSException; 36 | 37 | /** 38 | * Sends a MapMessage. 39 | * 40 | * @param content The Map to get the content from. 41 | * 42 | * @throws JMSException 43 | */ 44 | 45 | void sendMapMessage(Map content) throws JMSException; 46 | 47 | /** 48 | * Sends an ObjectMessage. 49 | * 50 | * @param content The serializable object content. 51 | * @throws JMSException 52 | */ 53 | void sendObjectMessage(Serializable content) 54 | throws JMSException; 55 | 56 | /** 57 | * Sends a ByteMessage. 58 | * 59 | * @param content The content as a byte array. 60 | * @throws JMSException 61 | */ 62 | void sendBytesMessage(byte[] content) throws JMSException; 63 | 64 | } -------------------------------------------------------------------------------- /public/transactions-api/src/main/java/com/atomikos/recovery/RecoveryLog.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.recovery; 10 | 11 | import java.util.Collection; 12 | 13 | /** 14 | * Handle to the transaction logs for recovery purposes. 15 | */ 16 | 17 | public interface RecoveryLog { 18 | 19 | /** 20 | * @return False if we don't have to do recovery because another instance is doing it. 21 | */ 22 | boolean isActive(); 23 | 24 | /** 25 | * Notification of JVM shutdown - allows another instance to take over. 26 | */ 27 | void closing(); 28 | 29 | Collection getIndoubtTransactionRecords() throws LogReadException; 30 | 31 | Collection getExpiredPendingCommittingTransactionRecordsAt(long time) throws LogReadException; 32 | 33 | void forgetTransactionRecords(Collection coordinators); 34 | 35 | /** 36 | * Mark the given transaction as committing. 37 | * @param coordinatorId The transaction, previously logged as IN_DOUBT. 38 | * For retries, the IN_DOUBT may no longer exist. 39 | * @throws LogException 40 | */ 41 | void recordAsCommitting(String coordinatorId) throws LogException; 42 | 43 | void forget(String coordinatorId); 44 | 45 | PendingTransactionRecord get(String coordinatorId) throws LogReadException; 46 | 47 | Collection getPendingTransactionRecords() throws LogReadException; 48 | 49 | void closed(); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/icatch/jta/template/RequiredTemplate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.jta.template; 10 | 11 | import java.lang.reflect.UndeclaredThrowableException; 12 | import java.util.concurrent.Callable; 13 | 14 | import javax.transaction.SystemException; 15 | import javax.transaction.TransactionManager; 16 | 17 | class RequiredTemplate extends TransactionTemplate { 18 | 19 | protected RequiredTemplate(TransactionManager utm, int timeout) { 20 | super(utm, timeout); 21 | } 22 | 23 | public T execute(Callable work) throws Exception { 24 | T ret = null; 25 | boolean transactionStartedHere = false; 26 | try { 27 | if (utm.getTransaction() == null) { 28 | beginTransaction(); 29 | transactionStartedHere = true; 30 | } 31 | ret = work.call(); 32 | if (transactionStartedHere) { 33 | utm.commit(); 34 | } 35 | } catch (Exception e) { 36 | handleException(transactionStartedHere); 37 | throw e; 38 | } catch (Throwable e) { 39 | handleException(transactionStartedHere); 40 | throw new UndeclaredThrowableException(e); 41 | } 42 | return ret; 43 | } 44 | 45 | private void handleException(boolean transactionStartedHere) throws SystemException { 46 | if (transactionStartedHere) { 47 | utm.rollback(); 48 | } else { 49 | utm.setRollbackOnly(); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/datasource/xa/AbstractXidFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.datasource.xa; 10 | 11 | import java.util.concurrent.atomic.AtomicLong; 12 | 13 | /** 14 | * 15 | * 16 | * 17 | * An abstract superclass for all XidFactory implementations. This class 18 | * provides the functionality to create really unique XIDs. 19 | * 20 | * 21 | * 22 | * 23 | */ 24 | abstract class AbstractXidFactory implements XidFactory 25 | { 26 | 27 | private static final int MAX_LENGTH_OF_COUNTER = String.valueOf(Long.MAX_VALUE).length(); 28 | 29 | static AtomicLong counter = new AtomicLong(0); 30 | 31 | public AbstractXidFactory () 32 | { 33 | super (); 34 | 35 | } 36 | 37 | /** 38 | * @see com.atomikos.datasource.xa.XidFactory 39 | */ 40 | 41 | public XID createXid ( String tid , String branchIdentifier, String uniqueResourceName ) 42 | { 43 | 44 | if ( branchIdentifier.getBytes().length + MAX_LENGTH_OF_COUNTER > XID.MAXBQUALSIZE ) { 45 | // see case 73086 46 | throw new IllegalArgumentException ( "Value too long: " + branchIdentifier ); 47 | } 48 | 49 | // first increment counter to make sure it is 50 | // different from the last call that was done 51 | // by the SAME tid (works because calls within 52 | // one TID are serial) 53 | return new XID (tid, branchIdentifier + counter.incrementAndGet(), uniqueResourceName); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /public/transactions-jms/src/main/java/com/atomikos/jms/extra/MessageCallback.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.jms.extra; 10 | 11 | import javax.jms.Destination; 12 | import javax.jms.JMSException; 13 | import javax.jms.Message; 14 | import javax.jms.MessageProducer; 15 | import javax.jms.Session; 16 | 17 | abstract class MessageCallback implements JmsSenderTemplateCallback 18 | { 19 | 20 | private final Destination replyToDestination; 21 | private final Destination destination; 22 | private final int priority; 23 | private final long ttl; 24 | private final int deliveryMode; 25 | 26 | protected MessageCallback ( Destination destination , Destination replyToDestination , int deliveryMode , int priority , long ttl ) 27 | { 28 | this.destination = destination; 29 | this.replyToDestination = replyToDestination; 30 | this.priority = priority; 31 | this.ttl = ttl; 32 | this.deliveryMode = deliveryMode; 33 | } 34 | 35 | protected void sendMessage ( Message m , Session s ) throws JMSException 36 | { 37 | if ( replyToDestination != null ) 38 | m.setJMSReplyTo ( replyToDestination ); 39 | MessageProducer mp = s.createProducer( destination ); 40 | mp.send ( m , deliveryMode, priority, ttl ); 41 | mp.close(); 42 | } 43 | @Override 44 | public void doInJmsSession(Session session) throws JMSException { 45 | sendMessage(createMessage(session), session); 46 | } 47 | 48 | 49 | abstract Message createMessage(Session session) throws JMSException; 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /public/transactions-hibernate2/src/main/java/com/atomikos/icatch/jta/hibernate/TransactionManagerLookup.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.icatch.jta.hibernate; 10 | 11 | import java.util.Properties; 12 | 13 | import javax.transaction.TransactionManager; 14 | 15 | import com.atomikos.icatch.jta.UserTransactionManager; 16 | 17 | import net.sf.hibernate.HibernateException; 18 | 19 | /** 20 | * 21 | * 22 | * 23 | * This class is provided for Hibernate integration. 24 | * To use Atomikos as the Hibernate JTA transaction manager, 25 | * specify this class as the value of the 26 | * hibernate.transaction.manager_lookup_class of the 27 | * hibernate configuration properties. 28 | * 29 | */ 30 | public class TransactionManagerLookup 31 | implements net.sf.hibernate.transaction.TransactionManagerLookup 32 | { 33 | 34 | UserTransactionManager utm; 35 | 36 | public TransactionManagerLookup() 37 | { 38 | utm = new UserTransactionManager(); 39 | } 40 | 41 | 42 | /* (non-Javadoc) 43 | * @see net.sf.hibernate.transaction.TransactionManagerLookup#getTransactionManager(java.util.Properties) 44 | */ 45 | public TransactionManager getTransactionManager(Properties arg0) 46 | throws HibernateException 47 | { 48 | return utm; 49 | } 50 | 51 | /* (non-Javadoc) 52 | * @see net.sf.hibernate.transaction.TransactionManagerLookup#getUserTransactionName() 53 | */ 54 | public String getUserTransactionName() 55 | { 56 | 57 | return null; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /public/transactions-jta/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | com.atomikos 6 | ate 7 | 6.0.1-SNAPSHOT 8 | 9 | transactions-jta 10 | Transactions JTA 11 | 12 | false 13 | 14 | 15 | 16 | com.atomikos 17 | transactions-api 18 | 6.0.1-SNAPSHOT 19 | 20 | 21 | com.atomikos 22 | transactions 23 | 6.0.1-SNAPSHOT 24 | runtime 25 | 26 | 27 | com.atomikos 28 | atomikos-util 29 | 6.0.1-SNAPSHOT 30 | 31 | 32 | jakarta.jms 33 | jakarta.jms-api 34 | 2.0.3 35 | provided 36 | 37 | 38 | jakarta.transaction 39 | jakarta.transaction-api 40 | 1.3.3 41 | provided 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /public/transactions-jta/src/main/java/com/atomikos/recovery/xa/InMemoryPreviousXidRepository.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.recovery.xa; 10 | 11 | import java.util.ArrayList; 12 | import java.util.HashMap; 13 | import java.util.Iterator; 14 | import java.util.List; 15 | import java.util.Map; 16 | 17 | import com.atomikos.datasource.xa.XID; 18 | 19 | public class InMemoryPreviousXidRepository implements PreviousXidRepository { 20 | 21 | private Map> cache = new HashMap<>(); 22 | 23 | @Override 24 | public synchronized List findXidsExpiredAt(long startOfRecoveryScan) { 25 | List xids = new ArrayList<>(); 26 | for (Long expiration : cache.keySet()) { 27 | if(expiration it = cache.keySet().iterator(); 37 | while (it.hasNext()) { 38 | Long expiration = it.next(); 39 | if(expiration<=startOfRecoveryScan) { 40 | it.remove(); 41 | } 42 | } 43 | } 44 | 45 | @Override 46 | public synchronized boolean isEmpty() { 47 | return cache.isEmpty(); 48 | } 49 | 50 | @Override 51 | public synchronized void remember(XID xidToStoreForNextScan, long expiration) { 52 | List xids = cache.get(expiration); 53 | if (xids == null) { 54 | xids = new ArrayList<>(); 55 | } 56 | xids.add(xidToStoreForNextScan); 57 | cache.put(expiration, xids); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /public/spring-boot2/transactions-spring-boot/src/test/java/com/atomikos/spring/AtomikosAutoConfigurationJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import javax.transaction.UserTransaction; 12 | 13 | import org.junit.Test; 14 | import org.springframework.boot.autoconfigure.transaction.jta.JtaProperties; 15 | import org.springframework.boot.jdbc.XADataSourceWrapper; 16 | import org.springframework.boot.jms.XAConnectionFactoryWrapper; 17 | import org.springframework.context.annotation.AnnotationConfigApplicationContext; 18 | import org.springframework.transaction.jta.JtaTransactionManager; 19 | 20 | import com.atomikos.icatch.config.UserTransactionService; 21 | import com.atomikos.icatch.jta.UserTransactionManager; 22 | 23 | /** 24 | * Tests for {@link AtomikosAutoConfiguration}. 25 | */ 26 | public class AtomikosAutoConfigurationJUnit { 27 | 28 | @Test 29 | public void sanityCheck() { 30 | try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(JtaProperties.class, 31 | AtomikosAutoConfiguration.class)) { 32 | context.getBean(AtomikosProperties.class); 33 | context.getBean(UserTransactionService.class); 34 | context.getBean(UserTransactionManager.class); 35 | context.getBean(UserTransaction.class); 36 | context.getBean(XADataSourceWrapper.class); 37 | context.getBean(XAConnectionFactoryWrapper.class); 38 | context.getBean(AtomikosDependsOnBeanFactoryPostProcessor.class); 39 | context.getBean(JtaTransactionManager.class); 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /public/spring-boot3/transactions-spring-boot3/src/test/java/com/atomikos/spring/AtomikosAutoConfigurationJUnit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2000-2024 Atomikos 3 | * 4 | * LICENSE CONDITIONS 5 | * 6 | * See http://www.atomikos.com/Main/WhichLicenseApplies for details. 7 | */ 8 | 9 | package com.atomikos.spring; 10 | 11 | import jakarta.transaction.UserTransaction; 12 | 13 | import org.junit.Test; 14 | import org.springframework.boot.autoconfigure.transaction.TransactionProperties; 15 | import org.springframework.boot.jdbc.XADataSourceWrapper; 16 | import org.springframework.boot.jms.XAConnectionFactoryWrapper; 17 | import org.springframework.context.annotation.AnnotationConfigApplicationContext; 18 | import org.springframework.transaction.jta.JtaTransactionManager; 19 | 20 | import com.atomikos.icatch.config.UserTransactionService; 21 | import com.atomikos.icatch.jta.UserTransactionManager; 22 | 23 | /** 24 | * Tests for {@link AtomikosAutoConfiguration}. 25 | */ 26 | public class AtomikosAutoConfigurationJUnit { 27 | 28 | @Test 29 | public void sanityCheck() { 30 | try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TransactionProperties.class, 31 | AtomikosAutoConfiguration.class)) { 32 | context.getBean(AtomikosProperties.class); 33 | context.getBean(UserTransactionService.class); 34 | context.getBean(UserTransactionManager.class); 35 | context.getBean(UserTransaction.class); 36 | context.getBean(XADataSourceWrapper.class); 37 | context.getBean(XAConnectionFactoryWrapper.class); 38 | context.getBean(AtomikosDependsOnBeanFactoryPostProcessor.class); 39 | context.getBean(JtaTransactionManager.class); 40 | } 41 | } 42 | 43 | } 44 | --------------------------------------------------------------------------------