├── ArjunaJTS ├── recovery │ ├── ExampleXAResource2.xid │ ├── src │ │ └── main │ │ │ └── java │ │ │ ├── ExampleXAResource2.java │ │ │ └── ExampleXAResource1.java │ ├── run.bat │ └── run.sh ├── interop │ ├── glassfish │ │ ├── step5.sh │ │ ├── step6.sh │ │ ├── step4.sh │ │ ├── step3.sh │ │ ├── step2.sh │ │ ├── step7.sh │ │ ├── configure-jts-transactions.cli │ │ └── run.sh │ ├── test-ejbs │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── service │ │ │ │ ├── remote │ │ │ │ ├── ISessionHome.java │ │ │ │ └── ISession.java │ │ │ │ └── local │ │ │ │ └── ISession.java │ │ │ └── webapp │ │ │ └── WEB-INF │ │ │ ├── beans.xml │ │ │ ├── jboss-ejb3.xml │ │ │ └── web.xml │ └── resource │ │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── jboss │ │ └── narayana │ │ ├── ASFailureMode.java │ │ └── ASFailureType.java ├── trailmap │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── arjuna │ │ └── demo │ │ ├── jta │ │ ├── jdbcbank │ │ │ └── NotExistingAccount.java │ │ └── localbank │ │ │ └── NotExistingAccount.java │ │ ├── jts │ │ └── localbank │ │ │ └── NotExistingAccount.java │ │ └── simple │ │ └── HelloImpl.java └── standalone │ ├── run.bat │ └── run.sh ├── rts ├── lra │ ├── lra-coordinator │ │ ├── .gitignore │ │ └── Dockerfile │ ├── .gitignore │ ├── lra-test │ │ └── .gitignore │ ├── hotel-service │ │ ├── src │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── narayana │ │ │ │ └── rts │ │ │ │ └── lra │ │ │ │ └── demo │ │ │ │ └── hotel │ │ │ │ └── JaxRsActivator.java │ │ └── Dockerfile │ ├── flight-service │ │ ├── src │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── narayana │ │ │ │ └── rts │ │ │ │ └── lra │ │ │ │ └── demo │ │ │ │ └── flight │ │ │ │ └── JaxRsActivator.java │ │ └── Dockerfile │ ├── trip-controller │ │ ├── src │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── narayana │ │ │ │ └── rts │ │ │ │ └── lra │ │ │ │ └── demo │ │ │ │ └── tripcontroller │ │ │ │ ├── JaxRsActivator.java │ │ │ │ ├── BookingException.java │ │ │ │ └── BookingExceptionMapper.java │ │ └── Dockerfile │ └── foo.sh ├── at │ ├── annotation │ │ ├── flight-service │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ ├── application.properties │ │ │ │ └── META-INF │ │ │ │ │ ├── services │ │ │ │ │ └── jakarta.ws.rs.ext.Providers │ │ │ │ │ └── beans.xml │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── narayana │ │ │ │ └── sra │ │ │ │ └── demo │ │ │ │ └── service │ │ │ │ └── FlightService.java │ │ ├── hotel-service │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ ├── application.properties │ │ │ │ └── META-INF │ │ │ │ │ ├── services │ │ │ │ │ └── jakarta.ws.rs.ext.Providers │ │ │ │ │ └── beans.xml │ │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── narayana │ │ │ │ └── sra │ │ │ │ └── demo │ │ │ │ └── service │ │ │ │ └── HotelService.java │ │ ├── common-service │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── resources │ │ │ │ │ └── META-INF │ │ │ │ │ │ ├── services │ │ │ │ │ │ └── jakarta.ws.rs.ext.Providers │ │ │ │ │ │ └── beans.xml │ │ │ │ │ └── java │ │ │ │ │ └── io │ │ │ │ │ └── narayana │ │ │ │ │ └── sra │ │ │ │ │ └── demo │ │ │ │ │ ├── service │ │ │ │ │ ├── BookingException.java │ │ │ │ │ └── BookingExceptionMapper.java │ │ │ │ │ └── constant │ │ │ │ │ └── ServiceConstant.java │ │ │ └── pom.xml │ │ ├── trip-service │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── resources │ │ │ │ ├── META-INF │ │ │ │ ├── services │ │ │ │ │ └── jakarta.ws.rs.ext.Providers │ │ │ │ └── beans.xml │ │ │ │ └── application.properties │ │ ├── stop-wildfly-coordinator.sh │ │ ├── start-wildfly-coordinator.sh │ │ ├── stop-services.sh │ │ └── start-services.sh │ ├── simple │ │ ├── run.bat │ │ └── run.sh │ ├── service │ │ ├── service1 │ │ │ ├── run.bat │ │ │ ├── run.sh │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── quickstart │ │ │ │ └── JAXRSServer.java │ │ ├── service2 │ │ │ ├── run.bat │ │ │ ├── run.sh │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── quickstart │ │ │ │ └── WorkDeserializer.java │ │ └── pom.xml │ ├── undertow │ │ ├── etc │ │ │ └── jbossts-properties.xml │ │ ├── run.sh │ │ ├── src │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ └── META-INF │ │ │ │ │ └── beans.xml │ │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── jboss │ │ │ │ └── narayana │ │ │ │ └── rts │ │ │ │ └── JAXRSServer.java │ │ └── run.bat │ ├── jta-service │ │ ├── jms │ │ │ └── src │ │ │ │ ├── main │ │ │ │ └── webapp │ │ │ │ │ └── WEB-INF │ │ │ │ │ ├── web.xml │ │ │ │ │ └── beans.xml │ │ │ │ └── test │ │ │ │ └── resources │ │ │ │ └── arquillian.xml │ │ └── jpa │ │ │ └── src │ │ │ ├── main │ │ │ ├── webapp │ │ │ │ └── WEB-INF │ │ │ │ │ ├── web.xml │ │ │ │ │ ├── beans.xml │ │ │ │ │ └── test-ds.xml │ │ │ ├── java │ │ │ │ └── org │ │ │ │ │ └── jboss │ │ │ │ │ └── narayana │ │ │ │ │ └── quickstart │ │ │ │ │ └── rest │ │ │ │ │ └── bridge │ │ │ │ │ └── inbound │ │ │ │ │ └── jpa │ │ │ │ │ └── model │ │ │ │ │ ├── UserTableDao.java │ │ │ │ │ └── TaskDao.java │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ └── persistence.xml │ │ │ └── test │ │ │ └── resources │ │ │ └── arquillian.xml │ └── recovery │ │ ├── recovery2 │ │ ├── run.bat │ │ ├── run.sh │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── quickstart │ │ │ └── WorkDeserializer.java │ │ ├── recovery1 │ │ ├── run.bat │ │ ├── run.sh │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── quickstart │ │ │ └── JAXRSServer.java │ │ └── pom.xml └── lra-examples │ ├── cdi-participant │ └── src │ │ └── main │ │ ├── resources │ │ ├── application.properties │ │ └── META-INF │ │ │ └── beans.xml │ │ └── java │ │ └── io │ │ └── narayana │ │ └── rts │ │ └── lra │ │ └── JaxRsActivator.java │ ├── cdi-embedded │ ├── src │ │ └── main │ │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── META-INF │ │ │ └── beans.xml │ │ │ └── jbossts-properties.xml │ └── README.md │ ├── coordinator-quarkus │ └── src │ │ └── main │ │ └── resources │ │ ├── application.properties │ │ └── reflection-config.json │ ├── lra-jwt │ ├── wildfly │ │ └── restore-configuration.cli │ └── pom.xml │ └── README.md ├── jts-atomic-app ├── .gitignore ├── artifacts │ └── docker │ │ ├── jacorb-name-server_run │ │ └── jts-transaction-service_run ├── Dockerfile └── Vagrantfile ├── XTS ├── ssl │ └── .gitignore ├── raw-xts-api-demo │ ├── .gitignore │ ├── war │ │ └── src │ │ │ └── main │ │ │ └── webapp │ │ │ └── images │ │ │ ├── a_nav_6699cc.gif │ │ │ ├── bl_corner_10.gif │ │ │ ├── br_corner_10.gif │ │ │ ├── tl_corner_10.gif │ │ │ ├── tr_corner_10.gif │ │ │ ├── bl_navcorner_20.gif │ │ │ ├── br_navcorner_20.gif │ │ │ ├── tl_navcorner_20.gif │ │ │ ├── tr_navcorner_20.gif │ │ │ ├── JBoss_DivOfRH_RGB.gif │ │ │ └── JBoss_byRH_logo_rgb.png │ ├── rpc │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── arjuna │ │ │ │ ├── xts │ │ │ │ └── nightout │ │ │ │ │ ├── services │ │ │ │ │ ├── Taxi │ │ │ │ │ │ ├── ITaxiService.java │ │ │ │ │ │ └── ITaxiServiceBA.java │ │ │ │ │ ├── Theatre │ │ │ │ │ │ ├── ITheatreService.java │ │ │ │ │ │ └── ITheatreServiceBA.java │ │ │ │ │ ├── Restaurant │ │ │ │ │ │ ├── IRestaurantService.java │ │ │ │ │ │ └── IRestaurantServiceBA.java │ │ │ │ │ └── recovery │ │ │ │ │ │ ├── DemoRPCATRecoveryListener.java │ │ │ │ │ │ └── DemoRPCBARecoveryListener.java │ │ │ │ │ └── clients │ │ │ │ │ └── jboss │ │ │ │ │ ├── taxi │ │ │ │ │ ├── ITaxiServiceAT.java │ │ │ │ │ └── ITaxiServiceBA.java │ │ │ │ │ ├── restaurant │ │ │ │ │ ├── IRestaurantServiceAT.java │ │ │ │ │ └── IRestaurantServiceBA.java │ │ │ │ │ └── theatre │ │ │ │ │ ├── ITheatreServiceAT.java │ │ │ │ │ └── ITheatreServiceBA.java │ │ │ │ └── mw │ │ │ │ └── wst │ │ │ │ └── service │ │ │ │ └── JaxRPCSubordinateHeaderContextProcessor.java │ │ │ └── dd │ │ │ └── jboss │ │ │ ├── jaxrpc-mapping.xml │ │ │ └── client-jaxrpc-mapping.xml │ ├── core │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ └── context-handlers.xml │ │ │ └── java │ │ │ └── com │ │ │ └── jboss │ │ │ └── jbosstm │ │ │ └── xts │ │ │ └── demo │ │ │ ├── taxi │ │ │ ├── ITaxiServiceAT.java │ │ │ └── ITaxiServiceBA.java │ │ │ ├── services │ │ │ ├── state │ │ │ │ └── ServiceStateConstants.java │ │ │ ├── restaurant │ │ │ │ └── RestaurantConstants.java │ │ │ └── recovery │ │ │ │ ├── DemoATRecoveryListener.java │ │ │ │ └── DemoBARecoveryListener.java │ │ │ ├── restaurant │ │ │ ├── IRestaurantServiceAT.java │ │ │ └── IRestaurantServiceBA.java │ │ │ └── theatre │ │ │ ├── ITheatreServiceAT.java │ │ │ └── ITheatreServiceBA.java │ ├── byteman-scripts │ │ └── demotrace.txt │ └── test │ │ └── src │ │ └── test │ │ └── resources │ │ ├── arquillian.xml │ │ └── logging.properties ├── wsat-jta-multi_service │ └── src │ │ ├── test │ │ ├── resources │ │ │ └── persistence.xml │ │ └── java │ │ │ └── org │ │ │ └── jboss │ │ │ └── narayana │ │ │ └── quickstarts │ │ │ └── wsat │ │ │ └── jtabridge │ │ │ └── fromjta │ │ │ ├── FirstClient.java │ │ │ └── SecondClient.java │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── persistence.xml │ │ └── java │ │ └── org │ │ └── jboss │ │ └── narayana │ │ └── quickstarts │ │ └── wsat │ │ └── jtabridge │ │ ├── first │ │ ├── FirstCounterEntity.java │ │ └── jaxws │ │ │ └── FirstServiceAT.java │ │ └── second │ │ ├── SecondCounterEntity.java │ │ └── jaxws │ │ └── SecondServiceAT.java └── wsat-jta-multi_hop │ └── src │ ├── main │ ├── resources │ │ └── META-INF │ │ │ └── persistence.xml │ └── java │ │ └── org │ │ └── jboss │ │ └── narayana │ │ └── quickstarts │ │ └── wsat │ │ └── jtabridge │ │ ├── second │ │ ├── SecondClient.java │ │ ├── SecondCounterEntity.java │ │ └── jaxws │ │ │ └── SecondServiceAT.java │ │ └── first │ │ └── FirstCounterEntity.java │ └── test │ ├── resources │ └── arquillian.xml │ └── java │ └── org │ └── jboss │ └── narayana │ └── quickstarts │ └── wsat │ └── jtabridge │ └── fromjta │ └── FirstClient.java ├── jta-and-hibernate-standalone └── src │ └── main │ ├── resources │ ├── META-INF │ │ └── beans.xml │ ├── jndi.properties │ ├── jdbc-recovery.xml │ └── log4j.properties │ └── java │ └── org │ └── jboss │ └── narayana │ └── quickstart │ └── jta │ ├── QuickstartRuntimeException.java │ ├── EntityManagerProducer.java │ └── EntityManagerFactoryProducer.java ├── wiki-example ├── src │ └── org │ │ └── jboss │ │ └── jbossts │ │ └── qa │ │ └── astests │ │ ├── resources │ │ └── java.policy │ │ ├── ejb2 │ │ ├── EJB2Home.java │ │ └── EJB2Remote.java │ │ ├── ejb3 │ │ └── EJB3Remote.java │ │ └── META-INF │ │ └── jboss.xml └── resources │ └── jbossts-properties.xml ├── jpms └── jta │ ├── config │ ├── src │ │ ├── main │ │ │ └── io.narayana.config │ │ │ │ ├── module-info.java │ │ │ │ └── io │ │ │ │ └── narayana │ │ │ │ └── config │ │ │ │ └── Config.java │ │ └── test │ │ │ └── io.narayana.config │ │ │ └── io │ │ │ └── narayana │ │ │ └── config │ │ │ └── BasicTest.java │ └── pom.xml │ ├── demo │ ├── run.sh │ └── src │ │ └── main │ │ ├── io.narayana.demo │ │ └── module-info.java │ │ └── resources │ │ └── log4j2.properties │ ├── notes │ ├── txuser │ └── src │ │ └── main │ │ └── io.narayana.txuser │ │ ├── io │ │ └── narayana │ │ │ └── txuser │ │ │ └── TxUserException.java │ │ └── module-info.java │ └── recovery │ └── src │ └── main │ └── io.narayana.recovery │ ├── io │ └── narayana │ │ └── recovery │ │ └── RecoveryException.java │ └── module-info.java ├── STM ├── vertx │ └── README.adoc ├── jta │ ├── src │ │ └── main │ │ │ └── java │ │ │ ├── Atomic.java │ │ │ └── ExampleSTM.java │ └── README.md ├── optimistic │ ├── src │ │ └── main │ │ │ └── java │ │ │ ├── Atomic.java │ │ │ └── ExampleSTM.java │ └── README.md ├── README.md └── pessimistic │ ├── README.md │ └── src │ └── main │ └── java │ ├── Atomic.java │ └── ExampleSTM.java ├── transactionaldriver ├── transactionaldriver-standalone │ └── src │ │ └── main │ │ ├── resources │ │ ├── ds1.h2.properties │ │ ├── ds2.h2.properties │ │ ├── ds1.pg.properties │ │ ├── ds2.pg.properties │ │ ├── recovery-jdbcxa-test1.xml │ │ ├── recovery-basicxa-test1.xml │ │ ├── logging.properties │ │ └── xaexception.rmfail.btm │ │ └── java │ │ └── io │ │ └── narayana │ │ └── util │ │ ├── RunnableWithException.java │ │ └── TestInitialContextFactory.java └── pom.xml ├── jts-docker ├── src │ └── test │ │ └── resources │ │ ├── docker-narayana-lib │ │ └── postgresql-9.4-1201.jdbc4.jar │ │ ├── jbossts-properties.xml │ │ └── docker-narayana-config │ │ └── log4j.properties └── kubernetes │ └── jts-pod.yaml ├── wildfly ├── commit-markable-resource │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── cmr-create-script.sql │ │ ├── webapp │ │ └── WEB-INF │ │ │ ├── faces-config.xml │ │ │ └── web.xml │ │ └── java │ │ └── org │ │ └── jboss │ │ └── narayana │ │ └── quickstarts │ │ └── cmr │ │ ├── BookProcessorLrco.java │ │ ├── BookProcessorCmr.java │ │ └── jsf │ │ └── Book.java └── setCheckedActionFactoryExample │ └── src │ └── main │ ├── webapp │ ├── index.html │ ├── WEB-INF │ │ ├── beans.xml │ │ └── faces-config.xml │ └── checkedActionFactoryExample.xhtml │ └── java │ └── org │ └── narayana │ ├── handler │ └── MyEJB.java │ └── CheckedActionFactoryExample.java ├── ArjunaJTA ├── jakartaee_transactional_app │ └── src │ │ ├── main │ │ ├── webapp │ │ │ ├── index.html │ │ │ ├── WEB-INF │ │ │ │ ├── beans.xml │ │ │ │ └── faces-config.xml │ │ │ ├── count.xhtml │ │ │ ├── duplicate.xhtml │ │ │ ├── template.xhtml │ │ │ ├── addCustomer.xhtml │ │ │ └── customers.xhtml │ │ ├── java │ │ │ └── org │ │ │ │ └── jboss │ │ │ │ └── narayana │ │ │ │ └── quickstarts │ │ │ │ └── jpa │ │ │ │ └── Customer.java │ │ └── resources │ │ │ └── META-INF │ │ │ └── persistence.xml │ │ └── test │ │ └── resources │ │ └── arquillian.xml ├── maven │ ├── run.bat │ └── run.sh ├── jakarta_transaction │ ├── run.bat │ ├── run.sh │ └── README.md ├── object_store │ ├── run.bat │ └── run.sh └── recovery │ └── src │ └── main │ └── java │ └── org │ └── jboss │ └── narayana │ └── jta │ └── quickstarts │ └── recovery │ └── RecoverySetup.java ├── ArjunaCore ├── txoj │ ├── run.bat │ └── run.sh └── README.md ├── compensating-transactions ├── travel-agent │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── jboss │ │ │ │ └── narayana │ │ │ │ └── quickstarts │ │ │ │ └── compensationsApi │ │ │ │ ├── hotel │ │ │ │ ├── BookingStatus.java │ │ │ │ └── BookingData.java │ │ │ │ ├── taxi2 │ │ │ │ ├── BookingStatus.java │ │ │ │ └── BookingData.java │ │ │ │ └── taxi1 │ │ │ │ ├── BookingUnavailableRuntimeException.java │ │ │ │ └── jaxws │ │ │ │ └── Taxi1Service.java │ │ └── test │ │ │ ├── resources │ │ │ └── persistence.xml │ │ │ └── java │ │ │ └── org │ │ │ └── jboss │ │ │ └── narayana │ │ │ └── quickstarts │ │ │ └── compensationsApi │ │ │ └── travel │ │ │ └── TravelBookingResult.java │ └── README.md ├── mongodb-simple │ └── src │ │ ├── test │ │ ├── java │ │ │ └── org │ │ │ │ └── jboss │ │ │ │ └── narayana │ │ │ │ └── quickstarts │ │ │ │ └── mongodb │ │ │ │ └── simple │ │ │ │ └── resources │ │ │ │ └── JaxRsActivator.java │ │ └── resources │ │ │ └── arquillian.xml │ │ └── main │ │ └── java │ │ └── org │ │ └── jboss │ │ └── narayana │ │ └── quickstarts │ │ └── mongodb │ │ └── simple │ │ ├── CreditData.java │ │ ├── DebitData.java │ │ └── Resources.java ├── non-transactional_resource │ ├── README.md │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── jboss │ │ └── narayana │ │ └── quickstarts │ │ └── nonTransactionalResource │ │ └── bookService │ │ ├── DestroyInvoice.java │ │ ├── RecallPackage.java │ │ ├── PackageDispatcher.java │ │ ├── OrderData.java │ │ ├── BookService.java │ │ ├── InvoicePrinter.java │ │ └── InvoiceData.java └── README.md ├── spring ├── narayana-spring-boot │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── jboss │ │ │ │ └── narayana │ │ │ │ └── quickstart │ │ │ │ └── spring │ │ │ │ ├── EntriesRepository.java │ │ │ │ └── MessagesListener.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── resources │ │ └── application.properties ├── camel-with-narayana-spring-boot │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── jboss │ │ │ └── narayana │ │ │ └── quickstart │ │ │ └── spring │ │ │ ├── UserRepository.java │ │ │ ├── UserBean.java │ │ │ ├── HaltBean.java │ │ │ ├── CamelApplication.java │ │ │ ├── User.java │ │ │ └── JmsConfig.java │ │ └── resources │ │ ├── application-test.properties │ │ └── application.properties ├── stock-market-with-narayana-spring-boot │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── jboss │ │ │ └── narayana │ │ │ └── quickstart │ │ │ └── spring │ │ │ ├── UserRepository.java │ │ │ ├── ShareRepository.java │ │ │ ├── PortfolioEntryRepository.java │ │ │ ├── MessageListener.java │ │ │ └── StockMarketApplication.java │ │ └── resources │ │ └── application.properties └── jta │ ├── src │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── jboss │ │ │ │ └── narayana │ │ │ │ └── quickstart │ │ │ │ └── spring │ │ │ │ └── config │ │ │ │ └── DummyXAConfig.java │ │ └── resources │ │ │ └── log4j.properties │ └── test │ │ └── resources │ │ └── log4j.properties │ └── README.md ├── PULL_REQUEST_TEMPLATE.md ├── agroal └── src │ └── main │ └── resources │ ├── logging.properties │ └── xaexception.rmfail.btm ├── atsintegration ├── README.md └── src │ └── main │ └── java │ └── com │ └── arjuna │ └── jta │ └── distributed │ └── example │ ├── resources │ └── TestSynchronization.java │ └── server │ ├── LookupProvider.java │ └── impl │ └── ProxyXAResourceDeserializer.java ├── tools └── download-maven.sh ├── .gitignore ├── jta-1_2-in-wildfly └── src │ ├── main │ └── java │ │ └── org │ │ └── jboss │ │ └── narayana │ │ └── quickstarts │ │ └── jta │ │ ├── TransactionScopedPojo.java │ │ └── QuickstartEntity.java │ └── test │ └── resources │ └── arquillian.xml ├── SECURITY.md └── jta-1_2-standalone ├── src ├── main │ └── resources │ │ └── META-INF │ │ └── beans.xml └── test │ └── resources │ └── jbossts-properties.xml └── README.md /ArjunaJTS/recovery/ExampleXAResource2.xid: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rts/lra/lra-coordinator/.gitignore: -------------------------------------------------------------------------------- 1 | target/ -------------------------------------------------------------------------------- /jts-atomic-app/.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | .idea 3 | -------------------------------------------------------------------------------- /XTS/ssl/.gitignore: -------------------------------------------------------------------------------- 1 | client/ 2 | quickstart/ 3 | server/ 4 | wildfly/ 5 | -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/.gitignore: -------------------------------------------------------------------------------- 1 | restaurantManagerState 2 | theatreManagerState 3 | -------------------------------------------------------------------------------- /rts/at/annotation/flight-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | quarkus.http.port=8084 -------------------------------------------------------------------------------- /rts/at/annotation/hotel-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | quarkus.http.port=8083 -------------------------------------------------------------------------------- /rts/lra/.gitignore: -------------------------------------------------------------------------------- 1 | narayana-full-5.6.5.Final-SNAPSHOT/ 2 | narayana-full-5.6.5.Final-SNAPSHOT-bin.zip -------------------------------------------------------------------------------- /jta-and-hibernate-standalone/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rts/lra/lra-test/.gitignore: -------------------------------------------------------------------------------- 1 | narayana-full-5.6.5.Final-SNAPSHOT-bin.zip 2 | narayana-full-5.6.5.Final-SNAPSHOT/ -------------------------------------------------------------------------------- /jts-atomic-app/artifacts/docker/jacorb-name-server_run: -------------------------------------------------------------------------------- 1 | docker run -d --name jacorb-name-server -p $jacorb_host_port:3528 $jacorb_image 2 | -------------------------------------------------------------------------------- /wiki-example/src/org/jboss/jbossts/qa/astests/resources/java.policy: -------------------------------------------------------------------------------- 1 | grant { 2 | permission java.security.AllPermission; 3 | }; 4 | -------------------------------------------------------------------------------- /ArjunaJTS/interop/glassfish/step5.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Make an ejb call from glassfish to wildfly 4 | 5 | ./ejb_operations.sh -t gfwf 6 | -------------------------------------------------------------------------------- /ArjunaJTS/interop/glassfish/step6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Make an ejb call from glassfish to wildfly 4 | 5 | ./ejb_operations.sh -t wfgf 6 | -------------------------------------------------------------------------------- /jpms/jta/config/src/main/io.narayana.config/module-info.java: -------------------------------------------------------------------------------- 1 | 2 | module io.narayana.config { 3 | exports io.narayana.config; 4 | } 5 | -------------------------------------------------------------------------------- /rts/at/annotation/common-service/src/main/resources/META-INF/services/jakarta.ws.rs.ext.Providers: -------------------------------------------------------------------------------- 1 | org.jboss.jbossts.star.client.ServerSRAFilter -------------------------------------------------------------------------------- /rts/at/annotation/flight-service/src/main/resources/META-INF/services/jakarta.ws.rs.ext.Providers: -------------------------------------------------------------------------------- 1 | org.jboss.jbossts.star.client.ServerSRAFilter -------------------------------------------------------------------------------- /rts/at/annotation/hotel-service/src/main/resources/META-INF/services/jakarta.ws.rs.ext.Providers: -------------------------------------------------------------------------------- 1 | org.jboss.jbossts.star.client.ServerSRAFilter -------------------------------------------------------------------------------- /rts/at/annotation/trip-service/src/main/resources/META-INF/services/jakarta.ws.rs.ext.Providers: -------------------------------------------------------------------------------- 1 | org.jboss.jbossts.star.client.ServerSRAFilter -------------------------------------------------------------------------------- /rts/at/simple/run.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | echo "Running simple quickstart" 4 | 5 | mvn compile exec:java 6 | IF %ERRORLEVEL% NEQ 0 exit -1 7 | -------------------------------------------------------------------------------- /jpms/jta/demo/run.sh: -------------------------------------------------------------------------------- 1 | set -m 2 | 3 | echo "Running JPMS example" 4 | 5 | java -jar ./target/demo-7.3.4.Final-SNAPSHOT-jar-with-dependencies.jar 6 | -------------------------------------------------------------------------------- /rts/at/annotation/trip-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | quarkus.http.port=8082 2 | hotel.quarkus.http.port=8083 3 | flight.quarkus.http.port=8084 -------------------------------------------------------------------------------- /rts/at/service/service1/run.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | echo "Running service1 quickstart" 4 | 5 | mvn clean compile exec:java 6 | IF %ERRORLEVEL% NEQ 0 exit -1 7 | -------------------------------------------------------------------------------- /jpms/jta/notes: -------------------------------------------------------------------------------- 1 | 2 | top level pom 3 | compiler source to 17 and must upgrade maven-compiler-plugin eg to 3.14.0 4 | 5 | after change any module must run mvn clean install 6 | -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/war/src/main/webapp/images/a_nav_6699cc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbosstm/quickstart/HEAD/XTS/raw-xts-api-demo/war/src/main/webapp/images/a_nav_6699cc.gif -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/war/src/main/webapp/images/bl_corner_10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbosstm/quickstart/HEAD/XTS/raw-xts-api-demo/war/src/main/webapp/images/bl_corner_10.gif -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/war/src/main/webapp/images/br_corner_10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbosstm/quickstart/HEAD/XTS/raw-xts-api-demo/war/src/main/webapp/images/br_corner_10.gif -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/war/src/main/webapp/images/tl_corner_10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbosstm/quickstart/HEAD/XTS/raw-xts-api-demo/war/src/main/webapp/images/tl_corner_10.gif -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/war/src/main/webapp/images/tr_corner_10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbosstm/quickstart/HEAD/XTS/raw-xts-api-demo/war/src/main/webapp/images/tr_corner_10.gif -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/war/src/main/webapp/images/bl_navcorner_20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbosstm/quickstart/HEAD/XTS/raw-xts-api-demo/war/src/main/webapp/images/bl_navcorner_20.gif -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/war/src/main/webapp/images/br_navcorner_20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbosstm/quickstart/HEAD/XTS/raw-xts-api-demo/war/src/main/webapp/images/br_navcorner_20.gif -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/war/src/main/webapp/images/tl_navcorner_20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbosstm/quickstart/HEAD/XTS/raw-xts-api-demo/war/src/main/webapp/images/tl_navcorner_20.gif -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/war/src/main/webapp/images/tr_navcorner_20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbosstm/quickstart/HEAD/XTS/raw-xts-api-demo/war/src/main/webapp/images/tr_navcorner_20.gif -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/war/src/main/webapp/images/JBoss_DivOfRH_RGB.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbosstm/quickstart/HEAD/XTS/raw-xts-api-demo/war/src/main/webapp/images/JBoss_DivOfRH_RGB.gif -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/war/src/main/webapp/images/JBoss_byRH_logo_rgb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbosstm/quickstart/HEAD/XTS/raw-xts-api-demo/war/src/main/webapp/images/JBoss_byRH_logo_rgb.png -------------------------------------------------------------------------------- /STM/vertx/README.adoc: -------------------------------------------------------------------------------- 1 | This quickstart was never automated so has been replaced by [a better one in the narayana conferences repository](https://github.com/jbosstm/conferences/tree/main/mucon2017). 2 | -------------------------------------------------------------------------------- /jta-and-hibernate-standalone/src/main/resources/jndi.properties: -------------------------------------------------------------------------------- 1 | java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory 2 | java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces 3 | -------------------------------------------------------------------------------- /rts/at/simple/run.sh: -------------------------------------------------------------------------------- 1 | # ALLOW JOBS TO BE BACKGROUNDED 2 | set -m 3 | 4 | echo "Running simple quickstart" 5 | 6 | mvn clean compile exec:java 7 | if [ "$?" != "0" ]; then 8 | exit -1 9 | fi 10 | -------------------------------------------------------------------------------- /transactionaldriver/transactionaldriver-standalone/src/main/resources/ds1.h2.properties: -------------------------------------------------------------------------------- 1 | xaDataSourceClassName=org.h2.jdbcx.JdbcDataSource 2 | URL=jdbc:h2:mem:test1;DB_CLOSE_DELAY=-1 3 | User= 4 | Password= -------------------------------------------------------------------------------- /transactionaldriver/transactionaldriver-standalone/src/main/resources/ds2.h2.properties: -------------------------------------------------------------------------------- 1 | xaDataSourceClassName=org.h2.jdbcx.JdbcDataSource 2 | URL=jdbc:h2:mem:test2;DB_CLOSE_DELAY=-1 3 | User= 4 | Password= -------------------------------------------------------------------------------- /jts-atomic-app/artifacts/docker/jts-transaction-service_run: -------------------------------------------------------------------------------- 1 | docker run -d --name jts-transaction-service -e PROXY_IP=$proxy_ip -p $jts_host_port:4711 --link jacorb-name-server:jacorb-name-server $jts_image 2 | -------------------------------------------------------------------------------- /jts-docker/src/test/resources/docker-narayana-lib/postgresql-9.4-1201.jdbc4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jbosstm/quickstart/HEAD/jts-docker/src/test/resources/docker-narayana-lib/postgresql-9.4-1201.jdbc4.jar -------------------------------------------------------------------------------- /wildfly/commit-markable-resource/src/main/resources/META-INF/cmr-create-script.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE xids (xid bytea, transactionManagerID varchar(64), actionuid bytea); 2 | CREATE UNIQUE INDEX index_xid ON xids (xid); -------------------------------------------------------------------------------- /rts/at/service/service1/run.sh: -------------------------------------------------------------------------------- 1 | # ALLOW JOBS TO BE BACKGROUNDED 2 | set -m 3 | 4 | echo "Running service1 quickstart" 5 | 6 | mvn clean compile exec:java 7 | if [ "$?" != "0" ]; then 8 | exit -1 9 | fi 10 | -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/rpc/src/main/java/com/arjuna/xts/nightout/services/Taxi/ITaxiService.java: -------------------------------------------------------------------------------- 1 | package com.arjuna.xts.nightout.services.Taxi; 2 | 3 | public interface ITaxiService 4 | { 5 | public void bookTaxi(); 6 | } -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/rpc/src/main/java/com/arjuna/xts/nightout/services/Taxi/ITaxiServiceBA.java: -------------------------------------------------------------------------------- 1 | package com.arjuna.xts.nightout.services.Taxi; 2 | 3 | public interface ITaxiServiceBA 4 | { 5 | public boolean bookTaxi(); 6 | } -------------------------------------------------------------------------------- /ArjunaJTA/jakartaee_transactional_app/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /rts/at/undertow/etc/jbossts-properties.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 1 6 | -------------------------------------------------------------------------------- /rts/lra/hotel-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Quarkus Configuration file 2 | # key = value 3 | quarkus.arc.exclude-types=io.narayana.lra.filter.ServerLRAFilter,io.narayana.lra.client.internal.proxy.nonjaxrs.LRAParticipantResource -------------------------------------------------------------------------------- /wildfly/setCheckedActionFactoryExample/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /rts/lra/flight-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Quarkus Configuration file 2 | # key = value 3 | quarkus.arc.exclude-types=io.narayana.lra.filter.ServerLRAFilter,io.narayana.lra.client.internal.proxy.nonjaxrs.LRAParticipantResource -------------------------------------------------------------------------------- /rts/lra/trip-controller/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Quarkus Configuration file 2 | # key = value 3 | quarkus.arc.exclude-types=io.narayana.lra.filter.ServerLRAFilter,io.narayana.lra.client.internal.proxy.nonjaxrs.LRAParticipantResource -------------------------------------------------------------------------------- /transactionaldriver/transactionaldriver-standalone/src/main/resources/ds1.pg.properties: -------------------------------------------------------------------------------- 1 | xaDataSourceClassName=org.postgresql.xa.PGXADataSource 2 | ServerName=localhost 3 | PortNumber=5432 4 | DatabaseName=crashrec 5 | User=crashrec 6 | Password=crashrec -------------------------------------------------------------------------------- /transactionaldriver/transactionaldriver-standalone/src/main/resources/ds2.pg.properties: -------------------------------------------------------------------------------- 1 | xaDataSourceClassName=org.postgresql.xa.PGXADataSource 2 | ServerName=localhost 3 | PortNumber=5432 4 | DatabaseName=crashrec 5 | User=crashrec 6 | Password=crashrec -------------------------------------------------------------------------------- /ArjunaJTS/interop/test-ejbs/src/main/java/service/remote/ISessionHome.java: -------------------------------------------------------------------------------- 1 | package service.remote; 2 | 3 | public interface ISessionHome extends jakarta.ejb.EJBHome { 4 | public service.remote.ISession create() throws java.rmi.RemoteException; 5 | } 6 | -------------------------------------------------------------------------------- /transactionaldriver/transactionaldriver-standalone/src/main/java/io/narayana/util/RunnableWithException.java: -------------------------------------------------------------------------------- 1 | package io.narayana.util; 2 | 3 | @FunctionalInterface 4 | public interface RunnableWithException { 5 | public void run() throws Throwable; 6 | } -------------------------------------------------------------------------------- /rts/lra-examples/cdi-participant/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Quarkus Configuration file 2 | # key = value 3 | quarkus.arc.exclude-types=io.narayana.lra.filter.ServerLRAFilter,io.narayana.lra.client.internal.proxy.nonjaxrs.LRAParticipantResource 4 | -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/rpc/src/main/java/com/arjuna/xts/nightout/services/Theatre/ITheatreService.java: -------------------------------------------------------------------------------- 1 | package com.arjuna.xts.nightout.services.Theatre; 2 | 3 | public interface ITheatreService 4 | { 5 | 6 | public void bookSeats(int how_many, int which_area); 7 | } -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/rpc/src/main/java/com/arjuna/xts/nightout/services/Theatre/ITheatreServiceBA.java: -------------------------------------------------------------------------------- 1 | package com.arjuna.xts.nightout.services.Theatre; 2 | 3 | public interface ITheatreServiceBA 4 | { 5 | 6 | public boolean bookSeats(int how_many, int which_area); 7 | } -------------------------------------------------------------------------------- /rts/at/jta-service/jms/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jakarta.ws.rs.core.Application 6 | /* 7 | 8 | -------------------------------------------------------------------------------- /rts/at/jta-service/jpa/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jakarta.ws.rs.core.Application 6 | /* 7 | 8 | -------------------------------------------------------------------------------- /rts/lra/foo.sh: -------------------------------------------------------------------------------- 1 | oc create -f - << EOF! 2 | apiVersion: v1 3 | kind: PersistentVolume 4 | metadata: 5 | generateName: pv- 6 | spec: 7 | capacity: 8 | storage: 2Gi 9 | accessModes: 10 | - ReadWriteOnce 11 | persistentVolumeReclaimPolicy: Recycle 12 | EOF! -------------------------------------------------------------------------------- /STM/jta/src/main/java/Atomic.java: -------------------------------------------------------------------------------- 1 | import org.jboss.stm.annotations.Optimistic; 2 | import org.jboss.stm.annotations.Transactional; 3 | 4 | @Transactional 5 | @Optimistic 6 | public interface Atomic { 7 | public int get(); 8 | 9 | public void set(int value); 10 | } -------------------------------------------------------------------------------- /rts/lra-examples/cdi-embedded/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | quarkus.arc.exclude-types=io.narayana.lra.client.internal.proxy.nonjaxrs.LRAParticipantRegistry,io.narayana.lra.filter.ServerLRAFilter,io.narayana.lra.client.internal.proxy.nonjaxrs.LRAParticipantResource 2 | -------------------------------------------------------------------------------- /ArjunaJTS/interop/test-ejbs/src/main/java/service/local/ISession.java: -------------------------------------------------------------------------------- 1 | package service.local; 2 | 3 | import jakarta.ejb.Local; 4 | 5 | // Extending remote interface for convenience of method declaration 6 | @Local 7 | public interface ISession extends service.remote.ISession { 8 | } -------------------------------------------------------------------------------- /STM/optimistic/src/main/java/Atomic.java: -------------------------------------------------------------------------------- 1 | import org.jboss.stm.annotations.Optimistic; 2 | import org.jboss.stm.annotations.Transactional; 3 | 4 | @Transactional 5 | @Optimistic 6 | public interface Atomic { 7 | public int get(); 8 | 9 | public void set(int value); 10 | } -------------------------------------------------------------------------------- /rts/at/undertow/run.sh: -------------------------------------------------------------------------------- 1 | # ALLOW JOBS TO RUN IN THE BACKGROUND 2 | set -m 3 | 4 | echo "Running rest-at with undertow quickstart" 5 | 6 | mvn clean package && java -jar target/rts-undertow-qs.jar 7 | 8 | if [ "$?" != "0" ]; then 9 | exit -1 10 | else 11 | exit 0 12 | fi 13 | -------------------------------------------------------------------------------- /ArjunaCore/txoj/run.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | echo "Running txoj quickstart" 4 | 5 | IF NOT %QUICKSTART_NARAYANA_VERSION%x == x SET NARAYANA_VERSION_PARAM="-Dversion.narayana=${QUICKSTART_NARAYANA_VERSION}" 6 | 7 | mvn compile exec:exec %NARAYANA_VERSION_PARAM% 8 | IF %ERRORLEVEL% NEQ 0 exit -1 9 | -------------------------------------------------------------------------------- /STM/README.md: -------------------------------------------------------------------------------- 1 | OVERVIEW 2 | -------- 3 | This folder contains a set of examples of how to use the STM framework. More information is provided on STM in our documentation on http://narayana.io/documentation/ 4 | 5 | 6 | USAGE 7 | ----- 8 | cd into the required quickstart and follow the README.md -------------------------------------------------------------------------------- /rts/lra-examples/coordinator-quarkus/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # native 2 | quarkus.native.additional-build-args=-H:ReflectionConfigurationFiles=reflection-config.json 3 | quarkus.ssl.native=true 4 | 5 | # allow Swagger in prod mode 6 | quarkus.swagger-ui.always-include=true 7 | -------------------------------------------------------------------------------- /ArjunaJTA/maven/run.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | echo "Running maven quickstart" 4 | 5 | IF NOT %QUICKSTART_NARAYANA_VERSION%x == x SET NARAYANA_VERSION_PARAM="-Dversion.narayana=${QUICKSTART_NARAYANA_VERSION}" 6 | 7 | mvn compile exec:exec %NARAYANA_VERSION_PARAM% 8 | IF %ERRORLEVEL% NEQ 0 exit -1 9 | -------------------------------------------------------------------------------- /ArjunaJTS/recovery/src/main/java/ExampleXAResource2.java: -------------------------------------------------------------------------------- 1 | public class ExampleXAResource2 extends AbstractExampleXAResource { 2 | public ExampleXAResource2() { 3 | super(false); 4 | } 5 | 6 | public ExampleXAResource2(boolean recovered) { 7 | super(recovered); 8 | } 9 | } -------------------------------------------------------------------------------- /rts/lra-examples/cdi-participant/src/main/java/io/narayana/rts/lra/JaxRsActivator.java: -------------------------------------------------------------------------------- 1 | package io.narayana.rts.lra; 2 | 3 | import jakarta.ws.rs.ApplicationPath; 4 | import jakarta.ws.rs.core.Application; 5 | 6 | @ApplicationPath("/") 7 | public class JaxRsActivator extends Application { 8 | } 9 | -------------------------------------------------------------------------------- /transactionaldriver/transactionaldriver-standalone/src/main/resources/recovery-jdbcxa-test1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ds1 4 | 5 | 6 | -------------------------------------------------------------------------------- /ArjunaJTA/jakarta_transaction/run.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | echo "Running maven quickstart" 4 | 5 | IF NOT %QUICKSTART_NARAYANA_VERSION%x == x SET NARAYANA_VERSION_PARAM="-Dversion.narayana=${QUICKSTART_NARAYANA_VERSION}" 6 | 7 | mvn compile exec:exec %NARAYANA_VERSION_PARAM% 8 | IF %ERRORLEVEL% NEQ 0 exit -1 9 | -------------------------------------------------------------------------------- /rts/lra/hotel-service/src/main/java/io/narayana/rts/lra/demo/hotel/JaxRsActivator.java: -------------------------------------------------------------------------------- 1 | package io.narayana.rts.lra.demo.hotel; 2 | 3 | import jakarta.ws.rs.ApplicationPath; 4 | import jakarta.ws.rs.core.Application; 5 | 6 | @ApplicationPath("/") 7 | public class JaxRsActivator extends Application { 8 | } 9 | -------------------------------------------------------------------------------- /ArjunaJTS/recovery/src/main/java/ExampleXAResource1.java: -------------------------------------------------------------------------------- 1 | public class ExampleXAResource1 extends AbstractExampleXAResource { 2 | 3 | public ExampleXAResource1() { 4 | super(false); 5 | } 6 | 7 | public ExampleXAResource1(boolean recovered) { 8 | super(recovered); 9 | } 10 | } -------------------------------------------------------------------------------- /rts/lra/flight-service/src/main/java/io/narayana/rts/lra/demo/flight/JaxRsActivator.java: -------------------------------------------------------------------------------- 1 | package io.narayana.rts.lra.demo.flight; 2 | 3 | import jakarta.ws.rs.ApplicationPath; 4 | import jakarta.ws.rs.core.Application; 5 | 6 | @ApplicationPath("/") 7 | public class JaxRsActivator extends Application { 8 | } 9 | -------------------------------------------------------------------------------- /rts/lra/trip-controller/src/main/java/io/narayana/rts/lra/demo/tripcontroller/JaxRsActivator.java: -------------------------------------------------------------------------------- 1 | package io.narayana.rts.lra.demo.tripcontroller; 2 | 3 | import jakarta.ws.rs.ApplicationPath; 4 | import jakarta.ws.rs.core.Application; 5 | 6 | @ApplicationPath("/") 7 | public class JaxRsActivator extends Application { 8 | } 9 | -------------------------------------------------------------------------------- /ArjunaJTS/interop/glassfish/step4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source init.sh 3 | set -ex 4 | 5 | cd $QS_DIR 6 | # deploy ejbs to glassfish 7 | ./ejb_operations.sh -a gf1 -f "${QS_DIR}/../test-ejbs/target/ejbtest.war" 8 | 9 | # deploy ejbs to WildFly 10 | ./ejb_operations.sh -a wf1 -f "${QS_DIR}/../test-ejbs/target/ejbtest.war" 11 | -------------------------------------------------------------------------------- /STM/optimistic/README.md: -------------------------------------------------------------------------------- 1 | OVERVIEW 2 | -------- 3 | This example demonstrates usage of an STM object that wishes to be executed under an optimistic concurrency control manner. 4 | 5 | More information is provided on STM in our documentation on http://narayana.io/documentation/ 6 | 7 | USAGE 8 | ----- 9 | mvn clean install exec:exec -------------------------------------------------------------------------------- /STM/pessimistic/README.md: -------------------------------------------------------------------------------- 1 | OVERVIEW 2 | -------- 3 | This example demonstrates usage of an STM object that wishes to be executed under an pessimistic concurrency control manner. 4 | 5 | More information is provided on STM in our documentation on http://narayana.io/documentation/ 6 | 7 | USAGE 8 | ----- 9 | mvn clean install exec:exec -------------------------------------------------------------------------------- /rts/at/jta-service/jms/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /rts/at/jta-service/jpa/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /STM/pessimistic/src/main/java/Atomic.java: -------------------------------------------------------------------------------- 1 | import org.jboss.stm.annotations.Pessimistic; 2 | import org.jboss.stm.annotations.Transactional; 3 | 4 | @Transactional 5 | @Pessimistic 6 | // this is the default - so optional here 7 | public interface Atomic { 8 | public int get(); 9 | 10 | public void set(int value); 11 | } -------------------------------------------------------------------------------- /compensating-transactions/travel-agent/src/main/java/org/jboss/narayana/quickstarts/compensationsApi/hotel/BookingStatus.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.compensationsApi.hotel; 2 | 3 | /** 4 | * @author paul.robinson@redhat.com 30/01/2013 5 | */ 6 | public enum BookingStatus { 7 | 8 | NOT_EXIST, CONFIRMED, PENDING, CANCELLED 9 | } -------------------------------------------------------------------------------- /compensating-transactions/travel-agent/src/main/java/org/jboss/narayana/quickstarts/compensationsApi/taxi2/BookingStatus.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.compensationsApi.taxi2; 2 | 3 | /** 4 | * @author paul.robinson@redhat.com 30/01/2013 5 | */ 6 | public enum BookingStatus { 7 | 8 | NOT_EXIST, CONFIRMED, PENDING, CANCELLED 9 | } -------------------------------------------------------------------------------- /jts-atomic-app/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM projectatomic/atomicapp:0.4.4 2 | 3 | MAINTAINER Gytis Trikleris 4 | 5 | LABEL io.projectatomic.nulecule.providers="docker" \ 6 | io.projectatomic.nulecule.specversion="0.0.2" 7 | 8 | ADD /Nulecule /Dockerfile /application-entity/ 9 | ADD /artifacts /application-entity/artifacts 10 | -------------------------------------------------------------------------------- /rts/at/undertow/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /jpms/jta/txuser/src/main/io.narayana.txuser/io/narayana/txuser/TxUserException.java: -------------------------------------------------------------------------------- 1 | package io.narayana.txuser; 2 | 3 | public class TxUserException extends Exception { 4 | public TxUserException(Exception e) { 5 | super(e); 6 | } 7 | 8 | public TxUserException(String reason) { 9 | super(reason); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /wiki-example/src/org/jboss/jbossts/qa/astests/ejb2/EJB2Home.java: -------------------------------------------------------------------------------- 1 | package org.jboss.jbossts.qa.astests.ejb2; 2 | 3 | import jakarta.ejb.CreateException; 4 | import jakarta.ejb.EJBHome; 5 | import java.rmi.RemoteException; 6 | 7 | public interface EJB2Home extends EJBHome 8 | { 9 | EJB2Remote create() throws CreateException, RemoteException; 10 | } -------------------------------------------------------------------------------- /rts/at/service/service2/run.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | echo "Running recovery2 quickstart" 4 | 5 | mvn -f fail clean compile exec:java 6 | IF %ERRORLEVEL% EQU 0 exit -1 7 | echo "Recovering failed service - this could take up to 2 minutes" 8 | mvn -f recover compile exec:java 9 | IF %ERRORLEVEL% NEQ 0 exit -1 10 | echo "Service recovery example succeeded" 11 | -------------------------------------------------------------------------------- /rts/lra-examples/cdi-participant/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /ArjunaJTA/maven/run.sh: -------------------------------------------------------------------------------- 1 | 2 | # ALLOW JOBS TO BE BACKGROUNDED 3 | set -m 4 | 5 | echo "Running maven quickstart" 6 | 7 | [ "x$QUICKSTART_NARAYANA_VERSION" != 'x' ] &&\ 8 | NARAYANA_VERSION_PARAM="-Dversion.narayana=${QUICKSTART_NARAYANA_VERSION}" 9 | 10 | mvn compile exec:exec $NARAYANA_VERSION_PARAM 11 | if [ "$?" != "0" ]; then 12 | exit -1 13 | fi 14 | -------------------------------------------------------------------------------- /STM/jta/README.md: -------------------------------------------------------------------------------- 1 | OVERVIEW 2 | -------- 3 | This example shows a more advanced scenario of STM where an STM object is participating in a JTA demarcated transaction with an XAResource as the second participant. 4 | 5 | More information is provided on STM in our documentation on http://narayana.io/documentation/ 6 | 7 | USAGE 8 | ----- 9 | mvn clean install exec:exec -------------------------------------------------------------------------------- /rts/at/recovery/recovery2/run.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | echo "Running recovery2 quickstart" 4 | 5 | mvn -f fail clean compile exec:java 6 | IF %ERRORLEVEL% EQU 0 exit -1 7 | echo "Recovering failed service - this could take up to 2 minutes" 8 | mvn -f recover compile exec:java 9 | IF %ERRORLEVEL% NEQ 0 exit -1 10 | echo "Service recovery example succeeded" 11 | -------------------------------------------------------------------------------- /rts/lra-examples/cdi-embedded/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /ArjunaJTA/jakartaee_transactional_app/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /compensating-transactions/mongodb-simple/src/test/java/org/jboss/narayana/quickstarts/mongodb/simple/resources/JaxRsActivator.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.mongodb.simple.resources; 2 | 3 | import jakarta.ws.rs.ApplicationPath; 4 | import jakarta.ws.rs.core.Application; 5 | 6 | @ApplicationPath("/") 7 | public class JaxRsActivator extends Application { 8 | } -------------------------------------------------------------------------------- /jpms/jta/recovery/src/main/io.narayana.recovery/io/narayana/recovery/RecoveryException.java: -------------------------------------------------------------------------------- 1 | package io.narayana.recovery; 2 | 3 | public class RecoveryException extends Exception { 4 | public RecoveryException(Exception e) { 5 | super(e); 6 | } 7 | 8 | public RecoveryException(String reason) { 9 | super(reason); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /rts/at/annotation/hotel-service/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | -------------------------------------------------------------------------------- /rts/at/annotation/trip-service/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | -------------------------------------------------------------------------------- /ArjunaCore/txoj/run.sh: -------------------------------------------------------------------------------- 1 | 2 | # ALLOW JOBS TO BE BACKGROUNDED 3 | set -m 4 | 5 | echo "Running txoj quickstart" 6 | 7 | [ "x$QUICKSTART_NARAYANA_VERSION" != 'x' ] &&\ 8 | NARAYANA_VERSION_PARAM="-Dversion.narayana=${QUICKSTART_NARAYANA_VERSION}" 9 | 10 | set -x 11 | mvn compile exec:exec $NARAYANA_VERSION_PARAM 12 | if [ "$?" != "0" ]; then 13 | exit -1 14 | fi 15 | -------------------------------------------------------------------------------- /ArjunaJTS/interop/test-ejbs/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /rts/at/annotation/common-service/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | -------------------------------------------------------------------------------- /rts/at/annotation/flight-service/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | -------------------------------------------------------------------------------- /rts/lra/hotel-service/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM registry.access.redhat.com/ubi8/openjdk-21:1.18 2 | 3 | ENV JAVA_APP_JAR quarkus-run.jar 4 | ENV AB_ENABLED off 5 | # to get more info about the service in console you can add switch 6 | # -Dquarkus.log.level=TRACE 7 | ENV JAVA_OPTIONS -Xmx512m 8 | 9 | EXPOSE 8080 10 | 11 | ADD target/quarkus-app/quarkus-run.jar /deployments/ 12 | -------------------------------------------------------------------------------- /transactionaldriver/transactionaldriver-standalone/src/main/resources/recovery-basicxa-test1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ds1 5 | 6 | 7 | -------------------------------------------------------------------------------- /ArjunaJTA/jakarta_transaction/run.sh: -------------------------------------------------------------------------------- 1 | 2 | # ALLOW JOBS TO BE BACKGROUNDED 3 | set -m 4 | 5 | echo "Running maven quickstart" 6 | 7 | [ "x$QUICKSTART_NARAYANA_VERSION" != 'x' ] &&\ 8 | NARAYANA_VERSION_PARAM="-Dversion.narayana=${QUICKSTART_NARAYANA_VERSION}" 9 | 10 | mvn compile exec:exec $NARAYANA_VERSION_PARAM 11 | if [ "$?" != "0" ]; then 12 | exit -1 13 | fi 14 | -------------------------------------------------------------------------------- /spring/narayana-spring-boot/src/main/java/org/jboss/narayana/quickstart/spring/EntriesRepository.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.spring; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | /** 6 | * @author Gytis Trikleris 7 | */ 8 | interface EntriesRepository extends JpaRepository { 9 | } -------------------------------------------------------------------------------- /ArjunaJTS/interop/glassfish/step3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source init.sh 3 | set -ex 4 | 5 | # start jboss and put it into JTS mode 6 | [ -d "$JBOSS_HOME" ] || fatal "file not found: $JBOSS_HOME" 7 | cd $JBOSS_HOME 8 | ./bin/standalone.sh -c standalone-full.xml -Djboss.tx.node.id=1 -Dcom.arjuna.ats.jts.transactionServiceId=0 & 9 | executeJBossCli --file=$QS_DIR/configure-jts-transactions.cli -------------------------------------------------------------------------------- /ArjunaJTS/interop/test-ejbs/src/main/java/service/remote/ISession.java: -------------------------------------------------------------------------------- 1 | package service.remote; 2 | 3 | import jakarta.ejb.Remote; 4 | import java.rmi.RemoteException; 5 | 6 | //@Remote 7 | public interface ISession extends jakarta.ejb.EJBObject { 8 | String getNext() throws RemoteException; 9 | 10 | String getNext(String failureType) throws RemoteException; 11 | } 12 | -------------------------------------------------------------------------------- /spring/camel-with-narayana-spring-boot/src/main/java/org/jboss/narayana/quickstart/spring/UserRepository.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.spring; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | /** 6 | * @author 8 | -------------------------------------------------------------------------------- /PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thanks for submitting your Pull Request! 2 | 3 | Please make sure your PR meets the following requirements: 4 | - [ ] Pull Request title is properly formatted: JBTM-XYZ Subject 5 | - [ ] Pull Request contains link to the JIRA issue(s) 6 | - [ ] For new quickstarts, you should add it to the list in the top level README and you can mark it with some labels (if you wish) 7 | -------------------------------------------------------------------------------- /spring/stock-market-with-narayana-spring-boot/src/main/java/org/jboss/narayana/quickstart/spring/UserRepository.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.spring; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | /** 6 | * @author Gytis Trikleris 7 | */ 8 | public interface UserRepository extends JpaRepository { 9 | } -------------------------------------------------------------------------------- /ArjunaJTS/interop/glassfish/step2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source init.sh 3 | set -ex 4 | 5 | # Start a glassfish server 6 | cd $QS_DIR 7 | 8 | export PATH=$GLASSFISH/bin:$PATH 9 | 10 | #asadmin start-domain --debug --verbose domain1 11 | asadmin start-domain domain1 12 | asadmin set configs.config.server-config.network-config.network-listeners.network-listener.http-listener-1.port=7080 13 | 14 | -------------------------------------------------------------------------------- /spring/stock-market-with-narayana-spring-boot/src/main/java/org/jboss/narayana/quickstart/spring/ShareRepository.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.spring; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | /** 6 | * @author Gytis Trikleris 7 | */ 8 | public interface ShareRepository extends JpaRepository { 9 | } -------------------------------------------------------------------------------- /jts-atomic-app/Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure(2) do |config| 2 | config.vm.box = "Fedora-Cloud-Atomic-Vagrant-23-20160308.x86_64.vagrant-virtualbox" 3 | config.vm.box_url = "https://download.fedoraproject.org/pub/alt/atomic/stable/Cloud-Images/x86_64/Images/Fedora-Cloud-Atomic-Vagrant-23-20160308.x86_64.vagrant-virtualbox.box" 4 | 5 | config.vm.network "private_network", ip: "192.168.33.10" 6 | end 7 | -------------------------------------------------------------------------------- /wiki-example/resources/jbossts-properties.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 1 6 | true 7 | false 8 | -------------------------------------------------------------------------------- /STM/jta/src/main/java/ExampleSTM.java: -------------------------------------------------------------------------------- 1 | import org.jboss.stm.annotations.ReadLock; 2 | import org.jboss.stm.annotations.WriteLock; 3 | 4 | public class ExampleSTM implements Atomic { 5 | @ReadLock 6 | public int get() { 7 | return state; 8 | } 9 | 10 | @WriteLock 11 | public void set(int value) 12 | { 13 | state = value; 14 | } 15 | 16 | private int state; 17 | } -------------------------------------------------------------------------------- /jts-docker/src/test/resources/jbossts-properties.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 1 6 | NAME_SERVICE 7 | NAME_SERVICE 8 | -------------------------------------------------------------------------------- /rts/at/recovery/recovery1/run.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | echo "Running recovery1 quickstart" 4 | 5 | mvn -f fail clean compile exec:java 6 | rem We expect this to fail so exit if it does not 7 | IF %ERRORLEVEL% EQU 0 exit -1 8 | echo "Recovering failed service - this could take up to 2 minutes" 9 | mvn -f recover compile exec:java 10 | IF %ERRORLEVEL% NEQ 0 exit -1 11 | echo "Service recovery example succeeded" 12 | -------------------------------------------------------------------------------- /STM/optimistic/src/main/java/ExampleSTM.java: -------------------------------------------------------------------------------- 1 | import org.jboss.stm.annotations.ReadLock; 2 | import org.jboss.stm.annotations.WriteLock; 3 | 4 | public class ExampleSTM implements Atomic { 5 | @ReadLock 6 | public int get() { 7 | return state; 8 | } 9 | 10 | @WriteLock 11 | public void set(int value) 12 | { 13 | state = value; 14 | } 15 | 16 | private int state; 17 | } -------------------------------------------------------------------------------- /STM/pessimistic/src/main/java/ExampleSTM.java: -------------------------------------------------------------------------------- 1 | import org.jboss.stm.annotations.ReadLock; 2 | import org.jboss.stm.annotations.WriteLock; 3 | 4 | public class ExampleSTM implements Atomic { 5 | @ReadLock 6 | public int get() { 7 | return state; 8 | } 9 | 10 | @WriteLock 11 | public void set(int value) 12 | { 13 | state = value; 14 | } 15 | 16 | private int state; 17 | } -------------------------------------------------------------------------------- /jta-and-hibernate-standalone/src/main/java/org/jboss/narayana/quickstart/jta/QuickstartRuntimeException.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.jta; 2 | 3 | /** 4 | * @author Gytis Trikleris 5 | */ 6 | public class QuickstartRuntimeException extends RuntimeException { 7 | 8 | public QuickstartRuntimeException(String message) { 9 | super(message); 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /agroal/src/main/resources/logging.properties: -------------------------------------------------------------------------------- 1 | # setting what handlers to use and what is root logging level 2 | handlers = java.util.logging.ConsoleHandler 3 | .level = ALL 4 | # settings the console formatter 5 | java.util.logging.ConsoleHandler.level = ALL 6 | java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter 7 | java.util.logging.SimpleFormatter.format = %4$s: [%1$tb %1$td, %1$tY %1$tl:%1$tM:%1$tS] [%2$s] %5$s%n 8 | -------------------------------------------------------------------------------- /wildfly/setCheckedActionFactoryExample/src/main/webapp/WEB-INF/faces-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /rts/lra-examples/lra-jwt/wildfly/restore-configuration.cli: -------------------------------------------------------------------------------- 1 | batch 2 | 3 | /subsystem=undertow/application-security-domain=other:remove() 4 | 5 | /subsystem=elytron/http-authentication-factory=jwt-http-authentication:remove() 6 | 7 | /subsystem=elytron/security-domain=jwt-domain:remove() 8 | 9 | /subsystem=elytron/token-realm=jwt-realm:remove() 10 | 11 | /subsystem=elytron/key-store=jwt-key-store:remove() 12 | 13 | run-batch 14 | 15 | reload -------------------------------------------------------------------------------- /rts/lra/flight-service/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM registry.access.redhat.com/ubi8/openjdk-21:1.18 2 | 3 | ENV JAVA_APP_JAR quarkus-run.jar 4 | ENV AB_ENABLED off 5 | # to get more info about the service in console you can add switch 6 | # -Dquarkus.log.level=TRACE 7 | ENV JAVA_OPTIONS -Xmx512m -Dlra.coordinator.url="http://flight-lra-coordinator:8080/lra-coordinator" 8 | 9 | EXPOSE 8080 10 | 11 | ADD target/quarkus-app/quarkus-run.jar /deployments/ 12 | -------------------------------------------------------------------------------- /ArjunaJTS/interop/glassfish/step7.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source init.sh 3 | set -x 4 | set +e 5 | 6 | # undeploy ejbs and stop GlassFish 7 | export PATH=$GLASSFISH/bin:$PATH 8 | asadmin --port 4848 undeploy ejbtest 9 | asadmin stop-domain domain1 10 | 11 | # undeploy ejbs and stop WildFly 12 | [ -d "$JBOSS_HOME" ] || fatal "file not found: $JBOSS_HOME" 13 | waitForJBossToBeRunning 14 | ${JBOSS_HOME}/bin/jboss-cli.sh --connect --command=':shutdown' 15 | -------------------------------------------------------------------------------- /rts/at/annotation/common-service/src/main/java/io/narayana/sra/demo/service/BookingException.java: -------------------------------------------------------------------------------- 1 | package io.narayana.sra.demo.service; 2 | 3 | public class BookingException extends Exception { 4 | int reason; 5 | 6 | public BookingException(int reason, String message) { 7 | super(message); 8 | 9 | this.reason = reason; 10 | 11 | } 12 | 13 | public int getReason() { 14 | return reason; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /rts/lra/trip-controller/src/main/java/io/narayana/rts/lra/demo/tripcontroller/BookingException.java: -------------------------------------------------------------------------------- 1 | package io.narayana.rts.lra.demo.tripcontroller; 2 | 3 | public class BookingException extends RuntimeException { 4 | int reason; 5 | 6 | public BookingException(int reason, String message) { 7 | super(message); 8 | 9 | this.reason = reason; 10 | } 11 | 12 | public int getReason() { 13 | return reason; 14 | } 15 | } -------------------------------------------------------------------------------- /spring/stock-market-with-narayana-spring-boot/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Enable embedded Artemis broker. 2 | spring.artemis.mode=embedded 3 | # Create updates queue. 4 | spring.artemis.embedded.queues=updates 5 | # Set transaction logs directory (optional) 6 | spring.jta.log-dir=./target/tx-object-store 7 | # By default empty username and password are needed to connect to H2. 8 | spring.jta.narayana.recoveryDbUser= 9 | spring.jta.narayana.recoveryDbPass= -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/rpc/src/main/java/com/arjuna/xts/nightout/clients/jboss/taxi/ITaxiServiceAT.java: -------------------------------------------------------------------------------- 1 | package com.arjuna.xts.nightout.clients.jboss.taxi ; 2 | 3 | import java.rmi.Remote; 4 | import java.rmi.RemoteException ; 5 | 6 | public interface ITaxiServiceAT extends Remote 7 | { 8 | 9 | /** 10 | * Book a taxi. 11 | * @throws RemoteException for communication errors. 12 | */ 13 | public void bookTaxi() throws RemoteException ; 14 | 15 | } -------------------------------------------------------------------------------- /transactionaldriver/transactionaldriver-standalone/src/main/resources/logging.properties: -------------------------------------------------------------------------------- 1 | # setting what handlers to use and what is root logging level 2 | handlers = java.util.logging.ConsoleHandler 3 | .level = ALL 4 | # settings the console formatter 5 | java.util.logging.ConsoleHandler.level = ALL 6 | java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter 7 | java.util.logging.SimpleFormatter.format = %4$s: [%1$tb %1$td, %1$tY %1$tl:%1$tM:%1$tS] [%2$s] %5$s%n 8 | -------------------------------------------------------------------------------- /spring/camel-with-narayana-spring-boot/src/main/java/org/jboss/narayana/quickstart/spring/UserBean.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.spring; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | /** 6 | * @author 2 | 3 | 4 | 10 | -------------------------------------------------------------------------------- /rts/at/undertow/run.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | echo "Running rest-at with undertow quickstart" 4 | 5 | mvn clean package 6 | IF %ERRORLEVEL% NEQ 0 exit -1 7 | 8 | if "x%JAVA_HOME%" == "x" ( 9 | set JAVA=java 10 | echo JAVA_HOME is not set. Unexpected results may occur. 11 | echo Set JAVA_HOME to the directory of your local JDK to avoid this message. 12 | ) else ( 13 | set "JAVA=%JAVA_HOME%\bin\java" 14 | ) 15 | 16 | "%JAVA%" -jar target\rts-undertow-qs.jar 17 | IF %ERRORLEVEL% NEQ 0 exit -1 18 | -------------------------------------------------------------------------------- /wildfly/commit-markable-resource/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | faces/index.xhtml 8 | 9 | -------------------------------------------------------------------------------- /compensating-transactions/travel-agent/README.md: -------------------------------------------------------------------------------- 1 | Travel Agent Quickstart 2 | ======================= 3 | 4 | Please follow the information [here](../../README.md#obtain-wildfly) to obtain WildFly. 5 | 6 | Currently the main documentation for this quickstart is the following two blog posts. Watch this space for more docs. 7 | 8 | https://jbossts.blogspot.co.uk/2013/06/compensating-transactions-when-acid-is_26.html 9 | https://jbossts.blogspot.co.uk/2013/07/compensating-transactions-when-acid-is.html 10 | -------------------------------------------------------------------------------- /rts/at/service/service2/run.sh: -------------------------------------------------------------------------------- 1 | # ALLOW JOBS TO BE BACKGROUNDED 2 | set -m 3 | 4 | echo "Running service2 quickstart" 5 | 6 | mvn -P fail clean compile exec:java 7 | 8 | # We expect this to fail 9 | [ "$?" != "0" ] || exit -1 10 | 11 | echo "Recovering failed service - this could take up to 2 minutes" 12 | mvn -P recover exec:java 13 | if [ "$?" != "0" ]; then 14 | echo "Service service2 example FAILED" 15 | exit -1 16 | else 17 | echo "Service service2 example SUCCEEDED" 18 | fi 19 | 20 | -------------------------------------------------------------------------------- /spring/jta/src/main/java/org/jboss/narayana/quickstart/spring/config/DummyXAConfig.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.spring.config; 2 | 3 | import org.jboss.narayana.quickstart.spring.xa.DummyXAResource; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | @Configuration 8 | public class DummyXAConfig { 9 | @Bean 10 | public DummyXAResource xaResource() { 11 | return new DummyXAResource(); 12 | } 13 | } -------------------------------------------------------------------------------- /rts/at/recovery/recovery2/run.sh: -------------------------------------------------------------------------------- 1 | # ALLOW JOBS TO BE BACKGROUNDED 2 | set -m 3 | 4 | echo "Running recovery2 quickstart" 5 | 6 | mvn -P fail clean compile exec:java 7 | 8 | # We expect this to fail 9 | [ "$?" != "0" ] || exit -1 10 | 11 | echo "Recovering failed service - this could take up to 2 minutes" 12 | mvn -P recover exec:java 13 | if [ "$?" != "0" ]; then 14 | echo "Service recovery2 example FAILED" 15 | exit -1 16 | else 17 | echo "Service recovery2 example SUCCEEDED" 18 | fi 19 | 20 | -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/rpc/src/main/java/com/arjuna/xts/nightout/services/Restaurant/IRestaurantService.java: -------------------------------------------------------------------------------- 1 | package com.arjuna.xts.nightout.services.Restaurant; 2 | 3 | public interface IRestaurantService 4 | { 5 | /** 6 | * Book a number of seats in the restaurant 7 | * Enrols a Participant if necessary, then passes 8 | * the call through to the business logic. 9 | * 10 | * @param how_many The number of seats to book 11 | */ 12 | public void bookSeats(int how_many); 13 | 14 | } -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/rpc/src/main/java/com/arjuna/xts/nightout/services/Restaurant/IRestaurantServiceBA.java: -------------------------------------------------------------------------------- 1 | package com.arjuna.xts.nightout.services.Restaurant; 2 | 3 | public interface IRestaurantServiceBA 4 | { 5 | /** 6 | * Book a number of seats in the restaurant 7 | * Enrols a Participant if necessary, then passes 8 | * the call through to the business logic. 9 | * 10 | * @param how_many The number of seats to book 11 | */ 12 | public boolean bookSeats(int how_many); 13 | 14 | } -------------------------------------------------------------------------------- /jpms/jta/txuser/src/main/io.narayana.txuser/module-info.java: -------------------------------------------------------------------------------- 1 | 2 | module io.narayana.txuser { 3 | // narayana is not modular so the compiler will generate a warning: 4 | // https://stackoverflow.com/questions/46501047/what-does-required-filename-based-automodules-detected-warning-mean 5 | requires narayana.jta; 6 | requires org.jboss.logging; 7 | requires jakarta.transaction; 8 | requires jakarta.annotation; 9 | requires java.transaction.xa; 10 | 11 | exports io.narayana.txuser; 12 | } 13 | -------------------------------------------------------------------------------- /spring/camel-with-narayana-spring-boot/src/main/java/org/jboss/narayana/quickstart/spring/HaltBean.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.spring; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | /** 6 | * @author 2 | 3 | 6 | 7 | 8 | ContextHandler 9 | com.arjuna.mw.wst11.service.JaxWSHeaderContextProcessor 10 | 11 | 12 | -------------------------------------------------------------------------------- /rts/lra-examples/cdi-embedded/src/main/resources/jbossts-properties.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1 5 | 6 | target/lra-logs 7 | 8 | target/lra-logs 9 | 10 | 11 | -------------------------------------------------------------------------------- /compensating-transactions/travel-agent/src/main/java/org/jboss/narayana/quickstarts/compensationsApi/taxi1/BookingUnavailableRuntimeException.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.compensationsApi.taxi1; 2 | 3 | /** 4 | * @author paul.robinson@redhat.com 18/09/2013 5 | */ 6 | public class BookingUnavailableRuntimeException extends RuntimeException { 7 | 8 | public BookingUnavailableRuntimeException(String s) { 9 | 10 | super(s); 11 | } 12 | 13 | public BookingUnavailableRuntimeException(String s, Throwable throwable) { 14 | 15 | super(s, throwable); 16 | } 17 | } -------------------------------------------------------------------------------- /rts/at/annotation/common-service/src/main/java/io/narayana/sra/demo/service/BookingExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package io.narayana.sra.demo.service; 2 | 3 | import jakarta.ws.rs.core.Response; 4 | import jakarta.ws.rs.ext.ExceptionMapper; 5 | import jakarta.ws.rs.ext.Provider; 6 | 7 | @Provider 8 | public class BookingExceptionMapper implements ExceptionMapper { 9 | @Override 10 | public Response toResponse(BookingException exception) { 11 | 12 | return Response.status(exception.getReason()) 13 | .entity(exception.getMessage()).build(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /rts/lra/trip-controller/src/main/java/io/narayana/rts/lra/demo/tripcontroller/BookingExceptionMapper.java: -------------------------------------------------------------------------------- 1 | package io.narayana.rts.lra.demo.tripcontroller; 2 | 3 | import jakarta.ws.rs.core.Response; 4 | import jakarta.ws.rs.ext.ExceptionMapper; 5 | import jakarta.ws.rs.ext.Provider; 6 | 7 | @Provider 8 | public class BookingExceptionMapper implements ExceptionMapper { 9 | @Override 10 | public Response toResponse(BookingException exception) { 11 | return Response.status(exception.getReason()) 12 | .entity(exception.getMessage()).build(); 13 | } 14 | } -------------------------------------------------------------------------------- /jta-and-hibernate-standalone/src/main/resources/jdbc-recovery.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | java:/quickstartDataSource 8 | 9 | sa 10 | 11 | 12 | -------------------------------------------------------------------------------- /jta-and-hibernate-standalone/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Set root logger level to DEBUG and its only appender to A1. 2 | log4j.rootLogger=WARN, A1 3 | 4 | # A1 is set to be a ConsoleAppender. 5 | log4j.appender.A1=org.apache.log4j.ConsoleAppender 6 | 7 | # A1 uses PatternLayout. 8 | log4j.appender.A1.layout=org.apache.log4j.PatternLayout 9 | log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n 10 | 11 | # Uncomment this to see transaction trace log. 12 | #log4j.logger.com.arjuna=TRACE 13 | 14 | # Uncomment this to see hibernate trace log. 15 | #log4j.logger.org.hibernate=TRACE 16 | -------------------------------------------------------------------------------- /ArjunaJTS/trailmap/src/main/java/com/arjuna/demo/jta/jdbcbank/NotExistingAccount.java: -------------------------------------------------------------------------------- 1 | package com.arjuna.demo.jta.jdbcbank; 2 | 3 | /** 4 | * This exception class should be used if the bank account requested by a user cannot be found. 5 | */ 6 | public class NotExistingAccount extends Exception 7 | { 8 | /** 9 | * Constructs a new instance of NotSupportedException using a message for explanation. 10 | * 11 | * @param message The reason that the exception has been raised. 12 | */ 13 | public NotExistingAccount(String message) 14 | { 15 | super(message); 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /ArjunaJTS/trailmap/src/main/java/com/arjuna/demo/jta/localbank/NotExistingAccount.java: -------------------------------------------------------------------------------- 1 | package com.arjuna.demo.jta.localbank; 2 | 3 | /** 4 | * This exception class should be used if the bank account requested by a user cannot be found. 5 | */ 6 | public class NotExistingAccount extends Exception 7 | { 8 | /** 9 | * Constructs a new instance of NotSupportedException using a message for explanation. 10 | * 11 | * @param message The reason that the exception has been raised. 12 | */ 13 | public NotExistingAccount(String message) 14 | { 15 | super(message); 16 | } 17 | } -------------------------------------------------------------------------------- /ArjunaJTS/trailmap/src/main/java/com/arjuna/demo/jts/localbank/NotExistingAccount.java: -------------------------------------------------------------------------------- 1 | package com.arjuna.demo.jts.localbank; 2 | 3 | /** 4 | * This exception class should be used if the bank account requested by a user cannot be found. 5 | */ 6 | public class NotExistingAccount extends Exception 7 | { 8 | /** 9 | * Constructs a new instance of NotSupportedException using a message for explanation. 10 | * 11 | * @param message The reason that the exception has been raised. 12 | */ 13 | public NotExistingAccount(String message) 14 | { 15 | super(message); 16 | } 17 | } -------------------------------------------------------------------------------- /rts/at/jta-service/jpa/src/main/java/org/jboss/narayana/quickstart/rest/bridge/inbound/jpa/model/UserTableDao.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.rest.bridge.inbound.jpa.model; 2 | 3 | import jakarta.ejb.Local; 4 | 5 | /** 6 | * Basic operations for manipulation with users 7 | * 8 | * @author Gytis Trikleris 9 | * @author Lukas Fryc 10 | * 11 | */ 12 | @Local 13 | public interface UserTableDao { 14 | 15 | public UserTable getForUsername(String username); 16 | 17 | public void createUser(UserTable user); 18 | 19 | public void deleteUsers(); 20 | } -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/rpc/src/main/java/com/arjuna/xts/nightout/clients/jboss/restaurant/IRestaurantServiceAT.java: -------------------------------------------------------------------------------- 1 | package com.arjuna.xts.nightout.clients.jboss.restaurant ; 2 | 3 | import java.rmi.Remote; 4 | import java.rmi.RemoteException ; 5 | 6 | public interface IRestaurantServiceAT extends Remote 7 | { 8 | 9 | /** 10 | * Book a specified number of seats at the restaurant. 11 | * @param numSeats The number of seats to book at the restaurant. 12 | * @throws RemoteException for communication errors. 13 | */ 14 | public void bookSeats(final int numSeats) throws RemoteException ; 15 | 16 | } -------------------------------------------------------------------------------- /tools/download-maven.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | MAVEN_VERSION=3.9.11 3 | MAVEN_URL=https://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.zip 4 | 5 | if [ -d tools ]; then 6 | #executed from root of WF install 7 | cd tools 8 | fi 9 | 10 | if [ -d maven ]; then 11 | echo "Maven already exists" 12 | if version=`./maven/bin/mvn -version | grep "Apache Maven $MAVEN_VERSION"`; then 13 | echo "Maven is correct version" 14 | exit 15 | fi 16 | fi 17 | 18 | rm -rf maven 19 | curl $MAVEN_URL >maven.zip 20 | unzip maven.zip 21 | rm maven.zip 22 | mv apache-maven* maven 23 | -------------------------------------------------------------------------------- /wildfly/setCheckedActionFactoryExample/src/main/java/org/narayana/CheckedActionFactoryExample.java: -------------------------------------------------------------------------------- 1 | package org.narayana; 2 | 3 | import java.io.Serializable; 4 | 5 | import jakarta.ejb.EJB; 6 | import jakarta.faces.bean.ApplicationScoped; 7 | import jakarta.inject.Named; 8 | 9 | import org.narayana.handler.MyEJB; 10 | 11 | @Named("CheckedActionFactoryExample") 12 | @ApplicationScoped 13 | public class CheckedActionFactoryExample implements Serializable { 14 | 15 | @EJB 16 | private MyEJB myEJB; 17 | 18 | public void call() { 19 | System.out.println("CheckedActionFactoryExample called"); 20 | myEJB.call(); 21 | } 22 | } -------------------------------------------------------------------------------- /jpms/jta/recovery/src/main/io.narayana.recovery/module-info.java: -------------------------------------------------------------------------------- 1 | 2 | module io.narayana.recovery { 3 | // narayana is not modular so the compiler will generate a warning: 4 | // https://stackoverflow.com/questions/46501047/what-does-required-filename-based-automodules-detected-warning-mean 5 | requires narayana.jta; 6 | requires org.jboss.logging; 7 | requires jakarta.transaction; 8 | requires jakarta.annotation; 9 | requires java.transaction.xa; 10 | requires jboss.transaction.spi; 11 | requires java.sql; 12 | requires io.narayana.config; 13 | 14 | exports io.narayana.recovery; 15 | } 16 | -------------------------------------------------------------------------------- /rts/at/annotation/stop-wildfly-coordinator.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Stop WildFly 4 | echo "Stopping WildFly..." 5 | #JBOSS_HOME="/home/mshikalw/Documents/AllGitFork/wildfly/build/target/wildfly-28.0.2.Final-SNAPSHOT" 6 | WILDFLY_BIN=$JBOSS_HOME/bin 7 | 8 | $WILDFLY_BIN/jboss-cli.sh --connect command=:shutdown 9 | 10 | # Wait for a few seconds to give time for the server to stop 11 | sleep 10 12 | 13 | # Check if WildFly is still running 14 | if $(jps | grep -q "jboss-modules"); then 15 | echo "Failed to stop WildFly. Please check the logs for more information." 16 | else 17 | echo "WildFly stopped successfully!" 18 | fi 19 | -------------------------------------------------------------------------------- /spring/stock-market-with-narayana-spring-boot/src/main/java/org/jboss/narayana/quickstart/spring/PortfolioEntryRepository.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.spring; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.rest.core.annotation.RepositoryRestResource; 5 | 6 | /** 7 | * @author Gytis Trikleris 8 | */ 9 | @RepositoryRestResource(exported = false) 10 | public interface PortfolioEntryRepository extends JpaRepository { 11 | 12 | PortfolioEntry findByUserAndShare(User user, Share share); 13 | 14 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .classpath 2 | .settings/ 3 | .project 4 | .metadata/ 5 | 6 | *.iml 7 | .idea 8 | 9 | target/ 10 | /tools/maven 11 | /tools/maven.zip 12 | 13 | .DS_Store 14 | ObjectStore/ 15 | PutObjectStoreDirHere/ 16 | 17 | ArjunaJTS/interop/glassfish/tmp/ 18 | 19 | instantclient_11_2/ 20 | jboss-as 21 | jbossesb-4.9.zip 22 | instantclient-basiclite-win32-11.2.0.1.0.zip 23 | instantclient-sdk-win32-11.2.0.1.0.zip 24 | *~ 25 | wildfly-10.x.zip 26 | wildfly-10.*/ 27 | wildfly-10.*.jar 28 | narayana-full-*-bin.zip 29 | jboss1/ 30 | jboss2/ 31 | bin/ 32 | db/ 33 | distributedjta-examples/ 34 | 35 | _nsdb_root 36 | orb.db/ 37 | **/*.db 38 | -------------------------------------------------------------------------------- /jta-1_2-in-wildfly/src/main/java/org/jboss/narayana/quickstarts/jta/TransactionScopedPojo.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.jta; 2 | 3 | import jakarta.transaction.TransactionScoped; 4 | import java.io.Serializable; 5 | 6 | /** 7 | * @author Gytis Trikleris 8 | */ 9 | @TransactionScoped 10 | public class TransactionScopedPojo implements Serializable { 11 | 12 | private int value = 0; 13 | 14 | public synchronized int getValue() { 15 | return value; 16 | } 17 | 18 | public synchronized void setValue(int value) { 19 | this.value = value; 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /rts/at/annotation/start-wildfly-coordinator.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Start WildFly 4 | echo "Starting WildFly..." 5 | #JBOSS_HOME="/home/mshikalw/Documents/AllGitFork/wildfly/build/target/wildfly-28.0.2.Final-SNAPSHOT" 6 | WILDFLY_BIN=$JBOSS_HOME/bin 7 | 8 | $WILDFLY_BIN/standalone.sh -c standalone-rts.xml > /dev/null 2>&1 & 9 | 10 | # Wait for a few seconds to give time for the server to start 11 | sleep 10 12 | 13 | # Check if WildFly is running 14 | if $(jps | grep -q "jboss-modules"); then 15 | echo "WildFly started successfully!" 16 | else 17 | echo "Failed to start WildFly. Please check the logs for more information." 18 | fi 19 | -------------------------------------------------------------------------------- /transactionaldriver/transactionaldriver-standalone/src/main/resources/xaexception.rmfail.btm: -------------------------------------------------------------------------------- 1 | 2 | RULE Fail on first commit call to XAResource 3 | INTERFACE ^javax.transaction.xa.XAResource 4 | METHOD commit 5 | AT ENTRY 6 | IF NOT flagged("is_failed") 7 | DO 8 | System.out.println("Failing by Byteman rule"); 9 | flag("is_failed"); 10 | throw new XAException(XAException.XAER_RMFAIL); 11 | ENDRULE 12 | 13 | RULE Reset flag for commit call to XAResource 14 | INTERFACE ^javax.transaction.xa.XAResource 15 | METHOD prepare 16 | AT ENTRY 17 | IF clear("is_failed") 18 | DO 19 | System.out.println("The flag 'is_failed' was reset"); 20 | ENDRULE 21 | -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/rpc/src/main/java/com/arjuna/xts/nightout/clients/jboss/restaurant/IRestaurantServiceBA.java: -------------------------------------------------------------------------------- 1 | package com.arjuna.xts.nightout.clients.jboss.restaurant ; 2 | 3 | import java.rmi.Remote; 4 | import java.rmi.RemoteException ; 5 | 6 | public interface IRestaurantServiceBA extends Remote 7 | { 8 | 9 | /** 10 | * Book a specified number of seats at the restaurant. 11 | * @param numSeats The number of seats to book at the restaurant. 12 | * @return true if successful, false otherwise 13 | * @throws RemoteException for communication errors. 14 | */ 15 | public boolean bookSeats(final int numSeats) throws RemoteException ; 16 | 17 | } -------------------------------------------------------------------------------- /agroal/src/main/resources/xaexception.rmfail.btm: -------------------------------------------------------------------------------- 1 | 2 | RULE Fail on first commit call to XAResource 3 | INTERFACE ^javax.transaction.xa.XAResource 4 | METHOD commit 5 | AT ENTRY 6 | IF NOT flagged("is_failed") 7 | DO 8 | setTriggering(false); 9 | System.out.println("Failing by Byteman rule"); 10 | flag("is_failed"); 11 | throw new javax.transaction.xa.XAException(javax.transaction.xa.XAException.XAER_RMFAIL); 12 | ENDRULE 13 | 14 | RULE Reset flag for commit call to XAResource 15 | INTERFACE ^javax.transaction.xa.XAResource 16 | METHOD prepare 17 | AT ENTRY 18 | IF clear("is_failed") 19 | DO 20 | System.out.println("The flag 'is_failed' was reset"); 21 | ENDRULE 22 | -------------------------------------------------------------------------------- /wiki-example/src/org/jboss/jbossts/qa/astests/META-INF/jboss.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | OTSEjb2StatelessBean 7 | OTSEjb2StatelessBean 8 | 9 | 10 | iiop 11 | 12 | 13 | 14 | 15 | 16 | Ejb2StatelessBean 17 | Ejb2StatelessBean 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring/stock-market-with-narayana-spring-boot/src/main/java/org/jboss/narayana/quickstart/spring/MessageListener.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.spring; 2 | 3 | import org.springframework.jms.annotation.JmsListener; 4 | import org.springframework.stereotype.Component; 5 | 6 | /** 7 | * Listener listens for the messages in the "update" queue and writes them to the log. 8 | * 9 | * @author Gytis Trikleris 10 | */ 11 | @Component 12 | public class MessageListener { 13 | 14 | @JmsListener(destination = "updates") 15 | public void onMessage(String content) { 16 | System.out.println("----> " + content); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /spring/stock-market-with-narayana-spring-boot/src/main/java/org/jboss/narayana/quickstart/spring/StockMarketApplication.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.spring; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.jta.narayana.DbcpXADataSourceWrapper; 6 | import org.springframework.context.annotation.Import; 7 | 8 | @SpringBootApplication 9 | @Import(DbcpXADataSourceWrapper.class) 10 | public class StockMarketApplication { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(StockMarketApplication.class, args); 14 | } 15 | } -------------------------------------------------------------------------------- /ArjunaJTA/jakartaee_transactional_app/src/main/webapp/count.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 |

Customer Count

11 | 12 | Go Back 13 |
14 |
15 | 16 | -------------------------------------------------------------------------------- /ArjunaJTA/jakartaee_transactional_app/src/main/webapp/duplicate.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 |

Customer Already Existed

11 | 12 | Go Back 13 |
14 |
15 | 16 | -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/rpc/src/main/java/com/arjuna/xts/nightout/clients/jboss/theatre/ITheatreServiceAT.java: -------------------------------------------------------------------------------- 1 | package com.arjuna.xts.nightout.clients.jboss.theatre ; 2 | 3 | import java.rmi.Remote; 4 | import java.rmi.RemoteException ; 5 | 6 | public interface ITheatreServiceAT extends Remote 7 | { 8 | 9 | /** 10 | * Book a specified number of seats in a specific area of the theatre. 11 | * @param numSeats The number of seats to book at the theatre. 12 | * @param area The area of the seats. 13 | * @throws RemoteException for communication errors. 14 | */ 15 | public void bookSeats(final int numSeats, final int area) 16 | throws RemoteException ; 17 | 18 | } -------------------------------------------------------------------------------- /jts-docker/src/test/resources/docker-narayana-config/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.category.com.arjuna=TRACE, default, stdout 2 | 3 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n 6 | log4j.appender.stdout.Threshold=TRACE 7 | 8 | log4j.appender.default=org.apache.log4j.RollingFileAppender 9 | log4j.appender.default.File=transaction.log 10 | log4j.appender.default.MaxFileSize=500KB 11 | log4j.appender.default.MaxBackupIndex=2 12 | log4j.appender.default.layout=org.apache.log4j.PatternLayout 13 | log4j.appender.default.layout.ConversionPattern=%d [%t] %-5p %c - %m%n 14 | -------------------------------------------------------------------------------- /wildfly/commit-markable-resource/src/main/java/org/jboss/narayana/quickstarts/cmr/BookProcessorLrco.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.cmr; 2 | 3 | import jakarta.enterprise.context.RequestScoped; 4 | import jakarta.inject.Named; 5 | import jakarta.persistence.EntityManager; 6 | import jakarta.persistence.PersistenceContext; 7 | import jakarta.transaction.Transactional; 8 | 9 | @Named 10 | @RequestScoped 11 | @Transactional 12 | public class BookProcessorLrco extends BookProcessor { 13 | 14 | @PersistenceContext(unitName = "jdbc-datasource") 15 | private EntityManager em; 16 | 17 | @Override 18 | protected EntityManager getEntityManager() { 19 | return em; 20 | } 21 | } -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/core/src/main/java/com/jboss/jbosstm/xts/demo/taxi/ITaxiServiceAT.java: -------------------------------------------------------------------------------- 1 | package com.jboss.jbosstm.xts.demo.taxi; 2 | 3 | import jakarta.jws.WebMethod; 4 | import jakarta.jws.WebService; 5 | import jakarta.jws.soap.SOAPBinding; 6 | 7 | 8 | /** 9 | * This class was generated by the JAX-WS RI. 10 | * JAX-WS RI 2.1.2-hudson-182-RC1 11 | * Generated source version: 2.0 12 | * 13 | */ 14 | @WebService(name = "ITaxiServiceAT", targetNamespace = "http://www.jboss.com/jbosstm/xts/demo/Taxi") 15 | @SOAPBinding(style = SOAPBinding.Style.RPC) 16 | public interface ITaxiServiceAT { 17 | 18 | 19 | /** 20 | * 21 | */ 22 | @WebMethod 23 | public void bookTaxi(); 24 | 25 | } -------------------------------------------------------------------------------- /wildfly/commit-markable-resource/src/main/java/org/jboss/narayana/quickstarts/cmr/BookProcessorCmr.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.cmr; 2 | 3 | import jakarta.enterprise.context.RequestScoped; 4 | import jakarta.inject.Named; 5 | import jakarta.persistence.EntityManager; 6 | import jakarta.persistence.PersistenceContext; 7 | import jakarta.transaction.Transactional; 8 | 9 | @Named 10 | @RequestScoped 11 | @Transactional 12 | public class BookProcessorCmr extends BookProcessor { 13 | 14 | @PersistenceContext(unitName = "jdbc-cmr-datasource") 15 | private EntityManager em; 16 | 17 | @Override 18 | protected EntityManager getEntityManager() { 19 | return em; 20 | } 21 | } -------------------------------------------------------------------------------- /ArjunaJTS/standalone/run.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | IF NOT %QUICKSTART_NARAYANA_VERSION%x == x SET NARAYANA_VERSION_PARAM="-Dversion.narayana=${QUICKSTART_NARAYANA_VERSION}" 4 | 5 | echo "Running JTS standalone using OpenJDK ORB" 6 | mvn -e exec:java -Dexec.cleanupDaemonThreads=false -Dexec.mainClass=org.jboss.narayana.jta.quickstarts.TransactionExample -DOrbPortabilityEnvironmentBean.orbDataClassName=com.arjuna.orbportability.internal.orbspecific.versions.javaidl_1_4 -DOrbPortabilityEnvironmentBean.orbImpleClassName=com.arjuna.orbportability.internal.orbspecific.javaidl.orb.implementations.javaidl_1_4 %NARAYANA_VERSION_PARAM% 7 | IF %ERRORLEVEL% NEQ 0 exit -1 8 | 9 | echo "JTS standalone example succeeded" 10 | 11 | -------------------------------------------------------------------------------- /XTS/wsat-jta-multi_service/src/test/resources/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | java:jboss/datasources/ExampleDS 10 | 11 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /transactionaldriver/transactionaldriver-standalone/src/main/java/io/narayana/util/TestInitialContextFactory.java: -------------------------------------------------------------------------------- 1 | package io.narayana.util; 2 | 3 | import java.util.Hashtable; 4 | import javax.naming.Context; 5 | import javax.naming.NamingException; 6 | import javax.naming.spi.InitialContextFactory; 7 | 8 | /** 9 | * Initial context returning stub of {@link TestContext} for quickstart. 10 | */ 11 | public class TestInitialContextFactory implements InitialContextFactory { 12 | private static final Context testContext = new TestContext(); 13 | 14 | @Override 15 | public Context getInitialContext(Hashtable environment) throws NamingException { 16 | return testContext; 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /XTS/wsat-jta-multi_hop/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | java:jboss/datasources/ExampleDS 10 | 11 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /XTS/wsat-jta-multi_service/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | java:jboss/datasources/ExampleDS 10 | 11 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /compensating-transactions/travel-agent/src/test/resources/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | java:jboss/datasources/ExampleDS 10 | 11 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /rts/at/jta-service/jpa/src/test/resources/arquillian.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | ${modular.jdk.args} ${server.jvm.args} 9 | standalone-rts.xml 10 | ${node.address} 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring/camel-with-narayana-spring-boot/src/main/java/org/jboss/narayana/quickstart/spring/CamelApplication.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.spring; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.jta.narayana.DbcpXADataSourceWrapper; 6 | import org.springframework.context.annotation.Import; 7 | 8 | /** 9 | * @author HelloServer. It is a CORBA object that 6 | * provides transaction-aware operations, in this case a single operation print_hello(). 7 | * 8 | * If the print_hello command is issued within the scope of a transaction then the call will be executed within a 9 | * transaction. 10 | */ 11 | public class HelloImpl extends HelloPOA 12 | { 13 | /** 14 | * This method simply displays a greeting on the console. 15 | */ 16 | public void print_hello() 17 | { 18 | System.out.println("Hello - called within a scope of a transaction"); 19 | } 20 | } -------------------------------------------------------------------------------- /compensating-transactions/non-transactional_resource/src/main/java/org/jboss/narayana/quickstarts/nonTransactionalResource/bookService/DestroyInvoice.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.nonTransactionalResource.bookService; 2 | 3 | import org.jboss.narayana.compensations.api.CompensationHandler; 4 | 5 | import jakarta.inject.Inject; 6 | 7 | /** 8 | * @author paul.robinson@redhat.com 02/08/2013 9 | */ 10 | public class DestroyInvoice implements CompensationHandler { 11 | 12 | @Inject 13 | InvoiceData invoiceData; 14 | 15 | @Override 16 | public void compensate() { 17 | //Recall the package somehow 18 | System.out.println("Hunt down invoice with id '" + invoiceData.getInvoiceId() + "' and destroy it..."); 19 | } 20 | } -------------------------------------------------------------------------------- /jta-1_2-standalone/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 15 | -------------------------------------------------------------------------------- /rts/at/jta-service/jms/src/test/resources/arquillian.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | ${modular.jdk.args} ${server.jvm.args} 11 | standalone-rts.xml 12 | ${node.address} 13 | 14 | 15 | -------------------------------------------------------------------------------- /compensating-transactions/non-transactional_resource/src/main/java/org/jboss/narayana/quickstarts/nonTransactionalResource/bookService/RecallPackage.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.nonTransactionalResource.bookService; 2 | 3 | import org.jboss.narayana.compensations.api.CompensationHandler; 4 | 5 | import jakarta.inject.Inject; 6 | 7 | /** 8 | * @author paul.robinson@redhat.com 02/08/2013 9 | */ 10 | public class RecallPackage implements CompensationHandler { 11 | 12 | @Inject 13 | OrderData orderData; 14 | 15 | @Override 16 | public void compensate() { 17 | //Recall the package somehow 18 | System.out.println("Recalling the package containing '" + orderData.getItem() + "' addressed to '" + orderData.getAddress() + "'"); 19 | } 20 | } -------------------------------------------------------------------------------- /rts/lra-examples/README.md: -------------------------------------------------------------------------------- 1 | #MicroProfile LRA Examples 2 | 3 | [MicroProfile LRA](https://github.com/eclipse/microprofile-lra) is a specification of an annotation based API that 4 | enables loosely coupled services to coordinate long running activities in such a way as to 5 | guarantee a globally consistent outcome without the need to take long duration locks on data. 6 | 7 | First build the examples: 8 | 9 | > mvn clean package 10 | 11 | Two similar quickstarts are included: 12 | 13 | ## cdi-participant 14 | 15 | [Shows a service which registers with an external LRA coordinator using CDI annotations](#cdi-participant/README.md) 16 | 17 | ## cdi-embedded 18 | 19 | [Shows a service which registers with an embedded LRA coordinator using CDI annotations](#cdi-embedded/README.md) 20 | -------------------------------------------------------------------------------- /rts/at/annotation/hotel-service/src/main/java/io/narayana/sra/demo/service/HotelService.java: -------------------------------------------------------------------------------- 1 | package io.narayana.sra.demo.service; 2 | 3 | import io.narayana.sra.demo.model.Booking; 4 | 5 | import jakarta.enterprise.context.ApplicationScoped; 6 | import java.util.concurrent.CompletableFuture; 7 | 8 | @ApplicationScoped 9 | public class HotelService extends BookingStore { 10 | public Booking book(String bid, String hotel, Integer beds) { 11 | Booking booking = new Booking(bid, hotel, beds, "Hotel"); 12 | 13 | add(booking); 14 | 15 | return booking; 16 | } 17 | 18 | public CompletableFuture bookAsync(String bid, String hotel, Integer beds) { 19 | return CompletableFuture.supplyAsync(() -> book(bid, hotel, beds)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /spring/camel-with-narayana-spring-boot/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Artemis 2 | spring.artemis.mode=embedded 3 | spring.artemis.embedded.data-directory=./target/artemis 4 | spring.artemis.embedded.enabled=true 5 | spring.artemis.embedded.queues=foo,users,DLQ 6 | spring.artemis.embedded.persistent=true 7 | 8 | # Database 9 | spring.datasource.url=jdbc:h2:file:./target/camel-quickstart;DB_CLOSE_ON_EXIT=FALSE 10 | spring.jpa.hibernate.ddl-auto=update 11 | 12 | # TX manager 13 | spring.jta.log-dir=./target/tx-object-store 14 | spring.jta.narayana.recoveryDbUser= 15 | spring.jta.narayana.recoveryDbPass= 16 | 17 | #Enable shutdown endpoint 18 | endpoints.shutdown.sensitive=false 19 | endpoints.shutdown.enabled=true 20 | 21 | # Logging 22 | # logging.level.com.arjuna=TRACE 23 | -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/core/src/main/java/com/jboss/jbosstm/xts/demo/services/state/ServiceStateConstants.java: -------------------------------------------------------------------------------- 1 | package com.jboss.jbosstm.xts.demo.services.state; 2 | 3 | /** 4 | * constant values used by ServiceStateManager and its subclasses 5 | */ 6 | public class ServiceStateConstants { 7 | /** 8 | * bit mask identifying no tx 9 | */ 10 | public static final int TX_TYPE_NONE = 0; 11 | /** 12 | * bit mask identifying a WS-AT tx 13 | */ 14 | public static final int TX_TYPE_AT = 1; 15 | /** 16 | * bit mask identifying a WS-BA tx 17 | */ 18 | public static final int TX_TYPE_BA = 2; 19 | /** 20 | * bit mask identifying the union of both TX types 21 | */ 22 | public static final int TX_TYPE_BOTH = TX_TYPE_AT | TX_TYPE_BA; 23 | } -------------------------------------------------------------------------------- /rts/at/jta-service/jpa/src/main/java/org/jboss/narayana/quickstart/rest/bridge/inbound/jpa/model/TaskDao.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.rest.bridge.inbound.jpa.model; 2 | 3 | import java.util.List; 4 | 5 | import jakarta.ejb.Local; 6 | 7 | /** 8 | * Basic operations for manipulation of tasks 9 | * 10 | * @author Gytis Trikleris 11 | * @author Lukas Fryc 12 | * 13 | */ 14 | @Local 15 | public interface TaskDao { 16 | 17 | void createTask(UserTable user, Task task); 18 | 19 | List getAll(UserTable user); 20 | 21 | List getRange(UserTable user, int offset, int count); 22 | 23 | List getForTitle(UserTable user, String title); 24 | 25 | void deleteTask(Task task); 26 | 27 | void deleteTasks(); 28 | } -------------------------------------------------------------------------------- /ArjunaJTS/interop/glassfish/configure-jts-transactions.cli: -------------------------------------------------------------------------------- 1 | # Batch script to configure the WildFly server for JTS transactions 2 | 3 | # Start batching commands 4 | batch 5 | 6 | # Configure transactions for JTS 7 | /subsystem=iiop-openjdk/:write-attribute(name=transactions,value=full) 8 | /subsystem=transactions/:write-attribute(name=jts,value=true) 9 | /subsystem=transactions/:write-attribute(name=node-identifier,value=${jboss.tx.node.id}) 10 | 11 | # makes some changes for interoperabilit with glassfish 12 | # override the transaction propagation slot id to the standard one - this is done in the run script 13 | #/system-property=com.arjuna.ats.jts.transactionServiceId:add(value=0) 14 | 15 | # Run the batch commands 16 | run-batch 17 | 18 | # Reload the server configuration 19 | :reload 20 | 21 | -------------------------------------------------------------------------------- /compensating-transactions/non-transactional_resource/src/main/java/org/jboss/narayana/quickstarts/nonTransactionalResource/bookService/PackageDispatcher.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.nonTransactionalResource.bookService; 2 | 3 | import org.jboss.narayana.compensations.api.TxCompensate; 4 | 5 | import jakarta.inject.Inject; 6 | 7 | /** 8 | * @author paul.robinson@redhat.com 02/08/2013 9 | */ 10 | public class PackageDispatcher { 11 | 12 | @Inject 13 | OrderData orderData; 14 | 15 | @TxCompensate(RecallPackage.class) 16 | public void dispatch(String item, String address) { 17 | 18 | orderData.setAddress(address); 19 | orderData.setItem(item); 20 | //Dispatch the package 21 | System.out.println("Dispatching the package..."); 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /rts/at/annotation/flight-service/src/main/java/io/narayana/sra/demo/service/FlightService.java: -------------------------------------------------------------------------------- 1 | package io.narayana.sra.demo.service; 2 | 3 | import io.narayana.sra.demo.model.Booking; 4 | 5 | import jakarta.enterprise.context.ApplicationScoped; 6 | import java.util.concurrent.CompletableFuture; 7 | 8 | @ApplicationScoped 9 | public class FlightService extends BookingStore { 10 | public Booking book(String bid, String flightNumber, Integer seats) { 11 | Booking booking = new Booking(bid, flightNumber, seats, "Flight"); 12 | 13 | add(booking); 14 | 15 | return booking; 16 | } 17 | 18 | public CompletableFuture bookAsync(String bid, String flightNumber, Integer seats) { 19 | return CompletableFuture.supplyAsync(() -> book(bid, flightNumber, seats));} 20 | } 21 | -------------------------------------------------------------------------------- /ArjunaJTA/jakartaee_transactional_app/src/main/java/org/jboss/narayana/quickstarts/jpa/Customer.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.jpa; 2 | 3 | import java.io.Serializable; 4 | 5 | import jakarta.persistence.Column; 6 | import jakarta.persistence.Entity; 7 | import jakarta.persistence.GeneratedValue; 8 | import jakarta.persistence.Id; 9 | 10 | @Entity 11 | public class Customer implements Serializable { 12 | @Id 13 | @GeneratedValue 14 | private int id; 15 | 16 | @Column(unique = true, nullable = false) 17 | private String name; 18 | 19 | public int getId() { 20 | return id; 21 | } 22 | 23 | public void setId(int id) { 24 | this.id = id; 25 | } 26 | 27 | public String getName() { 28 | return name; 29 | } 30 | 31 | public void setName(String name) { 32 | this.name = name; 33 | } 34 | } -------------------------------------------------------------------------------- /rts/at/service/service1/src/main/java/quickstart/JAXRSServer.java: -------------------------------------------------------------------------------- 1 | package quickstart; 2 | 3 | import io.undertow.Undertow; 4 | import jakarta.ws.rs.core.Application; 5 | import org.jboss.resteasy.plugins.server.undertow.UndertowJaxrsServer; 6 | 7 | public class JAXRSServer { 8 | private final UndertowJaxrsServer server; 9 | 10 | public JAXRSServer(String message, int port) { 11 | System.out.printf("starting undertow (%s)%n", message); 12 | server = new UndertowJaxrsServer(); 13 | server.start(Undertow.builder().addHttpListener(port, "localhost")); 14 | } 15 | 16 | public void addDeployment(Application application, String contextRoot) { 17 | server.deploy(application, contextRoot); 18 | } 19 | 20 | public void stop() { 21 | server.stop(); 22 | } 23 | } -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/core/src/main/java/com/jboss/jbosstm/xts/demo/services/restaurant/RestaurantConstants.java: -------------------------------------------------------------------------------- 1 | package com.jboss.jbosstm.xts.demo.services.restaurant; 2 | 3 | /** 4 | * Constant values used by the restaurant service 5 | */ 6 | public class RestaurantConstants 7 | { 8 | /** 9 | * The default initial capacity of each seating area. 10 | */ 11 | public static final int DEFAULT_SEATING_CAPACITY = 100; 12 | 13 | /** 14 | * the name of the file used to persist the current restaurant state 15 | */ 16 | public final static String STATE_FILENAME = "restaurantManagerState"; 17 | 18 | /** 19 | * the name of the file used to persist the shadow restaurant state 20 | */ 21 | public final static String SHADOW_STATE_FILENAME = "restaurantManagerShadowState"; 22 | 23 | } -------------------------------------------------------------------------------- /rts/at/recovery/recovery1/src/main/java/quickstart/JAXRSServer.java: -------------------------------------------------------------------------------- 1 | package quickstart; 2 | 3 | import io.undertow.Undertow; 4 | import jakarta.ws.rs.core.Application; 5 | import org.jboss.resteasy.plugins.server.undertow.UndertowJaxrsServer; 6 | 7 | public class JAXRSServer { 8 | private final UndertowJaxrsServer server; 9 | 10 | public JAXRSServer(String message, int port) { 11 | System.out.printf("starting undertow (%s)%n", message); 12 | server = new UndertowJaxrsServer(); 13 | server.start(Undertow.builder().addHttpListener(port, "localhost")); 14 | } 15 | 16 | public void addDeployment(Application application, String contextRoot) { 17 | server.deploy(application, contextRoot); 18 | } 19 | 20 | public void stop() { 21 | server.stop(); 22 | } 23 | } -------------------------------------------------------------------------------- /jta-1_2-in-wildfly/src/test/resources/arquillian.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | ${modular.jdk.args} ${server.jvm.args} 13 | standalone-full.xml 14 | ${node.address} 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /jta-and-hibernate-standalone/src/main/java/org/jboss/narayana/quickstart/jta/EntityManagerProducer.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.jta; 2 | 3 | import jakarta.enterprise.inject.Disposes; 4 | import jakarta.enterprise.inject.Produces; 5 | import jakarta.persistence.EntityManager; 6 | import jakarta.persistence.EntityManagerFactory; 7 | 8 | /** 9 | * CDI producer of the EntityManager. 10 | * 11 | * @author Gytis Trikleris 12 | */ 13 | public class EntityManagerProducer { 14 | 15 | @Produces 16 | public EntityManager createEntityManager(EntityManagerFactory entityManagerFactory) { 17 | return entityManagerFactory.createEntityManager(); 18 | } 19 | 20 | public void close(@Disposes EntityManager entityManager) { 21 | entityManager.close(); 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /jpms/jta/config/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | jta-modules 7 | org.jboss.narayana.quickstart.jpms 8 | 7.3.4.Final-SNAPSHOT 9 | 10 | 11 | 4.0.0 12 | config 13 | jar 14 | 15 | 16 | 17 | 18 | src/main/io.narayana.config 19 | src/test 20 | 21 | 22 | -------------------------------------------------------------------------------- /rts/at/undertow/src/main/java/org/jboss/narayana/rts/JAXRSServer.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.rts; 2 | 3 | import io.undertow.Undertow; 4 | 5 | import org.jboss.resteasy.plugins.server.undertow.UndertowJaxrsServer; 6 | 7 | import jakarta.ws.rs.core.Application; 8 | 9 | public class JAXRSServer { 10 | private final UndertowJaxrsServer server; 11 | 12 | public JAXRSServer(String message, int port) { 13 | System.out.printf("starting undertow (%s)%n", message); 14 | server = new UndertowJaxrsServer(); 15 | server.start(Undertow.builder().addHttpListener(port, "localhost")); 16 | } 17 | 18 | public void addDeployment(Application application, String contextRoot) { 19 | server.deploy(application, contextRoot); 20 | } 21 | 22 | public void stop() { 23 | server.stop(); 24 | } 25 | } -------------------------------------------------------------------------------- /transactionaldriver/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | narayana-quickstarts-all 7 | org.jboss.narayana.quickstart 8 | 7.3.4.Final-SNAPSHOT 9 | 10 | io.narayana 11 | transactionaldriver 12 | pom 13 | Transactional Drivers Examples 14 | Examples of how transaction drivers could be used 15 | 16 | transactionaldriver-standalone 17 | 18 | -------------------------------------------------------------------------------- /compensating-transactions/travel-agent/src/main/java/org/jboss/narayana/quickstarts/compensationsApi/hotel/BookingData.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.compensationsApi.hotel; 2 | 3 | import org.jboss.narayana.compensations.api.CompensationScoped; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * This bean is used to store state in the business method and make it available when the confirmation and compensation 9 | * handlers are invoked. 10 | * 11 | * @author paul.robinson@redhat.com 02/08/2013 12 | */ 13 | @CompensationScoped 14 | public class BookingData implements Serializable { 15 | 16 | Integer bookingId; 17 | 18 | public Integer getBookingId() { 19 | 20 | return bookingId; 21 | } 22 | 23 | public void setBookingId(Integer bookingId) { 24 | 25 | this.bookingId = bookingId; 26 | } 27 | } -------------------------------------------------------------------------------- /compensating-transactions/travel-agent/src/main/java/org/jboss/narayana/quickstarts/compensationsApi/taxi2/BookingData.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.compensationsApi.taxi2; 2 | 3 | import org.jboss.narayana.compensations.api.CompensationScoped; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * This bean is used to store state in the business method and make it available when the confirmation and compensation 9 | * handlers are invoked. 10 | * 11 | * @author paul.robinson@redhat.com 02/08/2013 12 | */ 13 | @CompensationScoped 14 | public class BookingData implements Serializable { 15 | 16 | Integer bookingId; 17 | 18 | public Integer getBookingId() { 19 | 20 | return bookingId; 21 | } 22 | 23 | public void setBookingId(Integer bookingId) { 24 | 25 | this.bookingId = bookingId; 26 | } 27 | } -------------------------------------------------------------------------------- /rts/at/recovery/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | org.jboss.narayana.quickstart.rts 7 | restat-quickstarts 8 | 7.3.4.Final-SNAPSHOT 9 | 10 | recovery-quickstarts 11 | REST-AT Recovery Quickstarts 12 | Provides examples of how recoverable REST based transactional services 13 | pom 14 | 15 | recovery1 16 | recovery2 17 | 18 | -------------------------------------------------------------------------------- /spring/narayana-spring-boot/src/main/java/org/jboss/narayana/quickstart/spring/MessagesListener.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.spring; 2 | 3 | import org.springframework.jms.annotation.JmsListener; 4 | import org.springframework.stereotype.Component; 5 | 6 | /** 7 | * Listener to receive messages from the JMS queue. 8 | * 9 | * @author Gytis Trikleris 10 | */ 11 | @Component 12 | public class MessagesListener { 13 | 14 | public static final String QUEUE_NAME = "quickstart-messages"; 15 | 16 | @JmsListener(destination = QUEUE_NAME) 17 | public void onMessage(String message) { 18 | System.out.println("Message received: " + message); 19 | synchronized (QuickstartApplication.TO_WAIT) { 20 | QuickstartApplication.TO_WAIT.notify(); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/core/src/main/java/com/jboss/jbosstm/xts/demo/services/recovery/DemoATRecoveryListener.java: -------------------------------------------------------------------------------- 1 | package com.jboss.jbosstm.xts.demo.services.recovery; 2 | 3 | import jakarta.servlet.ServletContextListener; 4 | import jakarta.servlet.ServletContextEvent; 5 | 6 | /** 7 | * Listener to register and unregister teh XTS application specific listener -- we have to 8 | * use this because JBossWS does not currently honour the @PostConstruct and @PreDestroy 9 | * lifecycle annotations on web services 10 | */ 11 | public class DemoATRecoveryListener implements ServletContextListener 12 | { 13 | 14 | public void contextInitialized(ServletContextEvent event) { 15 | DemoATRecoveryModule.register(); 16 | } 17 | 18 | public void contextDestroyed(ServletContextEvent event) { 19 | DemoATRecoveryModule.unregister(); 20 | } 21 | } -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/core/src/main/java/com/jboss/jbosstm/xts/demo/services/recovery/DemoBARecoveryListener.java: -------------------------------------------------------------------------------- 1 | package com.jboss.jbosstm.xts.demo.services.recovery; 2 | 3 | import jakarta.servlet.ServletContextListener; 4 | import jakarta.servlet.ServletContextEvent; 5 | 6 | /** 7 | * Listener to register and unregister teh XTS application specific listener -- we have to 8 | * use this because JBossWS does not currently honour the @PostConstruct and @PreDestroy 9 | * lifecycle annotations on web services 10 | */ 11 | public class DemoBARecoveryListener implements ServletContextListener 12 | { 13 | 14 | public void contextInitialized(ServletContextEvent event) { 15 | DemoBARecoveryModule.register(); 16 | } 17 | 18 | public void contextDestroyed(ServletContextEvent event) { 19 | DemoBARecoveryModule.unregister(); 20 | } 21 | } -------------------------------------------------------------------------------- /compensating-transactions/travel-agent/src/main/java/org/jboss/narayana/quickstarts/compensationsApi/taxi1/jaxws/Taxi1Service.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.compensationsApi.taxi1.jaxws; 2 | 3 | import jakarta.jws.WebMethod; 4 | import jakarta.jws.WebService; 5 | import java.util.Date; 6 | 7 | /** 8 | * Interface implemented by Taxi1Service Web service. 9 | * 10 | * @author paul.robinson@redhat.com, 2011-12-21 11 | */ 12 | @WebService(name = "Taxi1Service", targetNamespace = "http://www.jboss.org/as/quickstarts/compensationsApi/travel/taxi1") 13 | public interface Taxi1Service { 14 | 15 | /** 16 | * Make the booking 17 | * 18 | * @param name Name of person making the booking 19 | * @param date the date of the booking 20 | */ 21 | @WebMethod 22 | public Integer makeBooking(String name, Date date); 23 | 24 | } -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/rpc/src/main/java/com/arjuna/xts/nightout/services/recovery/DemoRPCATRecoveryListener.java: -------------------------------------------------------------------------------- 1 | package com.arjuna.xts.nightout.services.recovery; 2 | 3 | import jakarta.servlet.ServletContextListener; 4 | import jakarta.servlet.ServletContextEvent; 5 | 6 | /** 7 | * Listener to register and unregister teh XTS application specific listener -- we have to 8 | * use this because JBossWS does not currently honour the @PostConstruct and @PreDestroy 9 | * lifecycle annotations on web services 10 | */ 11 | public class DemoRPCATRecoveryListener implements ServletContextListener 12 | { 13 | 14 | public void contextInitialized(ServletContextEvent event) { 15 | DemoRPCATRecoveryModule.register(); 16 | } 17 | 18 | public void contextDestroyed(ServletContextEvent event) { 19 | DemoRPCATRecoveryModule.unregister(); 20 | } 21 | } -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/rpc/src/main/java/com/arjuna/xts/nightout/services/recovery/DemoRPCBARecoveryListener.java: -------------------------------------------------------------------------------- 1 | package com.arjuna.xts.nightout.services.recovery; 2 | 3 | import jakarta.servlet.ServletContextListener; 4 | import jakarta.servlet.ServletContextEvent; 5 | 6 | /** 7 | * Listener to register and unregister teh XTS application specific listener -- we have to 8 | * use this because JBossWS does not currently honour the @PostConstruct and @PreDestroy 9 | * lifecycle annotations on web services 10 | */ 11 | public class DemoRPCBARecoveryListener implements ServletContextListener 12 | { 13 | 14 | public void contextInitialized(ServletContextEvent event) { 15 | DemoRPCBARecoveryModule.register(); 16 | } 17 | 18 | public void contextDestroyed(ServletContextEvent event) { 19 | DemoRPCBARecoveryModule.unregister(); 20 | } 21 | } -------------------------------------------------------------------------------- /ArjunaJTA/object_store/run.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | echo "Running object_store quickstart" 4 | 5 | IF NOT %QUICKSTART_NARAYANA_VERSION%x == x SET NARAYANA_VERSION_PARAM="-Dversion.narayana=${QUICKSTART_NARAYANA_VERSION}" 6 | 7 | mvn -e compile exec:java -Dexec.mainClass=org.jboss.narayana.jta.quickstarts.VolatileStoreExample %NARAYANA_VERSION_PARAM% 8 | IF %ERRORLEVEL% NEQ 0 exit -1 9 | 10 | mvn -e compile exec:java -Dexec.mainClass=org.jboss.narayana.jta.quickstarts.HornetqStoreExample %NARAYANA_VERSION_PARAM% 11 | IF %ERRORLEVEL% NEQ 0 exit -1 12 | 13 | mvn -e compile exec:java -Dexec.mainClass=org.jboss.narayana.jta.quickstarts.FileStoreExample %NARAYANA_VERSION_PARAM% 14 | IF %ERRORLEVEL% NEQ 0 exit -1 15 | 16 | mvn -e compile exec:java -Dexec.mainClass=org.jboss.narayana.jta.quickstarts.JDBCStoreExample %NARAYANA_VERSION_PARAM% 17 | IF %ERRORLEVEL% NEQ 0 exit -1 18 | -------------------------------------------------------------------------------- /rts/lra-examples/cdi-embedded/README.md: -------------------------------------------------------------------------------- 1 | # MicroProfile LRA Participant Example with Embedded Coordinator 2 | 3 | This example is similar to the [`cdi-participant`](#../cdi-participant/README.md) 4 | example. The difference is that this quickstart embeds an LRA coordinator 5 | with the application. 6 | 7 | ## Start a service that takes part in LRAs 8 | 9 |
10 | java -jar target/quarkus-app/quarkus-run.jar &
11 | 
12 | 13 | Then follow the instructions in the [`cdi-participant README.md file`](#../cdi-participant/README.md). For example, 14 | 15 |
18 | 
19 | will send a JAX-RS request to an application endpoint annotated with `@LRA(LRA.Type.REQUIRED`.
20 | The embedded coordinator will start an LRA just before the JAX-RS method is entered
21 | and will end it just after the method finishes.
22 | 


--------------------------------------------------------------------------------
/XTS/raw-xts-api-demo/core/src/main/java/com/jboss/jbosstm/xts/demo/taxi/ITaxiServiceBA.java:
--------------------------------------------------------------------------------
 1 | package com.jboss.jbosstm.xts.demo.taxi;
 2 | 
 3 | import jakarta.jws.WebMethod;
 4 | import jakarta.jws.WebResult;
 5 | import jakarta.jws.WebService;
 6 | import jakarta.jws.soap.SOAPBinding;
 7 | 
 8 | 
 9 | /**
10 |  * This class was generated by the JAX-WS RI.
11 |  * JAX-WS RI 2.1.2-hudson-182-RC1
12 |  * Generated source version: 2.0
13 |  * 
14 |  */
15 | @WebService(name = "ITaxiServiceBA", targetNamespace = "http://www.jboss.com/jbosstm/xts/demo/Taxi")
16 | @SOAPBinding(style = SOAPBinding.Style.RPC)
17 | public interface ITaxiServiceBA {
18 | 
19 | 
20 |     /**
21 |      * 
22 |      * @return
23 |      *     returns boolean
24 |      */
25 |     @WebMethod
26 |     @WebResult(name = "bookTaxiBAResponse", partName = "bookTaxiBAResponse")
27 |     public boolean bookTaxi();
28 | 
29 | }


--------------------------------------------------------------------------------
/rts/at/jta-service/jpa/src/main/webapp/WEB-INF/test-ds.xml:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 |     
 6 |         org.h2.jdbcx.JdbcDataSource
 7 |         jdbc:h2:file:./db/rest-tx-bridge-jpa-quickstart;DB_CLOSE_ON_EXIT=FALSE
 8 |         
 9 |         h2
10 |         
11 |             
12 |             sa
13 |             
14 |             sa
15 |         
16 |     
17 | 


--------------------------------------------------------------------------------
/ArjunaJTS/interop/glassfish/run.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/bash
 2 | set -ex
 3 | 
 4 | echo "===== JTS interop quickstart: step 1 (compile gf and wf):"; ./step1.sh
 5 | sleep `timeout_adjust 3 2>/dev/null || echo 3`
 6 | echo "===== JTS interop quickstart: step 2 (start GlassFish):"; ./step2.sh
 7 | sleep `timeout_adjust 10 2>/dev/null || echo 10`
 8 | echo "===== JTS interop quickstart: step 3 (start WildFly):"; ./step3.sh
 9 | sleep `timeout_adjust 10 2>/dev/null || echo 10`
10 | 
11 | trap ./step7.sh EXIT
12 | 
13 | echo "===== JTS interop quickstart: step 4 (deploy EJBs):"; ./step4.sh
14 | sleep `timeout_adjust 10 2>/dev/null || echo 10`
15 | echo "===== JTS interop quickstart: step 5 (EJB call gf -> wf):"; ./step5.sh
16 | sleep `timeout_adjust 4 2>/dev/null || echo 4`
17 | echo "===== JTS interop quickstart: step 6 (EJB call wf -> gf):"; ./step6.sh
18 | sleep `timeout_adjust 4 2>/dev/null || echo 4`
19 | 
20 | 


--------------------------------------------------------------------------------
/jpms/jta/demo/src/main/resources/log4j2.properties:
--------------------------------------------------------------------------------
 1 | name=PropertiesConfig
 2 | property.filename = logs
 3 | 
 4 | appenders = console, file
 5 | 
 6 | appender.console.type = Console
 7 | appender.console.name = STDOUT
 8 | appender.console.layout.type = PatternLayout
 9 | appender.console.layout.pattern = [%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n
10 | 
11 | appender.file.type = File
12 | appender.file.name = LOGFILE
13 | appender.file.fileName=target/demo.log
14 | appender.file.layout.type=PatternLayout
15 | appender.file.layout.pattern=[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n
16 | 
17 | loggers=file
18 | logger.file.name=io.narayana
19 | logger.file.level = info
20 | logger.file.appenderRefs = file
21 | logger.file.appenderRef.file.ref = LOGFILE
22 | 
23 | rootLogger.level = info
24 | rootLogger.appenderRefs = stdout
25 | rootLogger.appenderRef.stdout.ref = STDOUT


--------------------------------------------------------------------------------
/XTS/raw-xts-api-demo/core/src/main/java/com/jboss/jbosstm/xts/demo/restaurant/IRestaurantServiceAT.java:
--------------------------------------------------------------------------------
 1 | package com.jboss.jbosstm.xts.demo.restaurant;
 2 | 
 3 | import jakarta.jws.WebMethod;
 4 | import jakarta.jws.WebParam;
 5 | import jakarta.jws.WebService;
 6 | import jakarta.jws.soap.SOAPBinding;
 7 | 
 8 | 
 9 | /**
10 |  * This class was generated by the JAX-WS RI.
11 |  * JAX-WS RI 2.1.2-hudson-182-RC1
12 |  * Generated source version: 2.0
13 |  * 
14 |  */
15 | @WebService(name = "IRestaurantServiceAT", targetNamespace = "http://www.jboss.com/jbosstm/xts/demo/Restaurant")
16 | @SOAPBinding(style = SOAPBinding.Style.RPC)
17 | public interface IRestaurantServiceAT {
18 | 
19 | 
20 |     /**
21 |      * 
22 |      * @param howMany
23 |      */
24 |     @WebMethod
25 |     public void bookSeats(
26 |         @WebParam(name = "how_many", partName = "how_many")
27 |         int howMany);
28 | 
29 | }


--------------------------------------------------------------------------------
/rts/at/annotation/common-service/pom.xml:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 |   4.0.0
 4 |   
 5 |     org.jboss.narayana.quickstart.rts
 6 |     annotation
 7 |     7.3.4.Final-SNAPSHOT
 8 |   
 9 |   org.jboss.narayana.quickstart.rts
10 |   common-service
11 |   jar
12 |   common-service
13 |   
14 |     
15 |       com.fasterxml.jackson.core
16 |       jackson-annotations
17 |     
18 |   
19 | 
20 | 


--------------------------------------------------------------------------------
/rts/at/annotation/start-services.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/bash
 2 | 
 3 | ############################
 4 | 
 5 | # Step 1: Clean and package the Maven project, skipping tests
 6 | mvn clean package -DskipTests
 7 | 
 8 | # Step 2: Run flight-service in the background
 9 | java -jar flight-service/target/quarkus-app/quarkus-run.jar &
10 | 
11 | # Step 3: Run hotel-service in the background
12 | java -jar hotel-service/target/quarkus-app/quarkus-run.jar &
13 | 
14 | # Step 4: Run trip-service in the background
15 | java -jar trip-service/target/quarkus-app/quarkus-run.jar &
16 | 
17 | # Wait for a few seconds to give time for the services to start
18 | sleep 10
19 | 
20 | # Check if the services are running
21 | if $(jps | grep -q "quarkus-run.jar"); then
22 |   echo "All services started successfully!"
23 | else
24 |   echo "Failed to start one or more services. Please check the logs for more information."
25 | fi
26 | 


--------------------------------------------------------------------------------
/ArjunaJTS/standalone/run.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | # ALLOW JOBS TO BE BACKGROUNDED
 4 | set -m
 5 | 
 6 | OPENJDKORBPROPS="-DOrbPortabilityEnvironmentBean.orbDataClassName=com.arjuna.orbportability.internal.orbspecific.versions.javaidl_1_4 -DOrbPortabilityEnvironmentBean.orbImpleClassName=com.arjuna.orbportability.internal.orbspecific.javaidl.orb.implementations.javaidl_1_4"
 7 | 
 8 | [ "x$QUICKSTART_NARAYANA_VERSION" != 'x' ] &&\
 9 |   NARAYANA_VERSION_PARAM="-Dversion.narayana=${QUICKSTART_NARAYANA_VERSION}"
10 | 
11 | echo "Running jts standalone quickstart using OpenJDK ORB"
12 | mvn -e exec:java  -Dexec.cleanupDaemonThreads=false -Dexec.mainClass=org.jboss.narayana.jta.quickstarts.TransactionExample $OPENJDKORBPROPS $NARAYANA_VERSION_PARAM
13 | 
14 | if [ "$?" != "0" ]; then
15 |     echo jts standalone using OpenJDK ORB quickstart failed
16 |     exit -1
17 | fi
18 | 
19 | echo "JTS standalone example succeeded"
20 | 


--------------------------------------------------------------------------------
/ArjunaCore/README.md:
--------------------------------------------------------------------------------
 1 | # ArjunaCore quickstarts
 2 | 
 3 | ## Overview
 4 | 
 5 | ArjunaCore is the core of Narayana providing a fully functional transaction engine (TxCore) and Transactional Objects for Java (TXOJ).
 6 | It is multi-threaded, distributed, supports nested transactions, fault tolerance/recovery
 7 | and permits relaxation of subsets of the standard ACID transaction properties.
 8 | 
 9 | TXOJ provides desirable features such as concurrency control, state management and persistence.
10 | 
11 | All the quickstarts related to ArjunaCore are found in this folder structure.
12 | Each quickstart has a `README.md` to show how to execute the quickstart and what is happening in it.
13 | Each quickstart also contains a script to run the quickstart automatically and check the result automatically.
14 | 
15 | 
16 | ## Usage
17 | 
18 | `cd` into the required quickstart and follow the `README.md` or call the `run.[sh|bat]` file
19 | 


--------------------------------------------------------------------------------
/jta-1_2-standalone/src/test/resources/jbossts-properties.xml:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 | 
11 | 
12 | 
13 |     
14 |     target/tx-object-store
15 |     target/tx-object-store
16 |     target/tx-object-store
17 | 
18 | 
19 | 


--------------------------------------------------------------------------------
/rts/at/jta-service/jpa/src/main/resources/META-INF/persistence.xml:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 8 |    
 9 |       java:jboss/datasources/RestTXBridgeJPAQuickstartDS
10 |       
11 |          
12 |          
13 |          
14 |          
15 |       
16 |    
17 | 


--------------------------------------------------------------------------------
/rts/lra-examples/lra-jwt/pom.xml:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 |     4.0.0
 4 |     
 5 |       org.jboss.narayana.quickstart.rts.lra
 6 |       lra-examples
 7 |       7.3.4.Final-SNAPSHOT
 8 |     
 9 |     org.jboss.narayana.quickstart.rts.lra
10 |     lra-jwt-examples
11 |     LRA JWT Quickstart Examples
12 |     Provides examples of how to secure LRA endpoints using JWT security mechanism.
13 |     pom
14 | 
15 |     
16 |         wildfly
17 |     
18 | 
19 | 


--------------------------------------------------------------------------------
/compensating-transactions/non-transactional_resource/src/main/java/org/jboss/narayana/quickstarts/nonTransactionalResource/bookService/OrderData.java:
--------------------------------------------------------------------------------
 1 | package org.jboss.narayana.quickstarts.nonTransactionalResource.bookService;
 2 | 
 3 | import org.jboss.narayana.compensations.api.CompensationScoped;
 4 | 
 5 | import java.io.Serializable;
 6 | 
 7 | /**
 8 |  * @author paul.robinson@redhat.com 02/08/2013
 9 |  */
10 | @CompensationScoped
11 | public class OrderData implements Serializable {
12 | 
13 |     private String item;
14 |     private String address;
15 | 
16 |     public String getItem() {
17 | 
18 |         return item;
19 |     }
20 | 
21 |     public void setItem(String item) {
22 | 
23 |         this.item = item;
24 |     }
25 | 
26 |     public String getAddress() {
27 | 
28 |         return address;
29 |     }
30 | 
31 |     public void setAddress(String address) {
32 | 
33 |         this.address = address;
34 |     }
35 | }


--------------------------------------------------------------------------------
/XTS/raw-xts-api-demo/byteman-scripts/demotrace.txt:
--------------------------------------------------------------------------------
 1 | # extra trace rules for debugging
 2 | #
 3 | # track write shadow state
 4 | # just for debug
 5 | RULE trace write shadow state
 6 | CLASS ServiceStateManager
 7 | METHOD writeShadowState
 8 | IF TRUE
 9 | DO traceln("log", "*** tx : " + $1 + " writing shadow state " + $2),
10 |    traceStack(null, "log", 5)
11 | ENDRULE
12 | 
13 | # track commit shadow state
14 | # just for debug
15 | RULE trace write commit shadow state
16 | CLASS ServiceStateManager
17 | METHOD commitShadowState
18 | IF TRUE
19 | DO traceln("log", "*** tx : " + $1 + " commit shadow state "),
20 |    traceStack(null, "log", 5)
21 | ENDRULE
22 | 
23 | # track clear shadow state
24 | # just for debug
25 | RULE trace clear commit shadow state
26 | CLASS ServiceStateManager
27 | METHOD clearShadowState
28 | IF TRUE
29 | DO traceln("log", "*** tx : " + $1 + " clear shadow state "),
30 |    traceStack(null, "log", 5)
31 | ENDRULE
32 | 


--------------------------------------------------------------------------------
/ArjunaJTA/jakartaee_transactional_app/src/test/resources/arquillian.xml:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 7 | 
 8 | 	
 9 | 	
10 | 		target/exploded-artifact-for-inspection
11 | 	
12 | 	
13 | 
14 | 	
15 | 	
16 | 		
17 | 			-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n
18 |         
19 | 	
20 | 
21 | 


--------------------------------------------------------------------------------
/ArjunaJTA/jakartaee_transactional_app/src/main/resources/META-INF/persistence.xml:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 |   
 5 |     java:jboss/datasources/ExampleDS
 6 |     
 7 | 
 8 |       
 9 |       
10 | 
11 |       
12 |       
13 |       
14 | 
15 |       
16 |       
17 |     
18 |   
19 | 


--------------------------------------------------------------------------------
/ArjunaJTA/jakarta_transaction/README.md:
--------------------------------------------------------------------------------
 1 | ## Jakarta transaction quickstart
 2 | 
 3 | ## Overview
 4 | 
 5 | This example shows how to obtain a Jakarta EE conforming transaction and how to invoke various methods
 6 | of the `jakarta.transaction.Transaction` interface such as starting and ending transactions, examining
 7 | transacton status, timeouts etc.
 8 | 
 9 | ## Usage
10 | 
11 | ```
12 | mvn compile exec:exec
13 | ```
14 | 
15 | or
16 | 
17 | ```
18 | ./run.[sh|bat]
19 | ```
20 | 
21 | ## Expected output
22 | 
23 | ```
24 | [INFO] BUILD SUCCESS
25 | 
26 | otherwise you can examine what went wrong by enabling stack traces with the -e flat:
27 | 	mvn compile exec:exec -e
28 | ```
29 | 
30 | ## What just happened
31 | 
32 | The example looks up an instance of the Java EE `UserTransaction` using and calls its various methods.
33 | If anything goes wrong an exception is generated. The example shows how to get
34 | the instance of the `TransactionManager` interface.
35 | 


--------------------------------------------------------------------------------
/ArjunaJTA/object_store/run.sh:
--------------------------------------------------------------------------------
 1 | 
 2 | # ALLOW JOBS TO BE BACKGROUNDED
 3 | set -m
 4 | set -x
 5 | 
 6 | echo "Running object_store quickstart"
 7 | 
 8 | [ "x$QUICKSTART_NARAYANA_VERSION" != 'x' ] &&\
 9 |   NARAYANA_VERSION_PARAM="-Dversion.narayana=${QUICKSTART_NARAYANA_VERSION}"
10 | 
11 | mvn -e exec:java -Dexec.mainClass=org.jboss.narayana.jta.quickstarts.VolatileStoreExample $NARAYANA_VERSION_PARAM
12 | if [ "$?" != "0" ]; then
13 | 	exit -1
14 | fi
15 | 
16 | mvn -e exec:java -Dexec.mainClass=org.jboss.narayana.jta.quickstarts.HornetqStoreExample $NARAYANA_VERSION_PARAM
17 | if [ "$?" != "0" ]; then
18 | 	exit -1
19 | fi
20 | 
21 | mvn -e exec:java -Dexec.mainClass=org.jboss.narayana.jta.quickstarts.FileStoreExample $NARAYANA_VERSION_PARAM
22 | if [ "$?" != "0" ]; then
23 | 	exit -1
24 | fi
25 | 
26 | mvn -e exec:java -Dexec.mainClass=org.jboss.narayana.jta.quickstarts.JDBCStoreExample $NARAYANA_VERSION_PARAM
27 | if [ "$?" != "0" ]; then
28 | 	exit -1
29 | fi
30 | 


--------------------------------------------------------------------------------
/ArjunaJTS/interop/resource/src/main/java/org/jboss/narayana/ASFailureMode.java:
--------------------------------------------------------------------------------
 1 | package org.jboss.narayana;
 2 | 
 3 | import java.io.Serializable;
 4 | 
 5 | /**
 6 |  * Specification of what to do when a failure is injected
 7 |  */
 8 | public enum ASFailureMode implements Serializable
 9 | {
10 |     NONE(false)
11 |     
12 |     ,HALT(true)    // halt the JVM
13 |     ,EXIT(true)   // exit the JVM
14 |     ,SUSPEND(false)  // suspend the calling thread
15 |     ,XAEXCEPTION(false)    // fail via one of the xa exception codes
16 |     ;
17 | 
18 |     private boolean willTerminateVM;
19 | 
20 |     ASFailureMode(boolean willTerminateVM)
21 |     {
22 |         this.willTerminateVM = willTerminateVM;
23 |     }
24 | 
25 |     public boolean willTerminateVM()
26 |     {
27 |         return willTerminateVM;
28 |     }
29 | 
30 |     public static ASFailureMode toEnum(String mode)
31 |     {
32 |         return ASFailureMode.valueOf(mode.toUpperCase());
33 |     }
34 | }


--------------------------------------------------------------------------------
/compensating-transactions/mongodb-simple/src/test/resources/arquillian.xml:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 | 
 7 | 
 8 |     
 9 |         target/
10 |     
11 | 
12 |     
13 |         
14 |             ${server.config}
15 |             ${server.jvm.args}
16 |             ${node.address}
17 |             ${server.startup.timeout:60}
18 |         
19 |     
20 | 
21 | 


--------------------------------------------------------------------------------
/jpms/jta/config/src/main/io.narayana.config/io/narayana/config/Config.java:
--------------------------------------------------------------------------------
 1 | package io.narayana.config;
 2 | 
 3 | import java.util.List;
 4 | 
 5 | public class Config {
 6 |     public String nodeName;
 7 |     public String storeDirectory;
 8 |     public int recoveryBackoffPeriod;
 9 |     public int periodicRecoveryPeriod;
10 |     public List recoveryModuleClassNames;
11 | 
12 |     public Config(String nodeName,
13 |                           String storeDirectory,
14 |                           int recoveryBackoffPeriod,
15 |                           int periodicRecoveryPeriod,
16 |                           List recoveryModuleClassNames) {
17 |         this.nodeName = nodeName;
18 |         this.storeDirectory = storeDirectory;
19 |         this.recoveryBackoffPeriod = recoveryBackoffPeriod;
20 |         this.periodicRecoveryPeriod = periodicRecoveryPeriod;
21 |         this.recoveryModuleClassNames = recoveryModuleClassNames;
22 |     }
23 | }
24 | 


--------------------------------------------------------------------------------
/ArjunaJTS/recovery/run.bat:
--------------------------------------------------------------------------------
 1 | @echo off
 2 | 
 3 | echo "Running JTS recovery quickstart"
 4 | 
 5 | OPENJDK_CONFIG="-Dcom.sun.CORBA.POA.ORBServerId=1 -Dcom.sun.CORBA.POA.ORBPersistentServerPort=12567"
 6 | 
 7 | IF NOT %QUICKSTART_NARAYANA_VERSION%x == x SET NARAYANA_VERSION_PARAM="-Dversion.narayana=${QUICKSTART_NARAYANA_VERSION}"
 8 | 
 9 | echo "Generating a recovery record ..."
10 | mvn -e compile exec:java -Dexec.mainClass=Test -Dexec.args="-crash" %OPENJDK_CONFIG %NARAYANA_VERSION_PARAM%
11 | IF %ERRORLEVEL% NEQ 0 exit -1
12 | 
13 | echo "Recovering failed service - this could take up to a minute or so ..."
14 | mvn -e exec:java -Dexec.mainClass=Test -Dexec.args="-recover -auto" %OPENJDK_CONFIG %NARAYANA_VERSION_PARAM%
15 | IF %ERRORLEVEL% NEQ 0 exit -1
16 | 
17 | echo "Testing that the XID data files were removed"
18 | IF EXIST target\ExampleXAResource1.xid_ exit -1 
19 | IF EXIST target\ExampleXAResource2.xid_ exit -1 
20 | 
21 | echo "Service recovery example succeeded"
22 | 
23 | 


--------------------------------------------------------------------------------
/atsintegration/src/main/java/com/arjuna/jta/distributed/example/resources/TestSynchronization.java:
--------------------------------------------------------------------------------
 1 | package com.arjuna.jta.distributed.example.resources;
 2 | 
 3 | import jakarta.transaction.Synchronization;
 4 | 
 5 | /**
 6 |  * This is a simple Synchronization, any knowledge (such as the server name) it
 7 |  * has of the rest of the example is purely for debugging. It should be
 8 |  * considered a black box.
 9 |  */
10 | public class TestSynchronization implements Synchronization {
11 | 	private String localServerName;
12 | 
13 | 	public TestSynchronization(String localServerName) {
14 | 		this.localServerName = localServerName;
15 | 	}
16 | 
17 | 	@Override
18 | 	public void beforeCompletion() {
19 | 		System.out.println(" TestSynchronization (" + localServerName + ")      beforeCompletion");
20 | 	}
21 | 
22 | 	@Override
23 | 	public void afterCompletion(int status) {
24 | 		System.out.println(" TestSynchronization (" + localServerName + ")      afterCompletion");
25 | 	}
26 | }


--------------------------------------------------------------------------------
/compensating-transactions/non-transactional_resource/src/main/java/org/jboss/narayana/quickstarts/nonTransactionalResource/bookService/BookService.java:
--------------------------------------------------------------------------------
 1 | package org.jboss.narayana.quickstarts.nonTransactionalResource.bookService;
 2 | 
 3 | import org.jboss.narayana.compensations.api.Compensatable;
 4 | 
 5 | import jakarta.inject.Inject;
 6 | import java.util.concurrent.atomic.AtomicInteger;
 7 | 
 8 | /**
 9 |  * @author paul.robinson@redhat.com 02/08/2013
10 |  */
11 | public class BookService {
12 | 
13 |     @Inject
14 |     PackageDispatcher packageDispatcher;
15 | 
16 |     @Inject
17 |     InvoicePrinter invoicePrinter;
18 | 
19 |     private static AtomicInteger orderId = new AtomicInteger(0);
20 | 
21 |     @Compensatable
22 |     public void buyBook(String item, String address) {
23 | 
24 |         packageDispatcher.dispatch(item, address);
25 |         invoicePrinter.print(orderId.getAndIncrement(), "Invoice body would go here, blah blah blah");
26 | 
27 |     }
28 | 
29 | }


--------------------------------------------------------------------------------
/jta-1_2-standalone/README.md:
--------------------------------------------------------------------------------
 1 | Standalone JTA 1.2 example.
 2 | ===
 3 | 
 4 | Author: Gytis Trikleris, Ondra Chaloupka
5 | Level: Intermediate
6 | Technologies: JTA, CDI
7 | 8 | What is it? 9 | --- 10 | 11 | This example demonstrates how to use JTA 1.2 annotations and CDI beans in standalone application. 12 | 13 | JTA 1.2 introduces annotations for controlling the transactional behaviour of CDI beans. 14 | This quickstart indicate how to take advantage of these annotations in a standalone application 15 | (ie in environments where a Java EE container is either not available or is undesirable). 16 | 17 | 18 | System requirements 19 | --- 20 | 21 | All you need to build this project is Java 8 (Java SDK 1.8) or better and Maven 3.3.3 or better. 22 | 23 | 24 | Build and Deploy the Quickstart 25 | --- 26 | 27 | 1. Open a command line and navigate to the root directory of this quickstart. 28 | 2. Execute quickstart: 29 | 30 | ``` 31 | mvn clean test 32 | ``` 33 | -------------------------------------------------------------------------------- /ArjunaJTA/jakartaee_transactional_app/src/main/webapp/template.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | Customer Database 12 | 13 | 14 | 15 | 16 | 17 |

Customer Database

18 |
19 | 20 | 21 | 22 | 23 |
24 | 25 |
26 | 27 |
28 |
29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /ArjunaJTA/jakartaee_transactional_app/src/main/webapp/addCustomer.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Name: 13 | 14 | 16 | 17 | 18 | 19 | List customers 20 | List count 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ArjunaJTS/interop/test-ejbs/src/main/webapp/WEB-INF/jboss-ejb3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 14 | SessionBean 15 | ejbtest/SessionBean 16 | 17 | 18 | -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/core/src/main/java/com/jboss/jbosstm/xts/demo/theatre/ITheatreServiceAT.java: -------------------------------------------------------------------------------- 1 | package com.jboss.jbosstm.xts.demo.theatre; 2 | 3 | import jakarta.jws.WebMethod; 4 | import jakarta.jws.WebParam; 5 | import jakarta.jws.WebService; 6 | import jakarta.jws.soap.SOAPBinding; 7 | 8 | 9 | /** 10 | * This class was generated by the JAX-WS RI. 11 | * JAX-WS RI 2.1.2-hudson-182-RC1 12 | * Generated source version: 2.0 13 | * 14 | */ 15 | @WebService(name = "ITheatreServiceAT", targetNamespace = "http://www.jboss.com/jbosstm/xts/demo/Theatre") 16 | @SOAPBinding(style = SOAPBinding.Style.RPC) 17 | public interface ITheatreServiceAT { 18 | 19 | 20 | /** 21 | * 22 | * @param howMany 23 | * @param whichArea 24 | */ 25 | @WebMethod 26 | public void bookSeats( 27 | @WebParam(name = "how_many", partName = "how_many") 28 | int howMany, 29 | @WebParam(name = "which_area", partName = "which_area") 30 | int whichArea); 31 | 32 | } -------------------------------------------------------------------------------- /ArjunaJTA/jakartaee_transactional_app/src/main/webapp/WEB-INF/faces-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | /addCustomer.xhtml 7 | 8 | #{customerManager.addCustomer(name)} 9 | customerAdded 10 | /customers.xhtml 11 | 12 | 13 | 14 | #{customerManager.addCustomer(name)} 15 | customerDuplicate 16 | /duplicate.xhtml 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /compensating-transactions/non-transactional_resource/src/main/java/org/jboss/narayana/quickstarts/nonTransactionalResource/bookService/InvoicePrinter.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.nonTransactionalResource.bookService; 2 | 3 | import org.jboss.narayana.compensations.api.TxCompensate; 4 | 5 | import jakarta.inject.Inject; 6 | 7 | /** 8 | * @author paul.robinson@redhat.com 02/08/2013 9 | */ 10 | public class InvoicePrinter { 11 | 12 | @Inject 13 | InvoiceData invoiceData; 14 | 15 | public static boolean hasInk = true; 16 | 17 | @TxCompensate(DestroyInvoice.class) 18 | public void print(Integer invoiceId, String invoiceBody) { 19 | 20 | if (!hasInk) { 21 | throw new RuntimeException("Printer has run out of ink. Unable to print invoice"); 22 | } 23 | 24 | invoiceData.setInvoiceBody(invoiceBody); 25 | invoiceData.setInvoiceId(invoiceId); 26 | 27 | System.out.println("Printing the invoice ready for posting..."); 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /spring/camel-with-narayana-spring-boot/src/main/java/org/jboss/narayana/quickstart/spring/User.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.spring; 2 | 3 | import jakarta.persistence.Entity; 4 | import jakarta.persistence.GeneratedValue; 5 | import jakarta.persistence.GenerationType; 6 | import jakarta.persistence.Id; 7 | 8 | /** 9 | * @author 2 | 6 | 7 | 8 | 9 | 10 |

List of customers

11 | 12 | 13 | 14 | Name 15 | 16 | 17 | 18 | 19 | 20 | Id 21 | 22 | 23 | 24 | 25 |
Go Back 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /XTS/wsat-jta-multi_hop/src/test/resources/arquillian.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | target/ 11 | 12 | 13 | 14 | 15 | 16 | ${modular.jdk.args} ${server.jvm.args} 17 | standalone-xts.xml 18 | ${node.address} 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/rpc/src/main/dd/jboss/jaxrpc-mapping.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | com.arjuna.xts.nightout.services.Restaurant 8 | http://www.jboss.com/jbosstm/xts/demo/Restaurant 9 | 10 | 11 | com.arjuna.xts.nightout.services.Theatre 12 | http://www.jboss.com/jbosstm/xts/demo/Theatre 13 | 14 | 15 | com.arjuna.xts.nightout.services.Taxi 16 | http://www.jboss.com/jbosstm/xts/demo/Taxi 17 | 18 | -------------------------------------------------------------------------------- /compensating-transactions/non-transactional_resource/src/main/java/org/jboss/narayana/quickstarts/nonTransactionalResource/bookService/InvoiceData.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.nonTransactionalResource.bookService; 2 | 3 | import org.jboss.narayana.compensations.api.Compensatable; 4 | import org.jboss.narayana.compensations.api.CompensationScoped; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * @author paul.robinson@redhat.com 02/08/2013 10 | */ 11 | @CompensationScoped 12 | public class InvoiceData implements Serializable { 13 | 14 | private Integer invoiceId; 15 | private String invoiceBody; 16 | 17 | public Integer getInvoiceId() { 18 | 19 | return invoiceId; 20 | } 21 | 22 | public void setInvoiceId(Integer invoiceId) { 23 | 24 | this.invoiceId = invoiceId; 25 | } 26 | 27 | public String getInvoiceBody() { 28 | 29 | return invoiceBody; 30 | } 31 | 32 | public void setInvoiceBody(String invoiceBody) { 33 | 34 | this.invoiceBody = invoiceBody; 35 | } 36 | } -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/core/src/main/java/com/jboss/jbosstm/xts/demo/restaurant/IRestaurantServiceBA.java: -------------------------------------------------------------------------------- 1 | package com.jboss.jbosstm.xts.demo.restaurant; 2 | 3 | import jakarta.jws.WebMethod; 4 | import jakarta.jws.WebParam; 5 | import jakarta.jws.WebResult; 6 | import jakarta.jws.WebService; 7 | import jakarta.jws.soap.SOAPBinding; 8 | 9 | 10 | /** 11 | * This class was generated by the JAX-WS RI. 12 | * JAX-WS RI 2.1.2-hudson-182-RC1 13 | * Generated source version: 2.0 14 | * 15 | */ 16 | @WebService(name = "IRestaurantServiceBA", targetNamespace = "http://www.jboss.com/jbosstm/xts/demo/Restaurant") 17 | @SOAPBinding(style = SOAPBinding.Style.RPC) 18 | public interface IRestaurantServiceBA { 19 | 20 | 21 | /** 22 | * 23 | * @param howMany 24 | * @return 25 | * returns boolean 26 | */ 27 | @WebMethod 28 | @WebResult(name = "bookSeatsBAResponse", partName = "bookSeatsBAResponse") 29 | public boolean bookSeats( 30 | @WebParam(name = "how_many", partName = "how_many") 31 | int howMany); 32 | 33 | } -------------------------------------------------------------------------------- /ArjunaJTS/recovery/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # ALLOW JOBS TO BE BACKGROUNDED 4 | set -m 5 | 6 | echo "Running recovery quickstart" 7 | 8 | # if you want to test using the sun orb you 9 | OPENJDK_CONFIG="-Dcom.sun.CORBA.POA.ORBServerId=1 -Dcom.sun.CORBA.POA.ORBPersistentServerPort=12567" 10 | 11 | [ "x$QUICKSTART_NARAYANA_VERSION" != 'x' ] &&\ 12 | NARAYANA_VERSION_PARAM="-Dversion.narayana=${QUICKSTART_NARAYANA_VERSION}" 13 | 14 | echo "Generating a recovery record ..." 15 | mvn -e exec:java -Dexec.mainClass=Test -Dexec.args="-crash" $OPENJDK_CONFIG $NARAYANA_VERSION_PARAM 16 | 17 | echo "Recovering failed service - this could take up to a minute or so ..." 18 | mvn -e exec:java -Dexec.mainClass=Test -Dexec.args="-recover -auto" $OPENJDK_CONFIG $NARAYANA_VERSION_PARAM 19 | 20 | XID1="target/ExampleXAResource1.xid_" 21 | XID2="target/ExampleXAResource2.xid_" 22 | 23 | echo "Testing that the XID data files were removed" 24 | 25 | if [ -f $XID1 -a -f $XID2 ]; then 26 | echo "JTS example failed" 27 | exit -1 28 | else 29 | echo "JTS example passed" 30 | fi 31 | -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/rpc/src/main/dd/jboss/client-jaxrpc-mapping.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | com.arjuna.xts.nightout.clients.jboss.restaurant 8 | http://www.jboss.com/jbosstm/xts/demo/Restaurant 9 | 10 | 11 | com.arjuna.xts.nightout.clients.jboss.theatre 12 | http://www.jboss.com/jbosstm/xts/demo/Theatre 13 | 14 | 15 | com.arjuna.xts.nightout.clients.jboss.taxi 16 | http://www.jboss.com/jbosstm/xts/demo/Taxi 17 | 18 | -------------------------------------------------------------------------------- /rts/at/service/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | org.jboss.narayana.quickstart.rts 7 | restat-quickstarts 8 | 7.3.4.Final-SNAPSHOT 9 | 10 | service-quickstarts 11 | RESTAT Service Quickstarts 12 | Provides examples of how to create REST based transactional services 13 | pom 14 | 15 | 16 | 17 | 18 | 19 | 20 | org.jboss.resteasy 21 | resteasy-core 22 | 23 | 24 | 25 | 26 | service1 27 | service2 28 | 29 | -------------------------------------------------------------------------------- /wildfly/setCheckedActionFactoryExample/src/main/webapp/checkedActionFactoryExample.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | test 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /XTS/wsat-jta-multi_hop/src/test/java/org/jboss/narayana/quickstarts/wsat/jtabridge/fromjta/FirstClient.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.wsat.jtabridge.fromjta; 2 | 3 | import org.jboss.narayana.quickstarts.wsat.jtabridge.first.jaxws.FirstServiceAT; 4 | 5 | import javax.xml.namespace.QName; 6 | import jakarta.xml.ws.Service; 7 | import java.net.URL; 8 | 9 | /** 10 | * @author paul.robinson@redhat.com, 2012-05-03 11 | */ 12 | public class FirstClient { 13 | 14 | public static FirstServiceAT newInstance() throws Exception { 15 | URL wsdlLocation = new URL("http://localhost:8080/bridge/FirstServiceATService/FirstServiceAT?wsdl"); 16 | QName serviceName = new QName("http://www.jboss.org/narayana/quickstarts/wsat/simple/first", "FirstServiceATService"); 17 | QName portName = new QName("http://www.jboss.org/narayana/quickstarts/wsat/simple/first", "FirstServiceAT"); 18 | 19 | Service service = Service.create(wsdlLocation, serviceName); 20 | FirstServiceAT client = service.getPort(portName, FirstServiceAT.class); 21 | 22 | return client; 23 | } 24 | } -------------------------------------------------------------------------------- /rts/at/annotation/common-service/src/main/java/io/narayana/sra/demo/constant/ServiceConstant.java: -------------------------------------------------------------------------------- 1 | package io.narayana.sra.demo.constant; 2 | 3 | public class ServiceConstant { 4 | public static final String HOTEL_PATH = "/hotel"; 5 | public static final String HOTEL_NAME_PARAM = "hotelName"; 6 | public static final String HOTEL_BEDS_PARAM = "beds"; 7 | 8 | public static final String FLIGHT_PATH = "/flight"; 9 | public static final String FLIGHT_NUMBER_PARAM = "flightNumber"; 10 | public static final String ALT_FLIGHT_NUMBER_PARAM = "altFlightNumber"; 11 | public static final String FLIGHT_SEATS_PARAM = "flightSeats"; 12 | 13 | public static final String TRIP_PATH = "/trip"; 14 | public static final String SERVICE_PORT_PROPERTY = "quarkus.http.port"; 15 | 16 | public static final String HOTEL_SERVICE_PORT_PROPERTY = "hotel.quarkus.http.port"; 17 | 18 | public static final String FLIGHT_SERVICE_PORT_PROPERTY = "flight.quarkus.http.port"; 19 | 20 | public static final String BOOKING_ID = "bookingId"; 21 | public static final String SRA_ID = "sraId"; 22 | } 23 | -------------------------------------------------------------------------------- /XTS/wsat-jta-multi_service/src/test/java/org/jboss/narayana/quickstarts/wsat/jtabridge/fromjta/FirstClient.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.wsat.jtabridge.fromjta; 2 | 3 | import org.jboss.narayana.quickstarts.wsat.jtabridge.first.jaxws.FirstServiceAT; 4 | 5 | import javax.xml.namespace.QName; 6 | import jakarta.xml.ws.Service; 7 | import java.net.URL; 8 | 9 | /** 10 | * @author paul.robinson@redhat.com, 2012-05-03 11 | */ 12 | public class FirstClient { 13 | 14 | public static FirstServiceAT newInstance() throws Exception { 15 | URL wsdlLocation = new URL("http://localhost:8080/bridge/FirstServiceATService/FirstServiceAT?wsdl"); 16 | QName serviceName = new QName("http://www.jboss.org/narayana/quickstarts/wsat/simple/first", "FirstServiceATService"); 17 | QName portName = new QName("http://www.jboss.org/narayana/quickstarts/wsat/simple/first", "FirstServiceAT"); 18 | 19 | Service service = Service.create(wsdlLocation, serviceName); 20 | FirstServiceAT client = service.getPort(portName, FirstServiceAT.class); 21 | 22 | return client; 23 | } 24 | } -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/test/src/test/resources/arquillian.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | ${jbossHome} 9 | standalone-xts.xml 10 | ${modular.jdk.args} ${server.jvm.args} 11 | ${node0:127.0.0.1} 12 | 13 | 14 | 15 | 60000 16 | 60000 17 | 60000 18 | 60000 19 | 20 | -------------------------------------------------------------------------------- /XTS/wsat-jta-multi_hop/src/main/java/org/jboss/narayana/quickstarts/wsat/jtabridge/second/SecondClient.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.wsat.jtabridge.second; 2 | 3 | import org.jboss.narayana.quickstarts.wsat.jtabridge.second.jaxws.SecondServiceAT; 4 | 5 | import javax.xml.namespace.QName; 6 | import jakarta.xml.ws.Service; 7 | import java.net.URL; 8 | 9 | /** 10 | * @author paul.robinson@redhat.com, 2012-05-03 11 | */ 12 | public class SecondClient { 13 | 14 | public static SecondServiceAT newInstance() throws Exception { 15 | URL wsdlLocation = new URL("http://localhost:8080/bridge/SecondServiceATService/SecondServiceAT?wsdl"); 16 | QName serviceName = new QName("http://www.jboss.org/narayana/quickstarts/wsat/simple/second", "SecondServiceATService"); 17 | QName portName = new QName("http://www.jboss.org/narayana/quickstarts/wsat/simple/second", "SecondServiceAT"); 18 | 19 | Service service = Service.create(wsdlLocation, serviceName); 20 | SecondServiceAT client = service.getPort(portName, SecondServiceAT.class); 21 | 22 | return client; 23 | } 24 | } -------------------------------------------------------------------------------- /spring/jta/README.md: -------------------------------------------------------------------------------- 1 | Integration with Narayana and Spring 2 | ================================================================================================== 3 | Author: Amos Feng; 4 | Level: Intermediate; 5 | Technologies: JTA, JTS, Spring 6 | 7 | What is it? 8 | ----------- 9 | 10 | The jta example shows how to config the narayana transaction manager with spring annotation. 11 | 12 | 13 | 14 | System requirements 15 | ------------------- 16 | 17 | All you need to build this project is Java 7.0 (Java SDK 1.7) or better and Maven 3.0 or better. 18 | 19 | 20 | Build and Run the Spring JTA Quickstart 21 | ------------------------------- 22 | 23 | 1. Open a command line and navigate to the root directory of this quickstart. 24 | * Build and run the tests: 25 | 26 | mvn clean install 27 | * Run the commit example 28 | 29 | java -jar jta/target/spring-jta.jar 30 | * Run the recovery example 31 | 32 | java -jar jta/target/spring-jta.jar -f 33 | java -jar jta/target/spring-jta.jar -r 34 | * Check the database after recovery 35 | 36 | java -jar jta/target/spring-jta.jar -c 37 | -------------------------------------------------------------------------------- /XTS/wsat-jta-multi_service/src/test/java/org/jboss/narayana/quickstarts/wsat/jtabridge/fromjta/SecondClient.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.wsat.jtabridge.fromjta; 2 | 3 | import org.jboss.narayana.quickstarts.wsat.jtabridge.second.jaxws.SecondServiceAT; 4 | 5 | import javax.xml.namespace.QName; 6 | import jakarta.xml.ws.Service; 7 | import java.net.URL; 8 | 9 | /** 10 | * @author paul.robinson@redhat.com, 2012-05-03 11 | */ 12 | public class SecondClient { 13 | 14 | public static SecondServiceAT newInstance() throws Exception { 15 | URL wsdlLocation = new URL("http://localhost:8180/bridge/SecondServiceATService/SecondServiceAT?wsdl"); 16 | QName serviceName = new QName("http://www.jboss.org/narayana/quickstarts/wsat/simple/second", "SecondServiceATService"); 17 | QName portName = new QName("http://www.jboss.org/narayana/quickstarts/wsat/simple/second", "SecondServiceAT"); 18 | 19 | Service service = Service.create(wsdlLocation, serviceName); 20 | SecondServiceAT client = service.getPort(portName, SecondServiceAT.class); 21 | 22 | return client; 23 | } 24 | } -------------------------------------------------------------------------------- /ArjunaJTS/interop/resource/src/main/java/org/jboss/narayana/ASFailureType.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Specification of when to inject a failure 7 | */ 8 | public enum ASFailureType implements Serializable 9 | { 10 | NONE 11 | 12 | ,PRE_PREPARE // do something before prepare is called 13 | 14 | ,XARES_START // failures specific to the XA protocol 15 | ,XARES_END 16 | ,XARES_PREPARE 17 | ,XARES_ROLLBACK 18 | ,XARES_COMMIT 19 | ,XARES_RECOVER 20 | ,XARES_FORGET 21 | 22 | ,SYNCH_BEFORE // do something before completion 23 | ,SYNCH_AFTER 24 | ; 25 | 26 | public static ASFailureType toEnum(String type) 27 | { 28 | return ASFailureType.valueOf(type.toUpperCase()); 29 | } 30 | 31 | public boolean isXA() 32 | { 33 | return name().startsWith("XARES"); 34 | } 35 | 36 | public boolean isSynchronization() 37 | { 38 | return name().startsWith("SYNCH"); 39 | } 40 | 41 | public boolean isPreCommit() 42 | { 43 | return equals(PRE_PREPARE); 44 | } 45 | } -------------------------------------------------------------------------------- /jta-1_2-in-wildfly/src/main/java/org/jboss/narayana/quickstarts/jta/QuickstartEntity.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.jta; 2 | 3 | import jakarta.persistence.Entity; 4 | import jakarta.persistence.GeneratedValue; 5 | import jakarta.persistence.GenerationType; 6 | import jakarta.persistence.Id; 7 | 8 | /** 9 | * @author Gytis Trikleris 10 | */ 11 | @Entity 12 | public class QuickstartEntity { 13 | 14 | @Id 15 | @GeneratedValue(strategy = GenerationType.AUTO) 16 | private Long id; 17 | 18 | private String name; 19 | 20 | public QuickstartEntity() { 21 | } 22 | 23 | public QuickstartEntity(String name) { 24 | this.name = name; 25 | } 26 | 27 | public Long getId() { 28 | return id; 29 | } 30 | 31 | public void setId(Long id) { 32 | this.id = id; 33 | } 34 | 35 | public boolean isTransient() { 36 | return this.id == null; 37 | } 38 | 39 | public String getName() { 40 | return name; 41 | } 42 | 43 | public void setName(String name) { 44 | this.name = name; 45 | } 46 | } -------------------------------------------------------------------------------- /ArjunaJTS/interop/test-ejbs/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 11 | 12 | jakarta.ws.rs.core.Application 13 | 1 14 | 15 | 16 | jakarta.ws.rs.core.Application 17 | /rs/* 18 | 19 | 20 | -------------------------------------------------------------------------------- /compensating-transactions/mongodb-simple/src/main/java/org/jboss/narayana/quickstarts/mongodb/simple/CreditData.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.mongodb.simple; 2 | 3 | import org.jboss.narayana.compensations.api.CompensationScoped; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * This is a CompensationScoped POJO that is used to store data against the current running compensating transaction. 9 | * 10 | * This scope is also available to the compensation handlers. 11 | * 12 | * @author paul.robinson@redhat.com 09/01/2014 13 | */ 14 | @CompensationScoped 15 | public class CreditData implements Serializable { 16 | 17 | private String toAccount; 18 | private Double amount; 19 | 20 | public CreditData() {} 21 | 22 | public void setToAccount(String toAccount) { 23 | 24 | this.toAccount = toAccount; 25 | } 26 | 27 | public void setAmount(Double amount) { 28 | 29 | this.amount = amount; 30 | } 31 | 32 | public String getToAccount() { 33 | 34 | return toAccount; 35 | } 36 | 37 | public Double getAmount() { 38 | 39 | return amount; 40 | } 41 | } -------------------------------------------------------------------------------- /rts/at/recovery/recovery2/src/main/java/quickstart/WorkDeserializer.java: -------------------------------------------------------------------------------- 1 | package quickstart; 2 | 3 | import org.jboss.narayana.rest.integration.api.Participant; 4 | import org.jboss.narayana.rest.integration.api.ParticipantDeserializer; 5 | 6 | import java.io.ObjectInputStream; 7 | 8 | // REST-AT transactions obey ACID properties and for a 9 | // participant to be durable it must be serializable 10 | // Participants are serialized if they successfully prepare 11 | public class WorkDeserializer implements ParticipantDeserializer { 12 | @Override 13 | public Participant deserialize(ObjectInputStream objectInputStream) { 14 | try { 15 | Object object = objectInputStream.readObject(); 16 | if (object instanceof Participant) { 17 | return (Participant) object; 18 | } 19 | } catch (Exception e) { 20 | System.err.printf("Cannot deserialize into Work: %s\n", e.getMessage()); 21 | } 22 | 23 | return null; 24 | } 25 | 26 | @Override 27 | public Participant recreate(byte[] recoveryState) { 28 | return null; 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /rts/at/service/service2/src/main/java/quickstart/WorkDeserializer.java: -------------------------------------------------------------------------------- 1 | package quickstart; 2 | 3 | import org.jboss.narayana.rest.integration.api.Participant; 4 | import org.jboss.narayana.rest.integration.api.ParticipantDeserializer; 5 | 6 | import java.io.ObjectInputStream; 7 | 8 | // REST-AT transactions obey ACID properties and for a 9 | // participant to be durable it must be serializable 10 | // Participants are serialized if they successfully prepare 11 | public class WorkDeserializer implements ParticipantDeserializer { 12 | @Override 13 | public Participant deserialize(ObjectInputStream objectInputStream) { 14 | try { 15 | Object object = objectInputStream.readObject(); 16 | if (object instanceof Participant) { 17 | return (Participant) object; 18 | } 19 | } catch (Exception e) { 20 | System.err.printf("Cannot deserialize into Work: %s\n", e.getMessage()); 21 | } 22 | 23 | return null; 24 | } 25 | 26 | @Override 27 | public Participant recreate(byte[] recoveryState) { 28 | return null; 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /compensating-transactions/mongodb-simple/src/main/java/org/jboss/narayana/quickstarts/mongodb/simple/DebitData.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.mongodb.simple; 2 | 3 | import org.jboss.narayana.compensations.api.CompensationScoped; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * This is a CompensationScoped POJO that is used to store data against the current running compensating transaction. 9 | * 10 | * This scope is also available to the compensation handlers. 11 | * 12 | * @author paul.robinson@redhat.com 09/01/2014 13 | */ 14 | @CompensationScoped 15 | public class DebitData implements Serializable { 16 | 17 | private String fromAccount; 18 | private Double amount; 19 | 20 | public DebitData() {} 21 | 22 | public void setFromAccount(String fromAccount) { 23 | 24 | this.fromAccount = fromAccount; 25 | } 26 | 27 | public void setAmount(Double amount) { 28 | 29 | this.amount = amount; 30 | } 31 | 32 | public String getFromAccount() { 33 | 34 | return fromAccount; 35 | } 36 | 37 | public Double getAmount() { 38 | 39 | return amount; 40 | } 41 | } -------------------------------------------------------------------------------- /compensating-transactions/mongodb-simple/src/main/java/org/jboss/narayana/quickstarts/mongodb/simple/Resources.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.mongodb.simple; 2 | 3 | import com.mongodb.DB; 4 | import com.mongodb.MongoClient; 5 | 6 | import jakarta.enterprise.inject.Produces; 7 | import jakarta.enterprise.inject.spi.InjectionPoint; 8 | 9 | /** 10 | * A simple class for managing the lifecycle of the MongoDB connection and making it available for CDI injection. 11 | * 12 | * @author paul.robinson@redhat.com 12/04/2014 13 | */ 14 | public class Resources { 15 | 16 | /** 17 | * This producer method acts as a factory for creating DB instances used to interact with the MongoDB server. 18 | * 19 | * WARNING: this pattern is not recommended as creates a new connection for every injection point and never cleans 20 | * up connections. 21 | * 22 | * @param injectionPoint 23 | * @return 24 | */ 25 | @Produces 26 | public DB produceDB(InjectionPoint injectionPoint) { 27 | MongoClient mongo = new MongoClient("localhost", 27017); 28 | return mongo.getDB("test"); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/rpc/src/main/java/com/arjuna/mw/wst/service/JaxRPCSubordinateHeaderContextProcessor.java: -------------------------------------------------------------------------------- 1 | package com.arjuna.mw.wst.service; 2 | 3 | import javax.xml.rpc.handler.Handler; 4 | import javax.xml.rpc.handler.MessageContext; 5 | import javax.xml.rpc.handler.soap.SOAPMessageContext; 6 | import jakarta.xml.soap.SOAPMessage; 7 | 8 | /** 9 | * The class is used to perform WS-Transaction context insertion 10 | * and extraction for application level SOAP messages using JaxRPC. 11 | */ 12 | public class JaxRPCSubordinateHeaderContextProcessor extends JaxRPCHeaderContextProcessor implements Handler 13 | { 14 | /** 15 | * Handle the request. 16 | * @param messageContext The current message context. 17 | */ 18 | public boolean handleRequest(final MessageContext messageContext) 19 | { 20 | final SOAPMessageContext soapMessageContext = (SOAPMessageContext)messageContext ; 21 | final SOAPMessage soapMessage = soapMessageContext.getMessage() ; 22 | 23 | // the generic handler can do the job for us -- just pass the correct flag 24 | 25 | return handleInboundMessage(soapMessage, false); 26 | } 27 | } -------------------------------------------------------------------------------- /compensating-transactions/README.md: -------------------------------------------------------------------------------- 1 | Compensating Transactions Quickstarts 2 | ===================================== 3 | 4 | These examples demonstrate the use of our API for developing applications that use Compensating Transactions. This API 5 | provides an alternative to ACID transactions which is often a good alternative in situations where ACID is not apropriate, 6 | yet some of the transactional guarantees are still required. 7 | 8 | See the following series of articles for a fuller description of when to use compensating transactions: http://jbossts.blogspot.co.uk/2013/05/compensating-transactions-when-acid-is.html 9 | 10 | 11 | Non-transactional Resource 12 | -------------- 13 | This simple example shows how a non-transactional activity (such as sending an email, or printing a document) can be coordinated 14 | in a compensating transaction. 15 | 16 | 17 | Travel Agent 18 | ------------ 19 | This more complex example shows how a long running compensating transaction can be composed of a series of short-running 20 | ACID transactions. The example also involves multiple organisations and forms a distributed transaction over Web Services. 21 | 22 | -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/core/src/main/java/com/jboss/jbosstm/xts/demo/theatre/ITheatreServiceBA.java: -------------------------------------------------------------------------------- 1 | package com.jboss.jbosstm.xts.demo.theatre; 2 | 3 | import jakarta.jws.WebMethod; 4 | import jakarta.jws.WebParam; 5 | import jakarta.jws.WebResult; 6 | import jakarta.jws.WebService; 7 | import jakarta.jws.soap.SOAPBinding; 8 | 9 | 10 | /** 11 | * This class was generated by the JAX-WS RI. 12 | * JAX-WS RI 2.1.2-hudson-182-RC1 13 | * Generated source version: 2.0 14 | * 15 | */ 16 | @WebService(name = "ITheatreServiceBA", targetNamespace = "http://www.jboss.com/jbosstm/xts/demo/Theatre") 17 | @SOAPBinding(style = SOAPBinding.Style.RPC) 18 | public interface ITheatreServiceBA { 19 | 20 | 21 | /** 22 | * 23 | * @param howMany 24 | * @param whichArea 25 | * @return 26 | * returns boolean 27 | */ 28 | @WebMethod 29 | @WebResult(name = "bookSeatsBAResponse", partName = "bookSeatsBAResponse") 30 | public boolean bookSeats( 31 | @WebParam(name = "how_many", partName = "how_many") 32 | int howMany, 33 | @WebParam(name = "which_area", partName = "which_area") 34 | int whichArea); 35 | 36 | } -------------------------------------------------------------------------------- /XTS/wsat-jta-multi_hop/src/main/java/org/jboss/narayana/quickstarts/wsat/jtabridge/first/FirstCounterEntity.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.wsat.jtabridge.first; 2 | 3 | import jakarta.persistence.Entity; 4 | import jakarta.persistence.Id; 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @author paul.robinson@redhat.com, 2012-05-03 9 | */ 10 | @Entity 11 | public class FirstCounterEntity implements Serializable { 12 | 13 | private int id; 14 | private int counter; 15 | 16 | public FirstCounterEntity() { 17 | } 18 | 19 | public FirstCounterEntity(int id, int initialCounterValue) { 20 | this.id = id; 21 | this.counter = initialCounterValue; 22 | } 23 | 24 | @Id 25 | public int getId() { 26 | return id; 27 | } 28 | 29 | public void setId(int id) { 30 | this.id = id; 31 | } 32 | 33 | public int getCounter() { 34 | return counter; 35 | } 36 | 37 | public void setCounter(int counter) { 38 | this.counter = counter; 39 | } 40 | 41 | public void incrementCounter(int howMany) { 42 | setCounter(getCounter() + howMany); 43 | } 44 | } -------------------------------------------------------------------------------- /XTS/wsat-jta-multi_service/src/main/java/org/jboss/narayana/quickstarts/wsat/jtabridge/first/FirstCounterEntity.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.wsat.jtabridge.first; 2 | 3 | import jakarta.persistence.Entity; 4 | import jakarta.persistence.Id; 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @author paul.robinson@redhat.com, 2012-05-03 9 | */ 10 | @Entity 11 | public class FirstCounterEntity implements Serializable { 12 | 13 | private int id; 14 | private int counter; 15 | 16 | public FirstCounterEntity() { 17 | } 18 | 19 | public FirstCounterEntity(int id, int initialCounterValue) { 20 | this.id = id; 21 | this.counter = initialCounterValue; 22 | } 23 | 24 | @Id 25 | public int getId() { 26 | return id; 27 | } 28 | 29 | public void setId(int id) { 30 | this.id = id; 31 | } 32 | 33 | public int getCounter() { 34 | return counter; 35 | } 36 | 37 | public void setCounter(int counter) { 38 | this.counter = counter; 39 | } 40 | 41 | public void incrementCounter(int howMany) { 42 | setCounter(getCounter() + howMany); 43 | } 44 | } -------------------------------------------------------------------------------- /jta-and-hibernate-standalone/src/main/java/org/jboss/narayana/quickstart/jta/EntityManagerFactoryProducer.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.jta; 2 | 3 | import jakarta.annotation.PostConstruct; 4 | import jakarta.enterprise.inject.Disposes; 5 | import jakarta.enterprise.inject.Produces; 6 | import jakarta.inject.Singleton; 7 | import jakarta.persistence.EntityManagerFactory; 8 | import jakarta.persistence.Persistence; 9 | 10 | /** 11 | * CDI producer of the EntityManagerFactory. 12 | * 13 | * @author Gytis Trikleris 14 | */ 15 | @Singleton 16 | public class EntityManagerFactoryProducer { 17 | 18 | private EntityManagerFactory entityManagerFactory; 19 | 20 | @PostConstruct 21 | public void postConstruct() { 22 | entityManagerFactory = Persistence.createEntityManagerFactory("quickstart-persistence-unit"); 23 | } 24 | 25 | @Produces 26 | public EntityManagerFactory createEntityManagerFactory() { 27 | return entityManagerFactory; 28 | } 29 | 30 | public void close(@Disposes EntityManagerFactory entityManagerFactory) { 31 | entityManagerFactory.close(); 32 | } 33 | } -------------------------------------------------------------------------------- /XTS/raw-xts-api-demo/test/src/test/resources/logging.properties: -------------------------------------------------------------------------------- 1 | 2 | # Additional logger names to configure (root logger is always configured) 3 | loggers=sun.rmi,org.jboss.shrinkwrap 4 | logger.org.jboss.shrinkwrap.level=INFO 5 | logger.sun.rmi.level=WARNING 6 | 7 | # Root logger level 8 | logger.level=DEBUG 9 | 10 | # Root logger handlers 11 | logger.handlers=FILE, CONSOLE 12 | 13 | # Console handler configuration 14 | handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler 15 | handler.CONSOLE.properties=autoFlush 16 | handler.CONSOLE.level=INFO 17 | handler.CONSOLE.autoFlush=true 18 | handler.CONSOLE.formatter=PATTERN 19 | 20 | # File handler configuration 21 | handler.FILE=org.jboss.logmanager.handlers.FileHandler 22 | handler.FILE.level=DEBUG 23 | handler.FILE.properties=autoFlush,fileName 24 | handler.FILE.autoFlush=true 25 | handler.FILE.fileName=./target/test.log 26 | handler.FILE.formatter=PATTERN 27 | 28 | # Formatter pattern configuration 29 | formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter 30 | formatter.PATTERN.properties=pattern 31 | formatter.PATTERN.pattern=%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n 32 | 33 | 34 | logger.sun.rmi 35 | -------------------------------------------------------------------------------- /XTS/wsat-jta-multi_hop/src/main/java/org/jboss/narayana/quickstarts/wsat/jtabridge/second/SecondCounterEntity.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.wsat.jtabridge.second; 2 | 3 | import jakarta.persistence.Entity; 4 | import jakarta.persistence.Id; 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @author paul.robinson@redhat.com, 2012-05-03 9 | */ 10 | @Entity 11 | public class SecondCounterEntity implements Serializable { 12 | 13 | private int id; 14 | private int counter; 15 | 16 | public SecondCounterEntity() { 17 | } 18 | 19 | public SecondCounterEntity(int id, int initialCounterValue) { 20 | this.id = id; 21 | this.counter = initialCounterValue; 22 | } 23 | 24 | @Id 25 | public int getId() { 26 | return id; 27 | } 28 | 29 | public void setId(int id) { 30 | this.id = id; 31 | } 32 | 33 | public int getCounter() { 34 | return counter; 35 | } 36 | 37 | public void setCounter(int counter) { 38 | this.counter = counter; 39 | } 40 | 41 | public void incrementCounter(int howMany) { 42 | setCounter(getCounter() + howMany); 43 | } 44 | } -------------------------------------------------------------------------------- /ArjunaJTA/recovery/src/main/java/org/jboss/narayana/jta/quickstarts/recovery/RecoverySetup.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.jta.quickstarts.recovery; 2 | 3 | 4 | import org.jboss.narayana.jta.quickstarts.util.Util; 5 | 6 | import com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean; 7 | import com.arjuna.ats.arjuna.common.RecoveryEnvironmentBean; 8 | import com.arjuna.ats.arjuna.recovery.RecoveryManager; 9 | import com.arjuna.common.internal.util.propertyservice.BeanPopulator; 10 | 11 | public class RecoverySetup { 12 | protected static RecoveryManager recoveryManager; 13 | 14 | public static void startRecovery() { 15 | BeanPopulator.getDefaultInstance(ObjectStoreEnvironmentBean.class).setObjectStoreDir(Util.recoveryStoreDir); 16 | RecoveryManager.delayRecoveryManagerThread() ; 17 | BeanPopulator.getDefaultInstance(RecoveryEnvironmentBean.class).setRecoveryBackoffPeriod(1); 18 | recoveryManager = RecoveryManager.manager(); 19 | } 20 | 21 | public static void stopRecovery() { 22 | recoveryManager.terminate(); 23 | } 24 | 25 | protected void runRecoveryScan() { 26 | recoveryManager.scan(); 27 | } 28 | } -------------------------------------------------------------------------------- /XTS/wsat-jta-multi_service/src/main/java/org/jboss/narayana/quickstarts/wsat/jtabridge/second/SecondCounterEntity.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.wsat.jtabridge.second; 2 | 3 | import jakarta.persistence.Entity; 4 | import jakarta.persistence.Id; 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @author paul.robinson@redhat.com, 2012-05-03 9 | */ 10 | @Entity 11 | public class SecondCounterEntity implements Serializable { 12 | 13 | private int id; 14 | private int counter; 15 | 16 | public SecondCounterEntity() { 17 | } 18 | 19 | public SecondCounterEntity(int id, int initialCounterValue) { 20 | this.id = id; 21 | this.counter = initialCounterValue; 22 | } 23 | 24 | @Id 25 | public int getId() { 26 | return id; 27 | } 28 | 29 | public void setId(int id) { 30 | this.id = id; 31 | } 32 | 33 | public int getCounter() { 34 | return counter; 35 | } 36 | 37 | public void setCounter(int counter) { 38 | this.counter = counter; 39 | } 40 | 41 | public void incrementCounter(int howMany) { 42 | setCounter(getCounter() + howMany); 43 | } 44 | } -------------------------------------------------------------------------------- /XTS/wsat-jta-multi_service/src/main/java/org/jboss/narayana/quickstarts/wsat/jtabridge/first/jaxws/FirstServiceAT.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.wsat.jtabridge.first.jaxws; 2 | 3 | import jakarta.ejb.Remote; 4 | import jakarta.jws.WebMethod; 5 | import jakarta.jws.WebService; 6 | import jakarta.jws.soap.SOAPBinding; 7 | 8 | /** 9 | * Interface to a simple First. Provides simple methods to manipulate bookings. 10 | * 11 | * @author paul.robinson@redhat.com, 2012-01-04 12 | */ 13 | @WebService(name = "FirstServiceAT", targetNamespace = "http://www.jboss.org/narayana/quickstarts/wsat/simple/first") 14 | @SOAPBinding(style = SOAPBinding.Style.RPC) 15 | @Remote 16 | public interface FirstServiceAT { 17 | 18 | /** 19 | * Create a new booking 20 | */ 21 | @WebMethod 22 | public void incrementCounter(int numSeats); 23 | 24 | /** 25 | * obtain the number of existing bookings 26 | * 27 | * @return the number of current bookings 28 | */ 29 | @WebMethod 30 | public int getCounter(); 31 | 32 | /** 33 | * Reset the booking count to zero 34 | */ 35 | @WebMethod 36 | public void resetCounter(); 37 | 38 | } -------------------------------------------------------------------------------- /atsintegration/src/main/java/com/arjuna/jta/distributed/example/server/impl/ProxyXAResourceDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.arjuna.jta.distributed.example.server.impl; 2 | 3 | import java.io.IOException; 4 | import java.io.ObjectInputStream; 5 | 6 | import javax.transaction.xa.XAResource; 7 | 8 | import com.arjuna.ats.jta.recovery.SerializableXAResourceDeserializer; 9 | 10 | /** 11 | * This is an additional recovery helper that allows a transport to provide a 12 | * deserializer for its ProxyXAResource. We need this as otherwise the 13 | * transaction manager would not be able to see the transports classes. Check 14 | * out the Javadocs on {@link SerializableXAResourceDeserializer} 15 | */ 16 | public class ProxyXAResourceDeserializer implements SerializableXAResourceDeserializer { 17 | 18 | @Override 19 | public boolean canDeserialze(String className) { 20 | if (className.equals(ProxyXAResource.class.getName())) { 21 | return true; 22 | } else { 23 | return false; 24 | } 25 | } 26 | 27 | @Override 28 | public XAResource deserialze(ObjectInputStream ois) throws IOException, ClassNotFoundException { 29 | return (XAResource) ois.readObject(); 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /XTS/wsat-jta-multi_hop/src/main/java/org/jboss/narayana/quickstarts/wsat/jtabridge/second/jaxws/SecondServiceAT.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.wsat.jtabridge.second.jaxws; 2 | 3 | import jakarta.ejb.Remote; 4 | import jakarta.jws.WebMethod; 5 | import jakarta.jws.WebService; 6 | import jakarta.jws.soap.SOAPBinding; 7 | 8 | /** 9 | * Interface to a simple Second. Provides simple methods to manipulate bookings. 10 | * 11 | * @author paul.robinson@redhat.com, 2012-01-04 12 | */ 13 | @WebService(name = "SecondServiceAT", targetNamespace = "http://www.jboss.org/narayana/quickstarts/wsat/simple/second") 14 | @SOAPBinding(style = SOAPBinding.Style.RPC) 15 | @Remote 16 | public interface SecondServiceAT { 17 | 18 | /** 19 | * Create a new booking 20 | */ 21 | @WebMethod 22 | public void incrementCounter(int numSeats); 23 | 24 | /** 25 | * obtain the number of existing bookings 26 | * 27 | * @return the number of current bookings 28 | */ 29 | @WebMethod 30 | public int getCounter(); 31 | 32 | /** 33 | * Reset the booking count to zero 34 | */ 35 | @WebMethod 36 | public void resetCounter(); 37 | 38 | } -------------------------------------------------------------------------------- /XTS/wsat-jta-multi_service/src/main/java/org/jboss/narayana/quickstarts/wsat/jtabridge/second/jaxws/SecondServiceAT.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstarts.wsat.jtabridge.second.jaxws; 2 | 3 | import jakarta.ejb.Remote; 4 | import jakarta.jws.WebMethod; 5 | import jakarta.jws.WebService; 6 | import jakarta.jws.soap.SOAPBinding; 7 | 8 | /** 9 | * Interface to a simple Second. Provides simple methods to manipulate bookings. 10 | * 11 | * @author paul.robinson@redhat.com, 2012-01-04 12 | */ 13 | @WebService(name = "SecondServiceAT", targetNamespace = "http://www.jboss.org/narayana/quickstarts/wsat/simple/second") 14 | @SOAPBinding(style = SOAPBinding.Style.RPC) 15 | @Remote 16 | public interface SecondServiceAT { 17 | 18 | /** 19 | * Create a new booking 20 | */ 21 | @WebMethod 22 | public void incrementCounter(int numSeats); 23 | 24 | /** 25 | * obtain the number of existing bookings 26 | * 27 | * @return the number of current bookings 28 | */ 29 | @WebMethod 30 | public int getCounter(); 31 | 32 | /** 33 | * Reset the booking count to zero 34 | */ 35 | @WebMethod 36 | public void resetCounter(); 37 | 38 | } -------------------------------------------------------------------------------- /spring/camel-with-narayana-spring-boot/src/main/java/org/jboss/narayana/quickstart/spring/JmsConfig.java: -------------------------------------------------------------------------------- 1 | package org.jboss.narayana.quickstart.spring; 2 | 3 | import org.apache.activemq.artemis.api.core.SimpleString; 4 | import org.apache.activemq.artemis.core.settings.impl.AddressSettings; 5 | import org.springframework.boot.autoconfigure.jms.artemis.ArtemisConfigurationCustomizer; 6 | import org.springframework.boot.context.properties.ConfigurationProperties; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | /** 10 | * @author