Browse files

JBTM-1375 TXFramework Code Tidy

  • Loading branch information...
1 parent 44ef815 commit 495a2af7fe4ee469054ed0d7c1df3850fb56c21d @paulrobinson paulrobinson committed Dec 14, 2012
Showing with 3,165 additions and 1,471 deletions.
  1. +10 −0 pom.xml
  2. +20 −51 txframework/pom.xml
  3. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/at/Commit.java
  4. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/at/Error.java
  5. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/at/PostCommit.java
  6. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/at/PrePrepare.java
  7. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/at/Prepare.java
  8. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/at/Rollback.java
  9. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/at/Unknown.java
  10. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/Cancel.java
  11. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/Close.java
  12. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/Compensate.java
  13. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/Complete.java
  14. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/Completes.java
  15. +24 −2 ...rk/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/ConfirmCompleted.java
  16. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/Error.java
  17. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/Status.java
  18. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/Unknown.java
  19. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/annotation/service/ServiceRequest.java
  20. +25 −2 ...mework/src/main/java/org/jboss/narayana/txframework/api/annotation/transaction/Compensatable.java
  21. +24 −2 ...mework/src/main/java/org/jboss/narayana/txframework/api/annotation/transaction/Transactional.java
  22. +23 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/configuration/BridgeType.java
  23. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/configuration/service/Default.java
  24. +24 −3 ...rk/src/main/java/org/jboss/narayana/txframework/api/configuration/transaction/CompletionType.java
  25. +23 −2 ...work/src/main/java/org/jboss/narayana/txframework/api/configuration/trigger/BALifecycleEvent.java
  26. +28 −6 txframework/src/main/java/org/jboss/narayana/txframework/api/exception/TXControlException.java
  27. +28 −6 txframework/src/main/java/org/jboss/narayana/txframework/api/exception/TXFrameworkException.java
  28. +28 −6 ...ework/src/main/java/org/jboss/narayana/txframework/api/exception/TXFrameworkRuntimeException.java
  29. +25 −1 ...c/main/java/org/jboss/narayana/txframework/api/exception/TransactionDataUnavailableException.java
  30. +25 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/management/BATxControl.java
  31. +24 −1 txframework/src/main/java/org/jboss/narayana/txframework/api/management/TXDataMap.java
  32. +25 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/management/TxControl.java
  33. +25 −2 txframework/src/main/java/org/jboss/narayana/txframework/api/management/WSBATxControl.java
  34. +50 −44 txframework/src/main/java/org/jboss/narayana/txframework/impl/Participant.java
  35. +26 −0 txframework/src/main/java/org/jboss/narayana/txframework/impl/ServiceInvocationMeta.java
  36. +29 −8 txframework/src/main/java/org/jboss/narayana/txframework/impl/ServiceRequestInterceptor.java
  37. +44 −11 txframework/src/main/java/org/jboss/narayana/txframework/impl/TXDataMapImpl.java
  38. +24 −1 txframework/src/main/java/org/jboss/narayana/txframework/impl/as/TXFrameworkCDIExtension.java
  39. +35 −22 txframework/src/main/java/org/jboss/narayana/txframework/impl/handlers/HandlerFactory.java
  40. +28 −6 .../src/main/java/org/jboss/narayana/txframework/impl/handlers/ParticipantRegistrationException.java
  41. +24 −2 txframework/src/main/java/org/jboss/narayana/txframework/impl/handlers/ProtocolHandler.java
  42. +28 −6 ...work/src/main/java/org/jboss/narayana/txframework/impl/handlers/UnsupportedProtocolException.java
  43. +24 −1 txframework/src/main/java/org/jboss/narayana/txframework/impl/handlers/restat/client/Required.java
  44. +23 −1 ...c/main/java/org/jboss/narayana/txframework/impl/handlers/restat/client/RestClientInterceptor.java
  45. +24 −2 ...in/java/org/jboss/narayana/txframework/impl/handlers/restat/client/RestTXRequiredInterceptor.java
  46. +26 −0 ...va/org/jboss/narayana/txframework/impl/handlers/restat/client/TransactionRolledBackException.java
  47. +33 −14 ...ork/src/main/java/org/jboss/narayana/txframework/impl/handlers/restat/client/UserTransaction.java
  48. +24 −2 .../main/java/org/jboss/narayana/txframework/impl/handlers/restat/client/UserTransactionFactory.java
  49. +34 −15 ...c/main/java/org/jboss/narayana/txframework/impl/handlers/restat/service/RESTAT2PCParticipant.java
  50. +26 −1 ...work/src/main/java/org/jboss/narayana/txframework/impl/handlers/restat/service/RESTATHandler.java
  51. +27 −7 ...java/org/jboss/narayana/txframework/impl/handlers/restat/service/RestParticipantEndpointImpl.java
  52. +40 −32 ...rk/src/main/java/org/jboss/narayana/txframework/impl/handlers/wsat/WSATDurable2PCParticipant.java
  53. +38 −31 txframework/src/main/java/org/jboss/narayana/txframework/impl/handlers/wsat/WSATHandler.java
  54. +27 −0 ...work/src/main/java/org/jboss/narayana/txframework/impl/handlers/wsat/WSATParticipantRegistry.java
  55. +41 −33 ...k/src/main/java/org/jboss/narayana/txframework/impl/handlers/wsat/WSATVolatile2PCParticipant.java
  56. +36 −26 ...main/java/org/jboss/narayana/txframework/impl/handlers/wsba/WSBACoordinatorCompletionHandler.java
  57. +29 −7 .../java/org/jboss/narayana/txframework/impl/handlers/wsba/WSBACoordinatorCompletionParticipant.java
  58. +42 −20 txframework/src/main/java/org/jboss/narayana/txframework/impl/handlers/wsba/WSBAHandler.java
  59. +36 −26 ...main/java/org/jboss/narayana/txframework/impl/handlers/wsba/WSBAParticipantCompletionHandler.java
  60. +39 −24 .../java/org/jboss/narayana/txframework/impl/handlers/wsba/WSBAParticipantCompletionParticipant.java
  61. +42 −28 ...work/src/main/java/org/jboss/narayana/txframework/impl/handlers/wsba/WSBAParticipantRegistry.java
  62. +55 −53 txframework/src/main/java/org/jboss/narayana/txframework/impl/handlers/wsba/WSBATxControlImpl.java
  63. +33 −11 txframework/src/test/java/org/jboss/narayana/txframework/functional/ATBridgeTest.java
  64. +35 −14 txframework/src/test/java/org/jboss/narayana/txframework/functional/ATStatefullTest.java
  65. +49 −40 txframework/src/test/java/org/jboss/narayana/txframework/functional/ATTest.java
  66. +46 −30 txframework/src/test/java/org/jboss/narayana/txframework/functional/BACoordinatorCompletionTest.java
  67. +54 −40 txframework/src/test/java/org/jboss/narayana/txframework/functional/BAParticipantCompletionTest.java
  68. +24 −1 txframework/src/test/java/org/jboss/narayana/txframework/functional/BaseFunctionalTest.java
  69. +24 −0 txframework/src/test/java/org/jboss/narayana/txframework/functional/BaseFunctionalTestWar.java
  70. +0 −49 txframework/src/test/java/org/jboss/narayana/txframework/functional/JAXWSHandlerAnnotatonTest.java
  71. +24 −22 txframework/src/test/java/org/jboss/narayana/txframework/functional/clients/ATBridgeClient.java
  72. +24 −22 txframework/src/test/java/org/jboss/narayana/txframework/functional/clients/ATClient.java
  73. +24 −22 txframework/src/test/java/org/jboss/narayana/txframework/functional/clients/ATStatefullClient.java
  74. +24 −22 ...rc/test/java/org/jboss/narayana/txframework/functional/clients/BACoordinatorCompletionClient.java
  75. +24 −22 ...rc/test/java/org/jboss/narayana/txframework/functional/clients/BAParticipantCompletionClient.java
  76. +20 −18 ...src/test/java/org/jboss/narayana/txframework/functional/clients/JAXWSHandlerAnnotationClient.java
  77. +37 −16 txframework/src/test/java/org/jboss/narayana/txframework/functional/common/EventLog.java
  78. +23 −2 txframework/src/test/java/org/jboss/narayana/txframework/functional/common/ServiceCommand.java
  79. +27 −0 txframework/src/test/java/org/jboss/narayana/txframework/functional/common/SimpleHandler.java
  80. +28 −6 ...work/src/test/java/org/jboss/narayana/txframework/functional/common/SomeApplicationException.java
  81. +24 −2 txframework/src/test/java/org/jboss/narayana/txframework/functional/interfaces/AT.java
  82. +8 −10 txframework/src/test/java/org/jboss/narayana/txframework/functional/interfaces/ATBridge.java
  83. +24 −2 txframework/src/test/java/org/jboss/narayana/txframework/functional/interfaces/ATStatefull.java
  84. +24 −2 ...k/src/test/java/org/jboss/narayana/txframework/functional/interfaces/BACoordinatorCompletion.java
  85. +24 −2 ...k/src/test/java/org/jboss/narayana/txframework/functional/interfaces/BAParticipantCompletion.java
  86. +22 −0 ...rk/src/test/java/org/jboss/narayana/txframework/functional/interfaces/JAXWSHandlerAnnotation.java
  87. +25 −2 txframework/src/test/java/org/jboss/narayana/txframework/functional/rest/at/simpleEJB/Client.java
  88. +27 −1 ...est/java/org/jboss/narayana/txframework/functional/rest/at/simpleEJB/ClientTXInterceptorTest.java
  89. +27 −1 ...st/java/org/jboss/narayana/txframework/functional/rest/at/simpleEJB/IndirectTXManagementTest.java
  90. +27 −9 txframework/src/test/java/org/jboss/narayana/txframework/functional/rest/at/simpleEJB/Service1.java
  91. +27 −1 ...ework/src/test/java/org/jboss/narayana/txframework/functional/rest/at/simpleEJB/Service1Impl.java
  92. +27 −9 txframework/src/test/java/org/jboss/narayana/txframework/functional/rest/at/simpleEJB/Service2.java
  93. +27 −1 ...ework/src/test/java/org/jboss/narayana/txframework/functional/rest/at/simpleEJB/Service2Impl.java
  94. +11 −9 txframework/src/test/java/org/jboss/narayana/txframework/functional/services/ATBridgeImpl.java
  95. +54 −67 txframework/src/test/java/org/jboss/narayana/txframework/functional/services/ATService.java
  96. +52 −69 txframework/src/test/java/org/jboss/narayana/txframework/functional/services/ATStatefullService.java
  97. +57 −72 .../test/java/org/jboss/narayana/txframework/functional/services/BACoordinatorCompletionService.java
  98. +59 −74 .../test/java/org/jboss/narayana/txframework/functional/services/BAParticipantCompletionService.java
  99. +0 −24 ...k/src/test/java/org/jboss/narayana/txframework/functional/services/JAXWSHandlerAnnotatonImpl.java
  100. +33 −33 txframework/src/test/java/org/jboss/narayana/txframework/functional/services/SimpleEntity.java
  101. +28 −3 txframework/src/test/java/org/jboss/narayana/txframework/impl/DataManagementTest.java
  102. +44 −24 ...rc/test/java/org/jboss/narayana/txframework/impl/handlers/wsat/WSATDurable2PCParticipantTest.java
  103. +43 −24 ...c/test/java/org/jboss/narayana/txframework/impl/handlers/wsat/WSATVolatile2PCParticipantTest.java
  104. +49 −33 ...a/org/jboss/narayana/txframework/impl/handlers/wsba/WSBACoordinatorCompletionParticipantTest.java
  105. +47 −30 ...a/org/jboss/narayana/txframework/impl/handlers/wsba/WSBAParticipantCompletionParticipantTest.java
  106. +35 −13 txframework/src/test/resources/arquillian.xml
  107. +0 −38 txframework/src/test/resources/jaxws-handlers-jaxws-service.xml
  108. +33 −11 txframework/src/test/resources/persistence.xml
  109. +24 −1 txframework/src/test/resources/resttx.ejb.web.xml
  110. +20 −20 txframework/src/test/resources/web.xml
View
10 pom.xml
@@ -1013,6 +1013,16 @@
<artifactId>byteman-dtest</artifactId>
<version>2.1.2</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <version>2.3.3.Final</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
+ <version>1.1.10.Final</version>
+ </dependency>
</dependencies>
</dependencyManagement>
<properties>
View
71 txframework/pom.xml
@@ -23,37 +23,28 @@
<build>
<plugins>
<plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.1</version>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
- </plugin>
- <plugin>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.7.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
<execution>
- <id>copy-dependencies</id>
- <phase>test-compile</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <stripVersion>true</stripVersion>
- <includeGroupIds>org.jboss.byteman</includeGroupIds>
- <outputDirectory>${project.build.directory}/lib</outputDirectory>
- </configuration>
+ <id>copy-dependencies</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <stripVersion>true</stripVersion>
+ <includeGroupIds>org.jboss.byteman</includeGroupIds>
+ <outputDirectory>${project.build.directory}/lib</outputDirectory>
+ </configuration>
</execution>
- </executions>
+ </executions>
</plugin>
</plugins>
</build>
@@ -73,10 +64,10 @@
JBoss AS 7! -->
<dependency>
<groupId>org.jboss.spec</groupId>
- <artifactId>jboss-javaee-6.0</artifactId>
- <version>3.0.0.Beta1</version>
+ <artifactId>jboss-javaee-all-6.0</artifactId>
<type>pom</type>
<scope>import</scope>
+ <version>3.0.1.Final</version>
</dependency>
</dependencies>
</dependencyManagement>
@@ -93,13 +84,11 @@
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
- <version>1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.8.1</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -130,11 +119,11 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>org.jboss.narayana.xts</groupId>
- <artifactId>byteman_support</artifactId>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.narayana.xts</groupId>
+ <artifactId>byteman_support</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.jboss.narayana.rts</groupId>
<artifactId>restat-util</artifactId>
@@ -149,25 +138,8 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-frontend-jaxws</artifactId>
- <version>2.4.6</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-spi</artifactId>
- <version>2.0.2.GA</version>
- </dependency>
- <dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
- <version>2.3.1.GA</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.protocol</groupId>
@@ -177,7 +149,6 @@
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
- <version>1.1.10.Final</version>
</dependency>
</dependencies>
@@ -206,7 +177,6 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.12.4</version>
<configuration>
<skip>false</skip>
<systemPropertyVariables combine.children="append">
@@ -229,7 +199,6 @@
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.12.4</version>
<configuration>
<skip>false</skip>
</configuration>
View
26 ...work/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/at/Commit.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.lifecycle.at;
import java.lang.annotation.ElementType;
@@ -11,6 +33,6 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
-public @interface Commit
-{
+public @interface Commit {
+
}
View
26 ...ework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/at/Error.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.lifecycle.at;
import java.lang.annotation.ElementType;
@@ -11,6 +33,6 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
-public @interface Error
-{
+public @interface Error {
+
}
View
26 .../src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/at/PostCommit.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.lifecycle.at;
import java.lang.annotation.ElementType;
@@ -11,6 +33,6 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
-public @interface PostCommit
-{
+public @interface PostCommit {
+
}
View
26 .../src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/at/PrePrepare.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.lifecycle.at;
import java.lang.annotation.ElementType;
@@ -11,6 +33,6 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
-public @interface PrePrepare
-{
+public @interface PrePrepare {
+
}
View
26 ...ork/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/at/Prepare.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.lifecycle.at;
import java.lang.annotation.ElementType;
@@ -11,6 +33,6 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
-public @interface Prepare
-{
+public @interface Prepare {
+
}
View
26 ...rk/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/at/Rollback.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.lifecycle.at;
import java.lang.annotation.ElementType;
@@ -11,6 +33,6 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
-public @interface Rollback
-{
+public @interface Rollback {
+
}
View
26 ...ork/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/at/Unknown.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.lifecycle.at;
import java.lang.annotation.ElementType;
@@ -12,6 +34,6 @@
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Deprecated
-public @interface Unknown
-{
+public @interface Unknown {
+
}
View
26 ...work/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/Cancel.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.lifecycle.ba;
import java.lang.annotation.ElementType;
@@ -11,6 +33,6 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
-public @interface Cancel
-{
+public @interface Cancel {
+
}
View
26 ...ework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/Close.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.lifecycle.ba;
import java.lang.annotation.ElementType;
@@ -12,6 +34,6 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
-public @interface Close
-{
+public @interface Close {
+
}
View
26 .../src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/Compensate.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.lifecycle.ba;
import java.lang.annotation.ElementType;
@@ -11,6 +33,6 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
-public @interface Compensate
-{
+public @interface Compensate {
+
}
View
26 ...rk/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/Complete.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.lifecycle.ba;
import java.lang.annotation.ElementType;
@@ -11,6 +33,6 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
-public @interface Complete
-{
+public @interface Complete {
+
}
View
26 ...k/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/Completes.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.lifecycle.ba;
import java.lang.annotation.ElementType;
@@ -11,6 +33,6 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
-public @interface Completes
-{
+public @interface Completes {
+
}
View
26 ...ain/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/ConfirmCompleted.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.lifecycle.ba;
import java.lang.annotation.ElementType;
@@ -11,6 +33,6 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
-public @interface ConfirmCompleted
-{
+public @interface ConfirmCompleted {
+
}
View
26 ...ework/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/Error.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.lifecycle.ba;
import java.lang.annotation.ElementType;
@@ -11,6 +33,6 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
-public @interface Error
-{
+public @interface Error {
+
}
View
26 ...work/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/Status.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.lifecycle.ba;
import java.lang.annotation.ElementType;
@@ -11,6 +33,6 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
-public @interface Status
-{
+public @interface Status {
+
}
View
26 ...ork/src/main/java/org/jboss/narayana/txframework/api/annotation/lifecycle/ba/Unknown.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.lifecycle.ba;
import java.lang.annotation.ElementType;
@@ -12,6 +34,6 @@
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Deprecated
-public @interface Unknown
-{
+public @interface Unknown {
+
}
View
26 ...k/src/main/java/org/jboss/narayana/txframework/api/annotation/service/ServiceRequest.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.service;
import org.jboss.narayana.txframework.api.configuration.service.Default;
@@ -15,8 +37,8 @@
@InterceptorBinding
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE})
-public @interface ServiceRequest
-{
+public @interface ServiceRequest {
+
/**
* The class which is the target of lifecycle handler callbacks. With POJO execution mode this class is the
* direct target for handler method invocations. With EJB execution mode it identifies the EJB interface
View
27 ...rc/main/java/org/jboss/narayana/txframework/api/annotation/transaction/Compensatable.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.transaction;
import org.jboss.narayana.txframework.api.configuration.transaction.CompletionType;
@@ -13,10 +35,11 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
-public @interface Compensatable
-{
+public @interface Compensatable {
+
/**
* the specific WSBA completion protocol which should be used for a WSBA service participant
+ *
* @return
*/
public CompletionType completionType() default CompletionType.COORDINATOR;
View
26 ...rc/main/java/org/jboss/narayana/txframework/api/annotation/transaction/Transactional.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.annotation.transaction;
import org.jboss.narayana.txframework.api.configuration.BridgeType;
@@ -13,8 +35,8 @@
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
-public @interface Transactional
-{
+public @interface Transactional {
+
/**
* attribute specifying whether automatic bridging to a JTA transaction should occur when a service
* request or transactional lifecyle handler (CLOSE or COMPENSATE) is first called in an enclosing
View
25 txframework/src/main/java/org/jboss/narayana/txframework/api/configuration/BridgeType.java
@@ -1,10 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.configuration;
/**
* @author paul.robinson@redhat.com, 2012-02-04
*/
-public enum BridgeType
-{
+public enum BridgeType {
DEFAULT,
NONE,
JTA,
View
26 ...ework/src/main/java/org/jboss/narayana/txframework/api/configuration/service/Default.java
@@ -1,8 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.configuration.service;
/**
* Marker type used to provide default value for class fields in tx framework service annotations
*/
-final public class Default
-{
+final public class Default {
+
}
View
27 ...ain/java/org/jboss/narayana/txframework/api/configuration/transaction/CompletionType.java
@@ -1,10 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.configuration.transaction;
/**
- *
+ *
*/
-public enum CompletionType
-{
+public enum CompletionType {
COORDINATOR,
PARTICIPANT
}
View
25 .../main/java/org/jboss/narayana/txframework/api/configuration/trigger/BALifecycleEvent.java
@@ -1,9 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.configuration.trigger;
/**
*/
-public enum BALifecycleEvent
-{
+public enum BALifecycleEvent {
/**
* lifecycle event which happens if all service requests methods executed in the activity have read only
* outcomes or if a service request method indicates, via a control, that the activity should exit.
View
34 ...mework/src/main/java/org/jboss/narayana/txframework/api/exception/TXControlException.java
@@ -1,14 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.exception;
-public class TXControlException extends TXFrameworkException
-{
- public TXControlException(String message)
- {
+public class TXControlException extends TXFrameworkException {
+
+ public TXControlException(String message) {
+
super(message);
}
- public TXControlException(String message, Throwable cause)
- {
+ public TXControlException(String message, Throwable cause) {
+
super(message, cause);
}
}
View
34 ...work/src/main/java/org/jboss/narayana/txframework/api/exception/TXFrameworkException.java
@@ -1,14 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.exception;
-public class TXFrameworkException extends Exception
-{
- public TXFrameworkException(String message)
- {
+public class TXFrameworkException extends Exception {
+
+ public TXFrameworkException(String message) {
+
super(message);
}
- public TXFrameworkException(String message, Throwable cause)
- {
+ public TXFrameworkException(String message, Throwable cause) {
+
super(message, cause);
}
}
View
34 ...c/main/java/org/jboss/narayana/txframework/api/exception/TXFrameworkRuntimeException.java
@@ -1,14 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.exception;
-public class TXFrameworkRuntimeException extends RuntimeException
-{
- public TXFrameworkRuntimeException(String message)
- {
+public class TXFrameworkRuntimeException extends RuntimeException {
+
+ public TXFrameworkRuntimeException(String message) {
+
super(message);
}
- public TXFrameworkRuntimeException(String message, Throwable cause)
- {
+ public TXFrameworkRuntimeException(String message, Throwable cause) {
+
super(message, cause);
}
}
View
26 ...ava/org/jboss/narayana/txframework/api/exception/TransactionDataUnavailableException.java
@@ -1,15 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.exception;
/**
- * @Author paul.robinson@redhat.com 02/11/2012
+ * @author paul.robinson@redhat.com 02/11/2012
*/
public class TransactionDataUnavailableException extends TXFrameworkRuntimeException {
public TransactionDataUnavailableException(String message) {
+
super(message);
}
public TransactionDataUnavailableException(String message, Throwable cause) {
+
super(message, cause);
}
}
View
27 txframework/src/main/java/org/jboss/narayana/txframework/api/management/BATxControl.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.management;
import org.jboss.narayana.txframework.api.configuration.trigger.BALifecycleEvent;
@@ -7,8 +29,9 @@
* Interface defining a transaction control object which can be injected into a framework web service or
* lifecycle method for one of the Business Activity protocols.
*/
-public interface BATxControl extends TxControl
-{
+public interface BATxControl extends TxControl {
+
public void readOnly(BALifecycleEvent event) throws TXControlException;
+
public void completed() throws TXControlException;
}
View
25 txframework/src/main/java/org/jboss/narayana/txframework/api/management/TXDataMap.java
@@ -1,9 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.management;
import java.util.Map;
/**
- * @Author paul.robinson@redhat.com 01/11/2012
+ * @author paul.robinson@redhat.com 01/11/2012
*/
public interface TXDataMap<K, V> extends Map<K, V> {
+
}
View
27 txframework/src/main/java/org/jboss/narayana/txframework/api/management/TxControl.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.management;
import org.jboss.narayana.txframework.api.exception.TXControlException;
@@ -9,13 +31,14 @@
* operations which the web service or lifecycle method can use to influence the logic of the
* transaction.
*/
-public interface TxControl
-{
+public interface TxControl {
+
/**
* this method can be called from a web service method while a transaction is active to notify the
* framework that no changes have been made during execution of the service method.
*/
public void readOnly() throws TXControlException;
+
/**
* this method can be called from a web service or lifecycle method to notify the framework that the
* transaction has failed and may have left the service in an inconsistent state
View
27 txframework/src/main/java/org/jboss/narayana/txframework/api/management/WSBATxControl.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.api.management;
import org.jboss.narayana.txframework.api.exception.TXControlException;
@@ -6,8 +28,9 @@
* Interface defining a transaction control object which can be injected into a framework web service or
* lifecycle method for the Web Service Business Activity protocol.
*/
-public interface WSBATxControl extends BATxControl
-{
+public interface WSBATxControl extends BATxControl {
+
public void exit() throws TXControlException;
+
public void cannotComplete() throws TXControlException;
}
View
94 txframework/src/main/java/org/jboss/narayana/txframework/impl/Participant.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.impl;
import org.jboss.narayana.txframework.api.annotation.lifecycle.ba.ConfirmCompleted;
@@ -10,100 +32,84 @@
import java.util.List;
import java.util.Map;
-public abstract class Participant
-{
+public abstract class Participant {
+
protected ServiceInvocationMeta serviceInvocationMeta;
protected Map<Class<? extends Annotation>, Method> lifecycleEventMap = new HashMap<Class<? extends Annotation>, Method>();
protected List<Method> visibleMethods;
private final Map txDataMap;
- public Participant(ServiceInvocationMeta serviceInvocationMeta, Map txDataMap) throws ParticipantRegistrationException
- {
+ public Participant(ServiceInvocationMeta serviceInvocationMeta, Map txDataMap) throws ParticipantRegistrationException {
+
this.serviceInvocationMeta = serviceInvocationMeta;
visibleMethods = getAllVisibleMethods(serviceInvocationMeta.getServiceClass());
this.txDataMap = txDataMap;
}
- public void resume()
- {
+ public void resume() {
+
TXDataMapImpl.resume(txDataMap);
}
-
- public static void suspend()
- {
+
+ public static void suspend() {
+
TXDataMapImpl.suspend();
}
- protected void registerEventsOfInterest(Class<? extends Annotation>... lifecycleEvents)
- {
- for (Class<? extends Annotation> lifecycleEvent : lifecycleEvents)
- {
- for (Method method : visibleMethods)
- {
+ protected void registerEventsOfInterest(Class<? extends Annotation>... lifecycleEvents) {
+
+ for (Class<? extends Annotation> lifecycleEvent : lifecycleEvents) {
+ for (Method method : visibleMethods) {
Annotation annotation = method.getAnnotation(lifecycleEvent);
- if (annotation != null)
- {
+ if (annotation != null) {
lifecycleEventMap.put(lifecycleEvent, method);
}
}
}
}
- protected Object invoke(Class<? extends Annotation> lifecycleEvent, Object... args)
- {
+ protected Object invoke(Class<? extends Annotation> lifecycleEvent, Object... args) {
+
resume();
Method method = lifecycleEventMap.get(lifecycleEvent);
- if (method == null)
- {
+ if (method == null) {
//No handler registered
return null;
}
- try
- {
+ try {
method.setAccessible(true);
//todo: detect parameters better. Maybe have a different participant per interface.
- if (lifecycleEvent == ConfirmCompleted.class)
- {
+ if (lifecycleEvent == ConfirmCompleted.class) {
return method.invoke(serviceInvocationMeta.getProxyInstance(), args);
- }
- else
- {
+ } else {
return method.invoke(serviceInvocationMeta.getProxyInstance());
}
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
//todo: Log stacktrace to error and throw a SystemException
throw new RuntimeException("Unable to invoke method '" + method.getName() + "' on '" + serviceInvocationMeta.getServiceClass().getName() + "'", e);
- }
- finally
- {
+ } finally {
suspend();
}
}
- private List<Method> getAllVisibleMethods(Class clazz)
- {
+ private List<Method> getAllVisibleMethods(Class clazz) {
+
Method[] methods = clazz.getMethods();
Method[] declaredMethods = clazz.getDeclaredMethods();
List<Method> results = new LinkedList<Method>();
- for (Method m : methods)
- {
- if (!results.contains(m))
- {
+ for (Method m : methods) {
+ if (!results.contains(m)) {
results.add(m);
}
}
- for (Method m : declaredMethods)
- {
- if (!results.contains(m))
- {
+ for (Method m : declaredMethods) {
+ if (!results.contains(m)) {
results.add(m);
}
}
View
26 txframework/src/main/java/org/jboss/narayana/txframework/impl/ServiceInvocationMeta.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.impl;
import java.lang.reflect.Method;
@@ -12,20 +34,24 @@
private Method serviceMethod;
public ServiceInvocationMeta(Object proxyInstance, Class serviceClass, Method serviceMethod) {
+
this.proxyInstance = proxyInstance;
this.serviceClass = serviceClass;
this.serviceMethod = serviceMethod;
}
public Object getProxyInstance() {
+
return proxyInstance;
}
public Class getServiceClass() {
+
return serviceClass;
}
public Method getServiceMethod() {
+
return serviceMethod;
}
}
View
37 txframework/src/main/java/org/jboss/narayana/txframework/impl/ServiceRequestInterceptor.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.impl;
import org.jboss.narayana.txframework.api.annotation.service.ServiceRequest;
@@ -14,11 +36,11 @@
@ServiceRequest
@Interceptor
-public class ServiceRequestInterceptor
-{
+public class ServiceRequestInterceptor {
+
@AroundInvoke
- public Object intercept(InvocationContext ic) throws Throwable
- {
+ public Object intercept(InvocationContext ic) throws Throwable {
+
Method serviceMethod = ic.getMethod();
Object serviceImpl = ic.getTarget();
Class serviceClass = getServiceClass(serviceImpl);
@@ -37,14 +59,13 @@ public Object intercept(InvocationContext ic) throws Throwable
return result;
}
- private Class getServiceClass(Object serviceImpl) throws Throwable
- {
+ private Class getServiceClass(Object serviceImpl) throws Throwable {
+
if (serviceImpl instanceof TargetInstanceProxy) //Weld proxy
{
final BeanInfo bi2 = Introspector.getBeanInfo(serviceImpl.getClass().getSuperclass());
return bi2.getBeanDescriptor().getBeanClass();
- }
- else //EJB Proxy
+ } else //EJB Proxy
{
return serviceImpl.getClass();
}
View
55 txframework/src/main/java/org/jboss/narayana/txframework/impl/TXDataMapImpl.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.impl;
import org.jboss.narayana.txframework.api.exception.TransactionDataUnavailableException;
@@ -8,26 +30,25 @@
import java.util.Set;
/**
- * @Author paul.robinson@redhat.com 01/11/2012
+ * @author paul.robinson@redhat.com 01/11/2012
*/
public class TXDataMapImpl<K, V> implements TXDataMap<K, V> {
static final ThreadLocal<Map> mapThreadLocal = new ThreadLocal<Map>();
- public static void resume(Map map)
- {
+ public static void resume(Map map) {
+
mapThreadLocal.set(map);
}
- public static void suspend()
- {
+ public static void suspend() {
+
mapThreadLocal.remove();
}
- private Map<K, V> getMap()
- {
- if (mapThreadLocal.get() == null)
- {
+ private Map<K, V> getMap() {
+
+ if (mapThreadLocal.get() == null) {
throw new TransactionDataUnavailableException("There is no transaction data associated with this thread");
}
return (Map<K, V>) mapThreadLocal.get();
@@ -36,73 +57,85 @@ public static void suspend()
@Override
public int size() {
+
return getMap().size();
}
@Override
public boolean isEmpty() {
+
return getMap().isEmpty();
}
@Override
public boolean containsKey(Object o) {
+
return getMap().containsKey(o);
}
@Override
public boolean containsValue(Object o) {
+
return getMap().containsValue(o);
}
@Override
public V get(Object key) {
+
return getMap().get(key);
}
public V put(K k, V v) {
+
return (V) getMap().put(k, v);
}
@Override
public V remove(Object o) {
+
return getMap().remove(o);
}
public void putAll(Map<? extends K, ? extends V> map) {
+
getMap().putAll(map);
}
@Override
public void clear() {
+
getMap().clear();
}
@Override
public Set<K> keySet() {
+
return getMap().keySet();
}
@Override
public Collection<V> values() {
+
return getMap().values();
}
@Override
public Set<Entry<K, V>> entrySet() {
+
return getMap().entrySet();
}
@Override
public boolean equals(Object o) {
+
return getMap().equals(o);
}
@Override
public int hashCode() {
+
return getMap().hashCode();
}
-
-
}
View
25 ...amework/src/main/java/org/jboss/narayana/txframework/impl/as/TXFrameworkCDIExtension.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.impl.as;
import org.jboss.narayana.txframework.api.management.TXDataMap;
@@ -26,9 +48,10 @@
* @param bm the bean manager
*/
public void register(@Observes BeforeBeanDiscovery bbd, BeanManager bm) {
+
final AnnotatedType<ServiceRequestInterceptor> serviceRequestInterceptor = bm.createAnnotatedType(ServiceRequestInterceptor.class);
bbd.addAnnotatedType(serviceRequestInterceptor);
-
+
final AnnotatedType<RestTXRequiredInterceptor> restTXRequiredInterceptor = bm.createAnnotatedType(RestTXRequiredInterceptor.class);
bbd.addAnnotatedType(restTXRequiredInterceptor);
View
57 txframework/src/main/java/org/jboss/narayana/txframework/impl/handlers/HandlerFactory.java
@@ -1,3 +1,25 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.impl.handlers;
import com.arjuna.mw.wst11.UserTransaction;
@@ -12,46 +34,37 @@
import org.jboss.narayana.txframework.impl.handlers.wsba.WSBACoordinatorCompletionHandler;
import org.jboss.narayana.txframework.impl.handlers.wsba.WSBAParticipantCompletionHandler;
-public class HandlerFactory
-{
+public class HandlerFactory {
+
//todo: improve the way transaction type is detected.
- public static ProtocolHandler createInstance(ServiceInvocationMeta serviceInvocationMeta) throws TXFrameworkException
- {
+ public static ProtocolHandler createInstance(ServiceInvocationMeta serviceInvocationMeta) throws TXFrameworkException {
+
Compensatable Compensatable = (Compensatable) serviceInvocationMeta.getServiceClass().getAnnotation(Compensatable.class);
- if (Compensatable != null)
- {
+ if (Compensatable != null) {
CompletionType completionType = Compensatable.completionType();
- if (completionType == CompletionType.PARTICIPANT)
- {
+ if (completionType == CompletionType.PARTICIPANT) {
return new WSBAParticipantCompletionHandler(serviceInvocationMeta);
- }
- else if (completionType == CompletionType.COORDINATOR)
- {
+ } else if (completionType == CompletionType.COORDINATOR) {
return new WSBACoordinatorCompletionHandler(serviceInvocationMeta);
- }
- else
- {
+ } else {
throw new UnsupportedProtocolException("Unexpected or null completionType");
}
}
Transactional Transactional = (Transactional) serviceInvocationMeta.getServiceClass().getAnnotation(Transactional.class);
- if (Transactional != null)
- {
- if (isWSATTransactionRunning())
- {
+ if (Transactional != null) {
+ if (isWSATTransactionRunning()) {
return new WSATHandler(serviceInvocationMeta);
- }
- else //assume it must be a REST-AT transaction running.
+ } else //assume it must be a REST-AT transaction running.
{
return new RESTATHandler(serviceInvocationMeta);
}
}
throw new UnsupportedProtocolException("Expected to find a transaction type annotation on '" + serviceInvocationMeta.getServiceClass().getName() + "'");
}
- private static boolean isWSATTransactionRunning()
- {
+ private static boolean isWSATTransactionRunning() {
+
UserTransaction ut = UserTransactionFactory.userTransaction();
return !ut.transactionIdentifier().equals("Unknown");
}
View
34 ...n/java/org/jboss/narayana/txframework/impl/handlers/ParticipantRegistrationException.java
@@ -1,16 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
package org.jboss.narayana.txframework.impl.handlers;
import org.jboss.narayana.txframework.api.exception.TXFrameworkException;
-public class ParticipantRegistrationException extends TXFrameworkException
-{
- public ParticipantRegistrationException(String message)
- {
+public class ParticipantRegistrationException extends TXFrameworkException {
+
+ public ParticipantRegistrationException(String message) {
+
super(message);
}
- public ParticipantRegistrationException(String message, Throwable cause)
- {
+ public ParticipantRegistrationException(String message, Throwable cause) {
+
super(message, cause);