Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Migrated build to use Maven and rearranged source directories accordi…

…ng to dependencies.
  • Loading branch information...
commit 5b5918fa7db6b4d6e3d04be1c396e62bb4cdc87d 1 parent 9cdf9fd
@jsampson authored
Showing with 327 additions and 2,531 deletions.
  1. +0 −14 .classpath
  2. +0 −16 .cvsignore
  3. +7 −0 .gitignore
  4. +0 −17 .project
  5. +0 −2  .settings/.cvsignore
  6. +0 −3  .settings/org.eclipse.core.resources.prefs
  7. 0  CHANGES → CHANGES.txt
  8. 0  CONTRIBUTORS → CONTRIBUTORS.txt
  9. 0  LICENSE → LICENSE.txt
  10. 0  README → README.txt
  11. +0 −318 ant2html.xsl
  12. +0 −511 build.xml
  13. +0 −70 continuous-integration.sh
  14. +0 −1  contrib/Readme.txt
  15. +0 −196 contrib/batchedwrites/README
  16. BIN  contrib/batchedwrites/batched_prevayler.zip
  17. +0 −68 contrib/log/ParallelLogger.java
  18. +0 −130 contrib/log/SimpleTransactionLogger.java
  19. +0 −154 contrib/log/TransactionFilesReader.java
  20. +0 −121 contrib/log/TransactionLogManager.java
  21. +0 −11 contrib/rollbackWithMementoPattern/project.xml
  22. +0 −32 contrib/test/ClockMock.java
  23. +0 −115 contrib/test/ClockTest.java
  24. +0 −15 contrib/test/NullCommand.java
  25. +0 −29 contrib/util/ClockActor.java
  26. +0 −20 contrib/util/RealClock.java
  27. +20 −0 core/pom.xml
  28. 0  {src/main → core/src/main/java}/org/prevayler/Clock.java
  29. 0  {src/main → core/src/main/java}/org/prevayler/Prevayler.java
  30. 0  {src/main → core/src/main/java}/org/prevayler/Query.java
  31. 0  {src/main → core/src/main/java}/org/prevayler/SureTransactionWithQuery.java
  32. 0  {src/main → core/src/main/java}/org/prevayler/Transaction.java
  33. 0  {src/main → core/src/main/java}/org/prevayler/TransactionWithQuery.java
  34. 0  {src/main → core/src/main/java}/org/prevayler/foundation/Chunk.java
  35. 0  {src/main → core/src/main/java}/org/prevayler/foundation/Chunking.java
  36. 0  {src/main → core/src/main/java}/org/prevayler/foundation/Cool.java
  37. 0  {src/main → core/src/main/java}/org/prevayler/foundation/DeepCopier.java
  38. 0  {src/main → core/src/main/java}/org/prevayler/foundation/DurableInputStream.java
  39. 0  {src/main → core/src/main/java}/org/prevayler/foundation/DurableOutputStream.java
  40. 0  {src/main → core/src/main/java}/org/prevayler/foundation/FileManager.java
  41. 0  {src/main → core/src/main/java}/org/prevayler/foundation/Guided.java
  42. 0  {src/main → core/src/main/java}/org/prevayler/foundation/ObjectInputStreamWithClassLoader.java
  43. 0  {src/main → core/src/main/java}/org/prevayler/foundation/StopWatch.java
  44. 0  {src/main → core/src/main/java}/org/prevayler/foundation/Turn.java
  45. 0  {src/main → core/src/main/java}/org/prevayler/foundation/gzip/ContinuableGZIPInputStream.java
  46. 0  {src/main → core/src/main/java}/org/prevayler/foundation/gzip/MultiMemberGZIPInputStream.java
  47. 0  {src/main → core/src/main/java}/org/prevayler/foundation/gzip/MultiMemberGZIPOutputStream.java
  48. 0  {src/main → core/src/main/java}/org/prevayler/foundation/gzip/NonCloseableOutputStream.java
  49. 0  {src/main → core/src/main/java}/org/prevayler/foundation/monitor/LoggingMonitor.java
  50. 0  {src/main → core/src/main/java}/org/prevayler/foundation/monitor/Monitor.java
  51. 0  {src/main → core/src/main/java}/org/prevayler/foundation/monitor/NullMonitor.java
  52. 0  {src/main → core/src/main/java}/org/prevayler/foundation/monitor/SimpleMonitor.java
  53. 0  {src/main → core/src/main/java}/org/prevayler/foundation/serialization/JavaSerializer.java
  54. 0  {src/main → core/src/main/java}/org/prevayler/foundation/serialization/Serializer.java
  55. 0  {src/main → core/src/main/java}/org/prevayler/implementation/Capsule.java
  56. 0  {src/main → core/src/main/java}/org/prevayler/implementation/PrevalentSystemGuard.java
  57. 0  {src/main → core/src/main/java}/org/prevayler/implementation/PrevaylerDirectory.java
  58. 0  {src/main → core/src/main/java}/org/prevayler/implementation/PrevaylerImpl.java
  59. 0  {src/main → core/src/main/java}/org/prevayler/implementation/TransactionCapsule.java
  60. 0  {src/main → core/src/main/java}/org/prevayler/implementation/TransactionGuide.java
  61. 0  {src/main → core/src/main/java}/org/prevayler/implementation/TransactionTimestamp.java
  62. 0  {src/main → core/src/main/java}/org/prevayler/implementation/TransactionWithQueryCapsule.java
  63. 0  {src/main → core/src/main/java}/org/prevayler/implementation/clock/BrokenClock.java
  64. 0  {src/main → core/src/main/java}/org/prevayler/implementation/clock/MachineClock.java
  65. 0  {src/main → core/src/main/java}/org/prevayler/implementation/clock/PausableClock.java
  66. 0  {src/main → core/src/main/java}/org/prevayler/implementation/journal/Journal.java
  67. 0  {src/main → core/src/main/java}/org/prevayler/implementation/journal/PersistentJournal.java
  68. 0  {src/main → core/src/main/java}/org/prevayler/implementation/journal/TransientJournal.java
  69. 0  {src/main → core/src/main/java}/org/prevayler/implementation/publishing/AbstractPublisher.java
  70. 0  {src/main → core/src/main/java}/org/prevayler/implementation/publishing/CentralPublisher.java
  71. 0  {src/main → core/src/main/java}/org/prevayler/implementation/publishing/POBox.java
  72. 0  {src/main → core/src/main/java}/org/prevayler/implementation/publishing/TransactionPublisher.java
  73. 0  {src/main → core/src/main/java}/org/prevayler/implementation/publishing/TransactionSubscriber.java
  74. 0  ...→ core/src/main/java}/org/prevayler/implementation/publishing/censorship/LiberalTransactionCensor.java
  75. 0  ... → core/src/main/java}/org/prevayler/implementation/publishing/censorship/StrictTransactionCensor.java
  76. 0  {src/main → core/src/main/java}/org/prevayler/implementation/publishing/censorship/TransactionCensor.java
  77. 0  {src/main → core/src/main/java}/org/prevayler/implementation/snapshot/GenericSnapshotManager.java
  78. 0  {src/main → core/src/main/java}/org/prevayler/implementation/snapshot/NullSnapshotManager.java
  79. +0 −1  custom-targets.incl
  80. 0  {src/main → demos/demo1/src/main/java}/org/prevayler/demos/demo1/Main.java
  81. 0  {src/main → demos/demo1/src/main/java}/org/prevayler/demos/demo1/NumberKeeper.java
  82. 0  {src/main → demos/demo1/src/main/java}/org/prevayler/demos/demo1/NumberStorageTransaction.java
  83. 0  {src/main → demos/demo1/src/main/java}/org/prevayler/demos/demo1/PrimeCalculator.java
  84. 0  {root/lib → demos/demo2}/JavaMatch.license.txt
  85. 0  {root/lib → demos/demo2}/javamatch-0.2.jar
  86. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/Main.java
  87. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/MainReplica.java
  88. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/MainReplicaServer.java
  89. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/MainSkaringa.java
  90. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/MainTransient.java
  91. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/MainXStream.java
  92. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/business/Account.java
  93. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/business/AccountEntry.java
  94. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/business/AccountListener.java
  95. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/business/Bank.java
  96. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/business/BankListener.java
  97. 0  ...main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/business/transactions/AccountCreation.java
  98. 0  ...main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/business/transactions/AccountDeletion.java
  99. 0  ...n → demos/demo2/src/main/java}/org/prevayler/demos/demo2/business/transactions/AccountTransaction.java
  100. 0  ...main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/business/transactions/BankTransaction.java
  101. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/business/transactions/Deposit.java
  102. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/business/transactions/HolderChange.java
  103. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/business/transactions/Transfer.java
  104. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/business/transactions/Withdrawal.java
  105. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/gui/AccountEditFrame.java
  106. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/gui/AccountFrame.java
  107. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/gui/AllAccountsFrame.java
  108. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/gui/BankFrame.java
  109. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/gui/MatchFrame.java
  110. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/gui/NewAccountFrame.java
  111. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/gui/RobustAction.java
  112. 0  {src/main → demos/demo2/src/main/java}/org/prevayler/demos/demo2/gui/TransferFrame.java
  113. 0  {contrib → demos}/jxpath/README
  114. 0  {contrib/jxpath → demos/jxpath/src/main/java}/org/prevayler/demos/jxpath/Main.java
  115. 0  {contrib/jxpath → demos/jxpath/src/main/java}/org/prevayler/demos/jxpath/ProjectManagementSystem.java
  116. 0  {contrib/jxpath → demos/jxpath/src/main/java}/org/prevayler/demos/jxpath/commands/AddProject.java
  117. 0  {contrib/jxpath → demos/jxpath/src/main/java}/org/prevayler/demos/jxpath/commands/AddTask.java
  118. 0  {contrib/jxpath → demos/jxpath/src/main/java}/org/prevayler/demos/jxpath/model/Project.java
  119. 0  {contrib/jxpath → demos/jxpath/src/main/java}/org/prevayler/demos/jxpath/model/Task.java
  120. 0  {src/main → demos/scalability/src/main/java}/org/prevayler/demos/scalability/Main.java
  121. 0  {src/main → demos/scalability/src/main/java}/org/prevayler/demos/scalability/QueryConnection.java
  122. 0  {src/main → demos/scalability/src/main/java}/org/prevayler/demos/scalability/QueryTestRun.java
  123. 0  {src/main → demos/scalability/src/main/java}/org/prevayler/demos/scalability/Record.java
  124. 0  {src/main → demos/scalability/src/main/java}/org/prevayler/demos/scalability/RecordIterator.java
  125. 0  {src/main → demos/scalability/src/main/java}/org/prevayler/demos/scalability/ScalabilityTestRun.java
  126. 0  {src/main → demos/scalability/src/main/java}/org/prevayler/demos/scalability/ScalabilityTestSubject.java
  127. 0  {src/main → demos/scalability/src/main/java}/org/prevayler/demos/scalability/TransactionConnection.java
  128. 0  {src/main → demos/scalability/src/main/java}/org/prevayler/demos/scalability/TransactionTestRun.java
  129. 0  .../main → demos/scalability/src/main/java}/org/prevayler/demos/scalability/jdbc/JDBCQueryConnection.java
  130. 0  {src/main → demos/scalability/src/main/java}/org/prevayler/demos/scalability/jdbc/JDBCQuerySubject.java
  131. 0  ...→ demos/scalability/src/main/java}/org/prevayler/demos/scalability/jdbc/JDBCScalabilityConnection.java
  132. 0  ...in → demos/scalability/src/main/java}/org/prevayler/demos/scalability/jdbc/JDBCScalabilitySubject.java
  133. 0  ...→ demos/scalability/src/main/java}/org/prevayler/demos/scalability/jdbc/JDBCTransactionConnection.java
  134. 0  ...in → demos/scalability/src/main/java}/org/prevayler/demos/scalability/jdbc/JDBCTransactionSubject.java
  135. 0  ...rarr; demos/scalability/src/main/java}/org/prevayler/demos/scalability/prevayler/AllRecordsReplacement.java
  136. 0  .../main → demos/scalability/src/main/java}/org/prevayler/demos/scalability/prevayler/PrevalenceTest.java
  137. 0  ...r; demos/scalability/src/main/java}/org/prevayler/demos/scalability/prevayler/PrevaylerQueryConnection.java
  138. 0  ...rarr; demos/scalability/src/main/java}/org/prevayler/demos/scalability/prevayler/PrevaylerQuerySubject.java
  139. 0  ...demos/scalability/src/main/java}/org/prevayler/demos/scalability/prevayler/PrevaylerScalabilitySubject.java
  140. 0  ...os/scalability/src/main/java}/org/prevayler/demos/scalability/prevayler/PrevaylerTransactionConnection.java
  141. 0  ...demos/scalability/src/main/java}/org/prevayler/demos/scalability/prevayler/PrevaylerTransactionSubject.java
  142. 0  {src/main → demos/scalability/src/main/java}/org/prevayler/demos/scalability/prevayler/QuerySystem.java
  143. 0  ...in → demos/scalability/src/main/java}/org/prevayler/demos/scalability/prevayler/ScalabilitySystem.java
  144. 0  ...main → demos/scalability/src/main/java}/org/prevayler/demos/scalability/prevayler/TestTransaction.java
  145. 0  ...in → demos/scalability/src/main/java}/org/prevayler/demos/scalability/prevayler/TransactionSystem.java
  146. 0  {src/tutorial → demos/tutorial/src/main/java}/org/prevayler/baptism/BadTransaction.java
  147. 0  {src/tutorial → demos/tutorial/src/main/java}/org/prevayler/baptism/BaptismProblemTest.java
  148. 0  {src/tutorial → demos/tutorial/src/main/java}/org/prevayler/baptism/GoodTransaction.java
  149. 0  {src/tutorial → demos/tutorial/src/main/java}/org/prevayler/tutorial/AddTask.java
  150. 0  {src/tutorial → demos/tutorial/src/main/java}/org/prevayler/tutorial/Main.java
  151. 0  {src/tutorial → demos/tutorial/src/main/java}/org/prevayler/tutorial/RemoveTask.java
  152. 0  {src/tutorial → demos/tutorial/src/main/java}/org/prevayler/tutorial/Task.java
  153. 0  {src/tutorial → demos/tutorial/src/main/java}/org/prevayler/tutorial/TaskList.java
  154. 0  {root → }/docs/Glossary.html
  155. 0  {root → }/docs/ObjectPrevalence.html
  156. 0  { → docs}/ReleaseFileDescription.txt
  157. 0  {contrib/docsUnderConstruction/docs → docs/drafts}/PrevalenceInGeneral.txt
  158. 0  {contrib/docsUnderConstruction/docs → docs/drafts}/PrevaylerInParticular.txt
  159. 0  {contrib/transactionsFacade → extras/facade}/LICENSE
  160. 0  {contrib/transactionsFacade → extras/facade}/build.xml
  161. 0  {contrib/transactionsFacade → extras/facade}/email_introduction.txt
  162. 0  {contrib/transactionsFacade → extras/facade}/index.html
  163. 0  .../transactionsFacade/src → extras/facade/src/main/java}/org/prevayler/contrib/facade/AbstractProxy.java
  164. 0  ...rib/transactionsFacade/src → extras/facade/src/main/java}/org/prevayler/contrib/facade/MethodInfo.java
  165. 0  ...c → extras/facade/src/main/java}/org/prevayler/contrib/facade/MethodNameTransactionTypeDeterminer.java
  166. 0  ...acade/src → extras/facade/src/main/java}/org/prevayler/contrib/facade/PrevaylerTransactionsFacade.java
  167. 0  ...rib/transactionsFacade/src → extras/facade/src/main/java}/org/prevayler/contrib/facade/ProxyQuery.java
  168. 0  ...ansactionsFacade/src → extras/facade/src/main/java}/org/prevayler/contrib/facade/ProxyTransaction.java
  169. 0  ...sFacade/src → extras/facade/src/main/java}/org/prevayler/contrib/facade/ProxyTransactionWithQuery.java
  170. 0  ...ransactionsFacade/src → extras/facade/src/main/java}/org/prevayler/contrib/facade/TransactionHint.java
  171. 0  ...ransactionsFacade/src → extras/facade/src/main/java}/org/prevayler/contrib/facade/TransactionType.java
  172. 0  .../transactionsFacade/tests → extras/facade/src/test/java}/org/prevayler/contrib/facade/AnotherTest.java
  173. 0  ...ib/transactionsFacade/tests → extras/facade/src/test/java}/org/prevayler/contrib/facade/CampGuide.java
  174. 0  ...ransactionsFacade/tests → extras/facade/src/test/java}/org/prevayler/contrib/facade/CampGuideImpl.java
  175. 0  ...Facade/tests → extras/facade/src/test/java}/org/prevayler/contrib/facade/CampGuideTransactionHint.java
  176. 0  ...rib/transactionsFacade/tests → extras/facade/src/test/java}/org/prevayler/contrib/facade/CampSite.java
  177. 0  ...ansactionsFacade/tests → extras/facade/src/test/java}/org/prevayler/contrib/facade/MethodInfoTest.java
  178. 0  ...b/transactionsFacade/tests → extras/facade/src/test/java}/org/prevayler/contrib/facade/RandomGUID.java
  179. 0  ...ib/transactionsFacade/tests → extras/facade/src/test/java}/org/prevayler/contrib/facade/SmokeTest.java
  180. +54 −0 extras/factory/pom.xml
  181. 0  {src/main → extras/factory/src/main/java}/org/prevayler/PrevaylerFactory.java
  182. +51 −0 extras/log4j/pom.xml
  183. 0  {src/main → extras/log4j/src/main/java}/org/prevayler/foundation/monitor/Log4jMonitor.java
  184. 0  ...ib/rollbackWithMementoPattern → extras/memento/src/main/java}/org/prevayler/demos/memento/Account.java
  185. 0  {contrib/rollbackWithMementoPattern → extras/memento/src/main/java}/org/prevayler/demos/memento/Bank.java
  186. 0  ...Pattern → extras/memento/src/main/java}/org/prevayler/demos/memento/TestErrorRecoveryWithMementos.java
  187. 0  ...mentoPattern → extras/memento/src/main/java}/org/prevayler/demos/memento/commands/AccountCreation.java
  188. 0  ...mentoPattern → extras/memento/src/main/java}/org/prevayler/demos/memento/commands/AccountDeletion.java
  189. 0  ...ckWithMementoPattern → extras/memento/src/main/java}/org/prevayler/demos/memento/commands/Deposit.java
  190. 0  ...kWithMementoPattern → extras/memento/src/main/java}/org/prevayler/demos/memento/commands/Transfer.java
  191. 0  ...ithMementoPattern → extras/memento/src/main/java}/org/prevayler/demos/memento/commands/Withdrawal.java
  192. 0  ...rib/rollbackWithMementoPattern → extras/memento/src/main/java}/org/prevayler/util/memento/Memento.java
  193. 0  ...ackWithMementoPattern → extras/memento/src/main/java}/org/prevayler/util/memento/MementoCollector.java
  194. 0  ...thMementoPattern → extras/memento/src/main/java}/org/prevayler/util/memento/MementoManagerCommand.java
  195. 0  ...kWithMementoPattern → extras/memento/src/main/java}/org/prevayler/util/memento/MementoTransaction.java
  196. +58 −0 extras/mirror-tests/pom.xml
  197. 0  .../test → extras/mirror-tests/src/test/java}/org/prevayler/foundation/StubbornNetworkReliabiltyTest.java
  198. 0  {src/test → extras/mirror-tests/src/test/java}/org/prevayler/foundation/StubbornNetworkTest.java
  199. 0  {src/test → extras/mirror-tests/src/test/java}/org/prevayler/foundation/network/BaseNetworkMock.java
  200. 0  ...t → extras/mirror-tests/src/test/java}/org/prevayler/foundation/network/NetworkClientReceiverTest.java
  201. 0  {src/test → extras/mirror-tests/src/test/java}/org/prevayler/foundation/network/NetworkMock.java
  202. 0  {src/test → extras/mirror-tests/src/test/java}/org/prevayler/foundation/network/NetworkProxyTest.java
  203. 0  {src/test → extras/mirror-tests/src/test/java}/org/prevayler/foundation/network/NetworkSuite.java
  204. 0  {src/test → extras/mirror-tests/src/test/java}/org/prevayler/foundation/network/NetworkTest.java
  205. 0  {src/test → extras/mirror-tests/src/test/java}/org/prevayler/foundation/network/NewNetworkMock.java
  206. 0  {src/test → extras/mirror-tests/src/test/java}/org/prevayler/foundation/network/ObjectReceiverMock.java
  207. 0  ...test → extras/mirror-tests/src/test/java}/org/prevayler/foundation/network/ObjectServerSocketMock.java
  208. 0  {src/test → extras/mirror-tests/src/test/java}/org/prevayler/foundation/network/ObjectSocketMock.java
  209. 0  {src/test → extras/mirror-tests/src/test/java}/org/prevayler/foundation/network/Permit.java
  210. 0  {src/test → extras/mirror-tests/src/test/java}/org/prevayler/foundation/network/ServiceMock.java
  211. 0  ...→ extras/mirror-tests/src/test/java}/org/prevayler/foundation/network/StubbornNetworkReceiverTest.java
  212. 0  ...t → extras/mirror-tests/src/test/java}/org/prevayler/foundation/network/StubbornNetworkServerTest.java
  213. 0  {src/test → extras/mirror-tests/src/test/java}/org/prevayler/implementation/ReplicationTest.java
  214. +30 −0 extras/mirror/pom.xml
  215. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/BaseNetworkImpl.java
  216. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/Network.java
  217. 0  ...n → extras/mirror/src/main/java}/org/prevayler/foundation/network/NetworkClientObjectReceiverImpl.java
  218. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/NetworkImpl.java
  219. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/NetworkReceiverFactory.java
  220. 0  .../main → extras/mirror/src/main/java}/org/prevayler/foundation/network/NetworkServerObjectReceiver.java
  221. 0  ...n → extras/mirror/src/main/java}/org/prevayler/foundation/network/NetworkServerObjectReceiverImpl.java
  222. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/NetworkSessionId.java
  223. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/ObjectReceiver.java
  224. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/ObjectServerSocket.java
  225. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/ObjectServerSocketImpl.java
  226. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/ObjectSocket.java
  227. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/ObjectSocketImpl.java
  228. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/OldNetwork.java
  229. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/OldNetworkImpl.java
  230. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/Service.java
  231. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/SessionsManager.java
  232. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/SessionsManagerImpl.java
  233. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/StubbornClientReceiverImpl.java
  234. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/StubbornNetwork.java
  235. 0  ...in → extras/mirror/src/main/java}/org/prevayler/foundation/network/StubbornNetworkClientConnector.java
  236. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/StubbornNetworkImpl.java
  237. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/StubbornNetworkProxy.java
  238. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/foundation/network/StubbornServerReceiverImpl.java
  239. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/implementation/replication/ClientPublisher.java
  240. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/implementation/replication/ServerConnection.java
  241. 0  {src/main → extras/mirror/src/main/java}/org/prevayler/implementation/replication/ServerListener.java
  242. +37 −0 extras/skaringa/pom.xml
  243. 0  {src/main → extras/skaringa/src/main/java}/org/prevayler/foundation/serialization/SkaringaSerializer.java
  244. +44 −0 extras/xstream/pom.xml
  245. 0  {src/main → extras/xstream/src/main/java}/org/prevayler/foundation/serialization/XStreamSerializer.java
  246. +0 −75 maven.xml
  247. 0  { → old-configurations}/sample.build.properties
  248. 0  { → old-configurations}/sample.log4j.xml
  249. +26 −0 pom.xml
  250. +0 −11 project.properties
  251. +0 −40 project.xml
  252. +0 −202 root/lib/Log4j.license.txt
  253. +0 −37 root/lib/Skaringa.license.txt
  254. +0 −46 root/lib/XPP3.license.txt
  255. +0 −27 root/lib/XStream.license.txt
  256. BIN  root/lib/commons-logging-1.1.jar
  257. +0 −202 root/lib/commons-logging.license.txt
  258. BIN  root/lib/junit-3.8.1.jar
  259. +0 −47 root/lib/junit.about.html
  260. BIN  root/lib/log4j-1.2.13.jar
  261. BIN  root/lib/skaringa-r3p7.jar
  262. BIN  root/lib/xpp3_min-1.1.3_8.jar
  263. BIN  root/lib/xstream-1.1.3.jar
  264. 0  {contrib → spikes}/cluster/README
  265. 0  {contrib → spikes}/cluster/src/main/org/prevayler/cluster/ClusterListener.java
  266. 0  {contrib → spikes}/cluster/src/main/org/prevayler/cluster/ClusteredPrevayler.java
  267. 0  {contrib → spikes}/cluster/src/main/org/prevayler/cluster/ClusteredPrevaylerState.java
  268. 0  {contrib → spikes}/cluster/src/main/org/prevayler/cluster/ClusteredTransaction.java
  269. 0  {contrib → spikes}/cluster/src/main/org/prevayler/cluster/Node.java
  270. 0  {contrib → spikes}/cluster/src/test/org/prevayler/cluster/ClusteredPrevaylerTest.java
  271. 0  {contrib → spikes}/cluster/src/test/org/prevayler/cluster/NodeTest.java
  272. 0  {contrib/util → spikes/snapshotScheduler}/SnapshotScheduleLogger.java
  273. 0  {contrib/util → spikes/snapshotScheduler}/SnapshotScheduler.java
  274. 0  {contrib → spikes}/socketServer/README
  275. 0  {contrib → spikes}/socketServer/TODO
  276. 0  ...ib → spikes}/socketServer/client/org/prevayler/socketserver/client/CallbackAlreadyFreedException.class
  277. 0  ...rib → spikes}/socketServer/client/org/prevayler/socketserver/client/CallbackAlreadyFreedException.java
  278. 0  ...trib → spikes}/socketServer/client/org/prevayler/socketserver/client/CallbackThread$CallbackNode.class
  279. 0  {contrib → spikes}/socketServer/client/org/prevayler/socketserver/client/CallbackThread.class
  280. 0  {contrib → spikes}/socketServer/client/org/prevayler/socketserver/client/CallbackThread.java
  281. 0  {contrib → spikes}/socketServer/client/org/prevayler/socketserver/client/IModelCallback.class
  282. 0  {contrib → spikes}/socketServer/client/org/prevayler/socketserver/client/IModelCallback.java
  283. 0  {contrib → spikes}/socketServer/client/org/prevayler/socketserver/client/Remote.java
  284. 0  {contrib → spikes}/socketServer/client/org/prevayler/socketserver/client/Store.class
  285. 0  {contrib → spikes}/socketServer/common/org/prevayler/socketserver/transactions/DBTransaction.class
  286. 0  {contrib → spikes}/socketServer/common/org/prevayler/socketserver/transactions/Disconnect.java
  287. 0  {contrib → spikes}/socketServer/common/org/prevayler/socketserver/transactions/IDBTransaction.class
  288. 0  {contrib → spikes}/socketServer/common/org/prevayler/socketserver/transactions/IRemoteTransaction.java
  289. 0  {contrib → spikes}/socketServer/common/org/prevayler/socketserver/transactions/RemoteTransaction.java
  290. 0  {contrib → spikes}/socketServer/common/org/prevayler/socketserver/transactions/ThrownException.class
  291. 0  {contrib → spikes}/socketServer/common/org/prevayler/socketserver/transactions/ThrownException.java
  292. 0  {contrib → spikes}/socketServer/common/org/prevayler/socketserver/util/Config.class
  293. 0  {contrib → spikes}/socketServer/common/org/prevayler/socketserver/util/Config.java
  294. 0  {contrib → spikes}/socketServer/common/org/prevayler/socketserver/util/Log.class
  295. 0  {contrib → spikes}/socketServer/common/org/prevayler/socketserver/util/Log.java
  296. 0  {contrib → spikes}/socketServer/example/Config.ini
  297. 0  {contrib → spikes}/socketServer/example/README
  298. 0  {contrib → spikes}/socketServer/example/Todo.ini
  299. 0  {contrib → spikes}/socketServer/example/junkyard/BeanSetter.java
  300. 0  {contrib → spikes}/socketServer/example/junkyard/README
Sorry, we could not display the entire diff because too many files (420) changed.
View
14 .classpath
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src/main"/>
- <classpathentry kind="src" path="src/test"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="lib" path="root/lib/skaringa-r3p7.jar"/>
- <classpathentry kind="lib" path="root/lib/commons-logging-1.1.jar"/>
- <classpathentry kind="lib" path="root/lib/junit-3.8.1.jar"/>
- <classpathentry kind="lib" path="root/lib/xstream-1.1.3.jar"/>
- <classpathentry kind="lib" path="root/lib/xpp3_min-1.1.3_8.jar"/>
- <classpathentry kind="lib" path="root/lib/javamatch-0.2.jar"/>
- <classpathentry kind="lib" path="root/lib/log4j-1.2.13.jar"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
View
16 .cvsignore
@@ -1,16 +0,0 @@
-PrevalenceBase*
-prevayler.i*
-*.log
-target
-bin
-dependencies
-build.properties
-log4j.xml
-maven.log
-build.dot
-build.png
-demo*
-Test*
-ScalabilityTest*
-Query*
-TransactionTest
View
7 .gitignore
@@ -0,0 +1,7 @@
+target/
+.project
+.classpath
+.settings/
+*.ipr
+*.iml
+/tests/Test*/
View
17 .project
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>prevayler</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
View
2  .settings/.cvsignore
@@ -1,2 +0,0 @@
-org.eclipse.jdt.core.prefs
-org.eclipse.jdt.ui.prefs
View
3  .settings/org.eclipse.core.resources.prefs
@@ -1,3 +0,0 @@
-#Thu Dec 16 03:53:04 BRST 2004
-encoding/<project>=UTF-8
-eclipse.preferences.version=1
View
0  CHANGES → CHANGES.txt
File renamed without changes
View
0  CONTRIBUTORS → CONTRIBUTORS.txt
File renamed without changes
View
0  LICENSE → LICENSE.txt
File renamed without changes
View
0  README → README.txt
File renamed without changes
View
318 ant2html.xsl
@@ -1,318 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<!--
-This stylesheet is originally from: http://www-106.ibm.com/developerworks/xml/library/x-antxsl/
-Updated April 29, 2004 by Jacob Kjome
--->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<xsl:output
- method="html"
- indent="yes"
- omit-xml-declaration="yes"
- encoding="UTF-8"
- doctype-public="-//W3C//DTD XHTML 1.1//EN"
- doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"/>
-
-<xsl:template match="/">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
- <xsl:comment>XSLT stylesheet used to transform this file: ant2html.xsl</xsl:comment>
- <xsl:apply-templates select="project"/>
- </html>
-</xsl:template>
-
-<xsl:template match="project">
- <head>
- <title>Ant Project Source: <xsl:value-of select="@name"/></title>
- <style type="text/css">/*<![CDATA[*/
- html, body { font: 14px Arial, Helvetica, sans-serif; }
- caption { font-size: 16px; font-weight: bold; text-align: left; }
- tbody { border-bottom: 20px solid black; }
- th { text-align: right; white-space: nowrap; padding-left: 25px; }
- /*]]>*/</style>
- </head>
- <body bgcolor="#ffffff" marginheight="2" marginwidth="2" topmargin="2" leftmargin="2">
- <table border="1" cellspacing="0" cellpadding="2">
- <tr>
- <td valign="TOP" width="20%">
- <h2><a name="toc">Table of Contents</a></h2>
- <b><big><a href="#project">Project Attributes</a></big></b><br/><br/>
-
- <b><big><a href="#properties">Properties</a></big></b><br/>
-<!--
- <xsl:for-each select="./property/@name">
- <xsl:sort/>
- <xsl:variable name="propName" select="."/>
- <xsl:text disable-output-escaping="yes">&amp;nbsp;&amp;nbsp;&amp;nbsp;</xsl:text>
- <xsl:element name="a">
- <xsl:attribute name="href">
- <xsl:value-of select="concat('#property-',$propName)"/>
- </xsl:attribute>
- <xsl:value-of select="$propName"/>
- </xsl:element>
- <br/>
- </xsl:for-each>
--->
-
- <br/>
- <a name="toc-targets"/>
- <b><big><a href="#targets">Targets</a></big></b><br/>
- <xsl:for-each select="./target">
- <xsl:sort select="@name"/>
- <xsl:variable name="tarName" select="@name"/>
- <xsl:text disable-output-escaping="yes">&nbsp;&nbsp;&nbsp;</xsl:text>
- <xsl:element name="a">
- <xsl:attribute name="href">
- <xsl:value-of select="concat('#target-',$tarName)"/>
- </xsl:attribute>
- <xsl:value-of select="$tarName"/>
- </xsl:element>
- <br/>
- </xsl:for-each>
- </td>
-
- <td valign="top" width="80%">
- <!-- Begin project data -->
- <table border="0" cellspacing="0" cellpadding="5">
- <caption><a name="#project"/>Project Information</caption>
- <tbody>
- <tr>
- <th>Name:</th>
- <td>
- <xsl:value-of select="@name"/>
- </td>
- </tr>
- <tr>
- <th>Base directory:</th>
- <td>
- <xsl:choose>
- <xsl:when test="@basedir='.'">
- <i>current-working-directory</i>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@basedir"/>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- <tr>
- <th>Default target:</th>
- <td>
- <xsl:call-template name="formatTargetList">
- <xsl:with-param name="targets" select="@default"/>
- </xsl:call-template>
- </td>
- </tr>
- </tbody>
- </table>
-
- <hr/>
-
- <!-- Begin project data -->
- <table border="0" cellspacing="0" cellpadding="5">
- <caption><a name="properties"/><a href="#toc">Project Properties</a></caption>
- <tbody>
- <xsl:for-each select="./property/@name">
- <xsl:sort/>
- <tr>
- <th>
- <xsl:element name="a">
- <xsl:attribute name="name">
- <xsl:text>property-</xsl:text><xsl:value-of select="."/>
- </xsl:attribute>
- </xsl:element>
- <xsl:value-of select="."/>:
- </th>
- <td>
- <xsl:choose>
- <xsl:when test="count(../@location) > 0">
- <xsl:value-of select="../@location"/>
- </xsl:when>
- <xsl:when test="count(../@value) > 0">
- <xsl:value-of select="../@value"/>
- </xsl:when>
- </xsl:choose>
- </td>
- </tr>
- </xsl:for-each>
- </tbody>
- </table>
-
- <hr/>
-
- <!-- Begin project data -->
- <table border="0" cellspacing="0" cellpadding="5">
- <caption><a name="targets"/></caption>
-
- <xsl:for-each select="./target">
- <xsl:sort select="@name"/>
- <tbody>
- <tr>
- <th>
- <xsl:element name="a">
- <xsl:attribute name="name">
- <xsl:text>target-</xsl:text><xsl:value-of select="@name"/>
- </xsl:attribute>
- </xsl:element>
- Target:
- </th>
- <td>
- <xsl:value-of select="@name"/>
- </td>
- </tr>
-
- <xsl:if test="count(./@description) > 0">
- <tr>
- <th>Description:</th>
- <td>
- <xsl:value-of select="@description"/>
- </td>
- </tr>
- </xsl:if>
-
- <xsl:if test="count(./@depends) > 0">
- <tr>
- <th>Dependencies:</th>
- <td>
- <xsl:call-template name="formatTargetList">
- <xsl:with-param name="targets" select="@depends"/>
- </xsl:call-template>
- </td>
- </tr>
- </xsl:if>
-
- <tr>
- <th valign="top">Tasks:</th>
- <td>
- <xsl:choose>
- <xsl:when test="count(child::node()) > 0">
- <pre>
- <xsl:apply-templates select="child::node()"/>
- </pre>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>None</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <xsl:element name="a">
- <xsl:attribute name="href">
- <xsl:text>#toc-targets</xsl:text>
- </xsl:attribute>
- <xsl:text>Return to targets</xsl:text>
- </xsl:element>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <xsl:element name="a">
- <xsl:attribute name="href">
- <xsl:text>#toc</xsl:text>
- </xsl:attribute>
- <xsl:text>Return to table of contents</xsl:text>
- </xsl:element>
- </td>
- </tr>
-
- <xsl:if test="position() &lt; last()">
- <tr><td colspan="2"><hr/></td></tr>
- </xsl:if>
- </tbody>
- </xsl:for-each>
- </table>
- </td>
- </tr>
- </table>
- </body>
-</xsl:template>
-
- <!--
- =========================================================================
- Purpose: Copy each node and attribute, exactly as found, to the output
- tree.
- =========================================================================
- -->
- <xsl:template match="node()" name="writeTask">
- <xsl:param name="indent" select="string('')"/>
- <xsl:variable name="nodeName" select="name(.)"/>
- <xsl:if test="count(@*) > 0">
- <xsl:value-of select="$indent"/>&lt;<xsl:value-of select="$nodeName"/>
- <xsl:for-each select="@*">
- <xsl:if test="position() > 0"><xsl:value-of select="'&#10;'"/></xsl:if>
- <xsl:value-of select="concat(' ', $indent, name(),'=&quot;',.,'&quot;')"/>
- <xsl:if test="position() = last()">
- <xsl:choose>
- <xsl:when test="count(../*) > 0">&gt;</xsl:when>
- <xsl:otherwise>/&gt;</xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- <xsl:value-of select="'&#10;'"/>
- </xsl:if>
-
- <xsl:for-each select="child::node()">
- <xsl:call-template name="writeTask">
- <xsl:with-param name="indent" select="concat($indent, ' ')"/>
- </xsl:call-template>
- </xsl:for-each>
-
- <!--xsl:value-of select="$indent"/--><xsl:if test="count(child::node()) > 0">&lt;/<xsl:value-of select="$nodeName"/>&gt;</xsl:if>
-
- </xsl:template>
-
- <!--
- =========================================================================
- Purpose: Ignore comments imbedded into the text.
- =========================================================================
- -->
- <xsl:template match="comment()"/>
-
- <!--
- =========================================================================
- Purpose: Format a list of target names as references.
- =========================================================================
- -->
- <xsl:template name="formatTargetList">
- <xsl:param name="targets" select="string('')"/>
-
- <xsl:variable name="list" select="normalize-space($targets)"/>
- <xsl:variable name="first" select="normalize-space(substring-before($targets,','))"/>
- <xsl:variable name="rest" select="normalize-space(substring-after($targets,','))"/>
-
- <xsl:if test="not($list = '')">
- <xsl:choose>
- <xsl:when test="contains($list, ',')">
- <xsl:element name="a">
- <xsl:attribute name="href">
- <xsl:value-of select="concat('#target-', $first)"/>
- </xsl:attribute>
- <xsl:value-of select="$first"/>
- </xsl:element>
-
- <xsl:text>, </xsl:text>
-
- <xsl:call-template name="formatTargetList">
- <xsl:with-param name="targets" select="$rest"/>
- </xsl:call-template>
- </xsl:when>
-
- <xsl:otherwise>
- <xsl:element name="a">
- <xsl:attribute name="href">
- <xsl:value-of select="concat('#target-', $list)"/>
- </xsl:attribute>
- <xsl:value-of select="$list"/>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
-</xsl:stylesheet>
View
511 build.xml
@@ -1,511 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?xml-stylesheet type="text/xsl" href="./ant2html.xsl"?>
-<!DOCTYPE project [
- <!ENTITY general-utility-targets SYSTEM "file:./utility-targets.incl">
- <!ENTITY self-customized-targets SYSTEM "file:./custom-targets.incl">
-]>
-
-<project name="Prevayler" default="compile.core" basedir=".">
-
- <property file="${user.home}/.${ant.project.name}-build.properties"/>
- <property file="${user.home}/.build.properties"/>
- <property environment="env"/> <!-- provides property file access to system environment variables -->
- <property file="build.properties"/>
- <property file="sample.build.properties"/>
-
-
-<!-- ==================== File and Directory Names ======================== -->
-
- <!-- source and other non-generated directories -->
- <property name="rootdir" location="${basedir}/root" />
- <property name="srcdir" location="${basedir}/src" />
- <property name="srcdir.main" location="${srcdir}/main" />
- <property name="srcdir.test" location="${srcdir}/test" />
-
- <!-- generated build directories -->
- <property name="targetdir" location="${basedir}/target" />
- <property name="cachedir.demo" location="${targetdir}/demo-cache" />
- <property name="cachedir.test" location="${targetdir}/test-cache" />
- <property name="classesdir.main" location="${targetdir}/main-classes" />
- <property name="classesdir.test" location="${targetdir}/test-classes" />
- <property name="classesdir.contrib" location="${targetdir}/contrib-classes" />
- <property name="testreportdir" location="${targetdir}/test-reports" />
- <property name="libdir" location="${targetdir}/lib" />
- <property name="docdir" location="${targetdir}/docs" />
-
- <!-- Default values specified in sample.build.properties. Override in build.properties -->
- <property name="dependenciesdir" location="${dependencies.path}" />
-
- <!-- Log4j utility build and demo runtime properties -->
- <property name="log4j.system.variable.dynamic.name" value="$${${app.Name}.log.home}" />
- <property name="log4j.system.variable.name" value="${app.Name}.log.home" />
- <property name="log4j.log.path" location="${targetdir}/logs" />
-
-<!-- === Compilation Control Option Defaults. Override in build.properties === -->
-
- <property name="build.sysclasspath" value="last" />
- <property name="build.compiler" value="modern" />
- <property name="build.debug" value="on" />
- <property name="build.deprecation" value="off" />
- <property name="build.optimize" value="on" />
- <property name="build.source" value="1.3" /> <!-- source 1.3, target 1.2 - provides compatibility with JDK1.4 when built under JDK1.5+ (1.5/1.5 for JDK1.5) -->
- <property name="build.target" value="1.2" />
- <property name="build.verbose" value="off" />
-
-<!-- ==================== Compilation Classpath =========================== -->
-
- <path id="build.classpath" >
- <pathelement location="${skaringa.jar}"/>
- <pathelement location="${xstream.jar}"/>
- <pathelement location="${xpp3.jar}"/>
- <pathelement location="${jgroups.jar}"/>
- <pathelement location="${log4j.jar}"/>
- <pathelement location="${jaxen.jar}"/>
- <pathelement location="${ognl.jar}"/>
- <pathelement location="${javamatch.jar}"/>
- <pathelement location="${commons-jxpath.jar}"/>
- <pathelement location="${commons-logging.jar}"/>
- <pathelement location="${xml-apis.jar}"/> <!-- Not required under j2sdk1.4.x. Here to run xml demo under JDK1.3.x -->
- <pathelement location="${xalan.jar}"/> <!-- Not required under j2sdk1.4.x. Here to run xml demo under JDK1.3.x -->
- </path>
-
- <path id="build.core.classpath" >
- <pathelement location="${classesdir.main}" />
- <path refid="build.classpath" />
- </path>
-
- <path id="build.run.classpath" >
- <pathelement location="${classesdir.contrib}" />
- <pathelement location="${classesdir.test}" />
- <path refid="build.core.classpath" />
- </path>
-
-<!-- ==================== Rebuild Target ====================================== -->
-
- <target name="rebuild" depends="clean, compile.core"
- description="Clean, then compile core sources" />
-
-<!-- ==================== Clean Targets ==================================== -->
-
- <target
- name="clean.all"
- depends="clean, clean.cache, clean.dependencies, clean.vizant"
- description="Bring everything back to its initial clean state" />
-
- <target name="clean"
- description="Delete old build and dist directories" >
- <delete includeEmptyDirs="true">
- <fileset dir="${targetdir}" includes="**/**" excludes="*-cache/**" />
- </delete>
- </target>
-
- <target name="clean.cache"
- depends="clean.cache.tests, clean.cache.demos"
- description="Removes log and snapshot files generated by tests and demos" />
-
- <target name="clean.cache.tests"
- description="Removes log and snapshot files generated by tests" >
- <delete dir="${cachedir.test}" />
- </target>
-
- <target name="clean.cache.demos"
- description="Removes log and snapshot files generated by demos" >
- <delete dir="${cachedir.demo}" />
- </target>
-
-<!-- ==================== Prepare Target ================================== -->
-
- <target name="prepare" depends="-prepare.build" >
- <mkdir dir="target" />
- <mkdir dir="${classesdir.main}" />
- <mkdir dir="${classesdir.test}" />
- <mkdir dir="${classesdir.contrib}" />
- <mkdir dir="${log4j.log.path}" />
- <copy todir="${basedir}" >
- <fileset dir="${basedir}" excludes="sample.build.properties">
- <present present="srconly" targetdir="${basedir}">
- <mapper type="glob" from="sample.*" to="*" />
- </present>
- </fileset>
- <filterset>
- <filter token="log4j.system.variable.dynamic.name" value="${log4j.system.variable.dynamic.name}" />
- </filterset>
- <mapper type="glob" from="sample.*" to="*" />
- </copy>
- <copy file="${basedir}/log4j.xml" todir="${classesdir.main}" />
- <copy file="${rootdir}/docs/License.txt" tofile="${classesdir.main}/Prevayler.license.txt" />
- <!-- Fileset for unit tests. Default values specified in sample.build.properties. Override in build.properties -->
- <fileset id="unit.test.files"
- dir="${srcdir.test}"
- includes="${unit.test.includes}"
- excludes="${unit.test.excludes}" />
- <fileset id="unit.test.files.contrib"
- dir="${classesdir.contrib}"
- includes="${unit.test.includes.contrib}"
- excludes="${unit.test.excludes.contrib}" />
- <tstamp/>
- </target>
-
-<!-- ==================== Compile Targets ================================== -->
-
- <target name="compile" depends="compile.core, compile.test, compile.contrib"
- description="Compile all specified sources" />
- <target name="compile.core" depends="prepare, download.dependencies.core"
- description="Compile core sources" >
- <antcall target="-compile.sub">
- <param name="compsrcdir" value="${srcdir.main}" />
- <param name="compdestdir" value="${classesdir.main}" />
- <param name="compcprefid" value="build.classpath" />
- </antcall>
- </target>
- <target name="compile.test" depends="compile.core"
- description="Compile test case sources" >
- <antcall target="-compile.sub">
- <param name="compsrcdir" value="${srcdir.test}" />
- <param name="compdestdir" value="${classesdir.test}" />
- </antcall>
- </target>
- <target name="compile.contrib" depends="compile.core, download.dependencies.contrib"
- description="Compile contrib sources" >
- <antcall target="-compile.sub">
- <param name="compsrcdir" value="${src.contrib.projects}" />
- <param name="compdestdir" value="${classesdir.contrib}" />
- </antcall>
- </target>
-
-<!-- ==================== Javadoc Target ================================== -->
-
- <target name="javadoc" depends="compile.core"
- description="Create Javadoc API documentation" >
- <delete dir="${docdir}/api" />
- <mkdir dir="${docdir}/api/beginners" />
- <mkdir dir="${docdir}/api/advanced" />
- <!-- beginners -->
- <antcall target="-javadoc.sub">
- <param name="jdocincludes" value="org/prevayler" />
- <param name="jdocsourcepath" value="${srcdir.main}" />
- <param name="jdocdestdir" value="${docdir}/api/beginners" />
- </antcall>
- <!-- advanced -->
- <antcall target="-javadoc.sub">
- <param name="jdocincludes" value="org/prevayler, org/prevayler/implementation/**, org/prevayler/foundation/serialization/**" />
- <param name="jdocsourcepath" value="${srcdir.main}" />
- <param name="jdocdestdir" value="${docdir}/api/advanced" />
- </antcall>
- </target>
-
-<!-- ==================== Jar Targets ================================== -->
-
- <target name="jar" depends="compile.core"
- description="Creates all jars" >
- <delete dir="${libdir}" />
- <mkdir dir="${libdir}" />
- <!--Creates a JAR containing only essential Prevayler files -->
- <antcall target="-jar.sub">
- <param name="jarfile" value="${libdir}/${jar.name.core}.jar" />
- <param name="jarbasedir" value="${classesdir.main}" />
- <param name="jarexcludes" value="**/demo/**,**/demos/**,**/test/**,log4j.xml" />
- </antcall>
- <!--Creates a JAR containing all compiled files -->
- <!--<antcall target="-jar.sub">
- <param name="jarfile" value="${libdir}/${jar.name.all}.jar" />
- <param name="jarbasedir" value="${classesdir.main}" />
- <param name="jarexcludes" value="log4j.xml" />
- </antcall>-->
- </target>
-
-<!-- ==================== Dist Target ===================================== -->
-
- <target name="-distvalidcheck" depends="test" unless="skip.distvalidcheck" >
- <!-- Add any failure checks which should abort the build if true here.
- Don't forget to add a depends target here and generate a failure
- property to test for in any added <fail> task. To skip failure
- checks, supply skip.distvalidcheck=true in build.properties -->
- <fail if="junit.tests.failed">
- Distribution creation aborted because the JUnit tests failed.
- </fail>
- </target>
- <target name="dist" depends="-distvalidcheck, jar, javadoc, -download.dist"
- description="Create binary distribution" >
- <delete>
- <fileset dir="${targetdir}" includes="*.zip, *.tar.gz"/>
- </delete>
- <!-- Klaus added jars to root/lib, so this is redundant -->
- <!--<copy todir="${libdir}" file="${skaringa.jar}"/>
- <copy todir="${libdir}" file="${commons-logging.jar}"/>
- <copy tofile="${libdir}/Skaringa.license.txt" file="${skaringa.license}"/>
- <copy tofile="${libdir}/commons-logging.license.txt" file="${commons-logging.license}"/>-->
- <!--<copy todir="${libdir}" file="${log4j.jar}"/>
- <copy todir="${libdir}" file="${xml-apis.jar}"/>
- <copy todir="${libdir}" file="${xalan.jar}"/>-->
- <!-- Generate ZIP distribution -->
- <zip destfile="${targetdir}/${dist.name}.zip">
- <zipfileset dir="${rootdir}" prefix="${dist.name}"/>
- <zipfileset dir="${libdir}" prefix="${dist.name}" includes="${app.name}*.jar"/>
- <zipfileset dir="${libdir}" prefix="${dist.name}/lib" excludes="${app.name}*.jar"/>
- <zipfileset dir="${docdir}" prefix="${dist.name}/docs"/>
- <zipfileset dir="${srcdir.main}" prefix="${dist.name}/src"/>
- </zip>
- <!-- Generate GZIP distribution -->
- <tar destfile="${targetdir}/${dist.name}.tar" longfile="gnu">
- <tarfileset dir="${rootdir}" prefix="${dist.name}"/>
- <tarfileset dir="${libdir}" prefix="${dist.name}" includes="${app.name}*.jar"/>
- <tarfileset dir="${libdir}" prefix="${dist.name}/lib" excludes="${app.name}*.jar"/>
- <tarfileset dir="${docdir}" prefix="${dist.name}/docs"/>
- <tarfileset dir="${srcdir.main}" prefix="${dist.name}/src"/>
- </tar>
- <gzip src="${targetdir}/${dist.name}.tar" zipfile="${targetdir}/${dist.name}.tar.gz"/>
- <delete file="${targetdir}/${dist.name}.tar" />
- </target>
-
- <target name="damagecontrol">
- <property name="distdir" value="/home/projects/prevayler/dist" />
- <property name="scp" value="scp"/>
- <property name="damagecontrol.username" value="dcontrol"/>
- <macrodef name="macroscp">
- <attribute name="file"/>
- <attribute name="todir"/>
- <sequential>
- <exec dir="." executable="${scp}" failonerror="true">
- <arg path="@{file}"/>
- <arg value="${damagecontrol.username}@dist.codehaus.org:/home/projects/prevayler/dist/@{todir}"/>
- </exec>
- </sequential>
- </macrodef>
-
- <ant target="clean"/>
-
- <ant target="dist" inheritAll="false">
- <property name="app.version" value="SNAPSHOT"/>
- </ant>
- <!--<macroscp file="${libdir}/${app.name}-SNAPSHOT.jar" todir="jars"/>
- <macroscp file="${targetdir}/${app.name}-SNAPSHOT.*" todir="distributions"/>-->
- <copy file="${libdir}/${app.name}-SNAPSHOT.jar" todir="${distdir}/jars"/>
- <copy file="${targetdir}/${app.name}-SNAPSHOT.*" todir="${distdir}/distributions"/>
-
- <tstamp/>
- <ant target="dist" inheritAll="false">
- <property name="app.version" value="${DSTAMP}"/>
- </ant>
- <!--<macroscp file="${libdir}/${app.name}-${DSTAMP}.jar" todir="jars"/>
- <macroscp file="${targetdir}/${app.name}-${DSTAMP}.*" todir="distributions"/>-->
- <copy file="${libdir}/${app.name}-${DSTAMP}.jar" todir="${distdir}/jars"/>
- <copy file="${targetdir}/${app.name}-${DSTAMP}.*" todir="${distdir}/distributions"/>
- </target>
-
-<!-- ==================== Test Targets ================================== -->
-
- <target name="test" depends="compile.test"
- description="Runs JUnit tests" >
- <mkdir dir="${cachedir.test}" />
- <delete dir="${testreportdir}" />
- <mkdir dir="${testreportdir}" />
- <junit dir="${cachedir.test}" printsummary="yes" haltonfailure="no" failureproperty="junit.tests.failed" fork="yes" >
- <classpath refid="build.run.classpath" />
- <sysproperty
- key="${log4j.system.variable.name}"
- value="${log4j.log.path}" />
- <!--<sysproperty
- key="log4j.configuration"
- value="file:./log4j.xml" />-->
- <formatter
- type="plain"
- usefile="yes" />
- <formatter
- type="xml"
- usefile="yes" />
- <test todir="${testreportdir}" name="${testcase}" if="testcase" />
- <batchtest todir="${testreportdir}" unless="testcase" >
- <fileset refid="unit.test.files" />
- <fileset refid="unit.test.files.contrib" />
- </batchtest>
- </junit>
- <antcall target="-test.report.html" />
- </target>
- <target name="-test.report.html" >
- <!--description="Convert the junit xml files to html" -->
- <junitreport todir="${testreportdir}" >
- <fileset dir="${testreportdir}" >
- <include name="TEST-*.xml" />
- </fileset>
- <report
- format="frames"
- todir="${testreportdir}/html" />
- </junitreport>
- </target>
-
-<!-- ==================== Dependency Targets ================================== -->
-
- <target name="download" depends="-download.dist, download.dependencies.utilities, download.dependencies.vizant"
- description="Download all specified binary packages" />
- <target name="-download.dist" depends="download.dependencies.core, download.dependencies.test, download.dependencies.contrib, download.dependencies.runtime" />
- <target name="download.dependencies.core"
- description="Download binary packages needed by the core packages" >
- <!-- Download any sub package or tools needed. -->
- <antcall target="-downloadgz">
- <param name="sourcefile" value="${log4j.loc}"/>
- <param name="destfile" value="${log4j.jar}"/>
- </antcall>
- <antcall target="-downloadgz">
- <param name="sourcefile" value="${skaringa.loc}"/>
- <param name="destfile" value="${skaringa.jar}"/>
- </antcall>
- <antcall target="-downloadfile">
- <param name="sourcefile" value="${xstream.loc}"/>
- <param name="destfile" value="${xstream.jar}"/>
- </antcall>
- <antcall target="-downloadfile">
- <param name="sourcefile" value="${xpp3.loc}"/>
- <param name="destfile" value="${xpp3.jar}"/>
- </antcall>
- <antcall target="-downloadfile">
- <param name="sourcefile" value="${javamatch.loc}"/>
- <param name="destfile" value="${javamatch.jar}"/>
- </antcall>
- </target>
- <target name="download.dependencies.test"
- description="Download binary packages needed by the test packages" >
- <!-- Download any sub package or tools needed. -->
- </target>
- <target name="download.dependencies.contrib"
- description="Download binary packages needed by the contrib packages" >
- <!-- Download any sub package or tools needed. -->
- <antcall target="-downloadfile">
- <param name="sourcefile" value="${jaxen.loc}"/>
- <param name="destfile" value="${jaxen.jar}"/>
- </antcall>
- <antcall target="-downloadfile">
- <param name="sourcefile" value="${ognl.loc}"/>
- <param name="destfile" value="${ognl.jar}"/>
- </antcall>
- <antcall target="-downloadgz">
- <param name="sourcefile" value="${commons-jxpath.loc}"/>
- <param name="destfile" value="${commons-jxpath.jar}"/>
- </antcall>
- <antcall target="-downloadzip">
- <param name="sourcefile" value="${jgroups.loc}"/>
- <param name="destfile" value="${jgroups.jar}"/>
- </antcall>
- </target>
- <target name="download.dependencies.runtime"
- description="Download binary packages needed only at runtime" >
- <!-- Download any sub package or tools needed. -->
- <antcall target="-downloadgz">
- <param name="sourcefile" value="${commons-logging.loc}"/>
- <param name="destfile" value="${commons-logging.jar}"/>
- </antcall>
- <antcall target="-downloadgz">
- <param name="sourcefile" value="${xml-apis.loc}"/>
- <param name="destfile" value="${xml-apis.jar}"/>
- </antcall>
- <antcall target="-downloadgz">
- <param name="sourcefile" value="${xalan.loc}"/>
- <param name="destfile" value="${xalan.jar}"/>
- </antcall>
- </target>
-
-<!-- ==================== XML Entity Included Targets ==================== -->
-
- <!-- general utility targets which provide most of this build's functionality -->
- &general-utility-targets;
- <!-- an empty include file for adding one's own custom targets without requiring editing of build.xml -->
- &self-customized-targets;
-
-
-<!-- ==================== Demo Targets ================================== -->
-
- <target name="-demo.init" depends="download.dependencies.runtime">
- <mkdir dir="${cachedir.demo}" />
- </target>
-
-<!--
- <target name="run.demo.prime" depends="compile.core, -demo.init"
- description="Runs simple prime number demonstration" >
-
- <java dir="${cachedir.demo}" fork="false" classname="org.prevayler.demos.demo1.Main" >
- <classpath refid="build.run.classpath" />
- <sysproperty key="${log4j.system.variable.name}" value="${log4j.log.path}" />
- </java>
-
- </target>
--->
-
- <target name="run.demo.bank" depends="compile.core, -demo.init"
- description="Runs simple bank demonstration" >
- <java dir="${cachedir.demo}" fork="true" classname="org.prevayler.demos.demo2.Main" >
- <classpath refid="build.run.classpath" />
- <sysproperty key="${log4j.system.variable.name}" value="${log4j.log.path}" />
- </java>
- </target>
-
- <target name="run.demo.bank.skaringa" depends="compile.core, -demo.init"
- description="Same as simple bank demo, but uses Skaringa xml serialization" >
- <java dir="${cachedir.demo}" fork="true" classname="org.prevayler.demos.demo2.MainSkaringa" >
- <classpath refid="build.run.classpath" />
- <sysproperty key="${log4j.system.variable.name}" value="${log4j.log.path}" />
- </java>
- </target>
-
- <target name="run.demo.bank.xstream" depends="compile.core, -demo.init"
- description="Same as simple bank demo, but uses XStream xml serialization" >
- <java dir="${cachedir.demo}" fork="true" classname="org.prevayler.demos.demo2.MainXStream" >
- <classpath refid="build.run.classpath" />
- <sysproperty key="${log4j.system.variable.name}" value="${log4j.log.path}" />
- </java>
- </target>
-
- <target name="run.demo.bank.transient" depends="compile.core, -demo.init"
- description="Runs transient bank demonstration" >
- <java dir="${cachedir.demo}" fork="true" classname="org.prevayler.demos.demo2.MainTransient" >
- <classpath refid="build.run.classpath" />
- <sysproperty key="${log4j.system.variable.name}" value="${log4j.log.path}" />
- </java>
- </target>
-
-<!--
- <target name="run.demo.bank.rollback" depends="compile.core, -demo.init"
- description="Runs rollback bank demonstration" >
- <java dir="${cachedir.demo}" fork="true" classname="org.prevayler.demos.demo2.MainRollback" >
- <classpath refid="build.run.classpath" />
- <sysproperty key="${log4j.system.variable.name}" value="${log4j.log.path}" />
- </java>
- </target>
--->
-
- <target name="run.demo.bank.replica" depends="compile.core, -demo.init"
- description="Runs replica bank demonstration" >
- <parallel>
- <java dir="${cachedir.demo}" fork="true" classname="org.prevayler.demos.demo2.MainReplicaServer" >
- <classpath refid="build.run.classpath" />
- <sysproperty key="${log4j.system.variable.name}" value="${log4j.log.path}" />
- </java>
- <sequential>
- <sleep seconds="5"/>
- <java dir="${cachedir.demo}" fork="true" classname="org.prevayler.demos.demo2.MainReplica" >
- <arg value="localhost" />
- <classpath refid="build.run.classpath" />
- <sysproperty key="${log4j.system.variable.name}" value="${log4j.log.path}" />
- </java>
- </sequential>
- </parallel>
- </target>
-
- <target name="run.demo.scalability" depends="compile.core, -demo.init"
- description="Runs manipulation and query scalability demos against Prevayler and any JDBC database" >
- <java dir="${cachedir.demo}" fork="true" classname="org.prevayler.demos.scalability.Main" >
- <jvmarg line="${scalability.jvmarg}" />
- <classpath refid="build.run.classpath" />
- <sysproperty key="${log4j.system.variable.name}" value="${log4j.log.path}" />
- </java>
- </target>
-
- <target name="run.demo.bank.memento" depends="compile.contrib, -demo.init"
- description="Runs memento bank demonstration" >
- <java dir="${cachedir.demo}" fork="true" classname="org.prevayler.demos.memento.TestErrorRecoveryWithMementos" >
- <classpath refid="build.run.classpath" />
- <sysproperty key="${log4j.system.variable.name}" value="${log4j.log.path}" />
- </java>
- </target>
-
-
-</project>
View
70 continuous-integration.sh
@@ -1,70 +0,0 @@
-#! /bin/bash
-# This is a *very* simple continuous integration script.
-# It gets the sources from CVS, builds and uploads the site and binaries.
-#
-# In order to configure a machine to run this once a day,
-# run "crontab -e" from a shell and add the following line:
-#
-# 49 1 * * * $HOME/cvs/pico/continuous-integration.sh
-#
-# That will run this script every day at 1:49 AM. (Off peek, likely to be a quiet period).
-#
-# In order to make this work, you should also set the following in your ~/build.properties:
-# (Don't set maven.test.failure.ignore to true on your developer machine).
-#
-# maven.username = <yourlogin_on_deploy_machine>
-# maven.test.failure.ignore = true
-#
-# Finally, to get the full picture, see maven.xml
-#
-
-mailto=jon@tirsen.com
-builddir=.
-
-#JAVA_HOME=/usr/local/j2sdk1.4.1
-#MAVEN_HOME=~bwalding/maven
-#ANT_HOME=$HOME/cvs/ant/dist
-PATH=$HOME/bin:$JAVA_HOME/bin:$MAVEN_HOME/bin:$ANT_HOME/bin:$PATH
-#CVS_RSH=$HOME/ssh1.sh
-#CVSROOT=:ext:$USER@cvs.codehaus.org:/cvsroot/picocontainer
-
-export JAVA_HOME
-export MAVEN_HOME
-export ANT_HOME
-export PATH
-export CVS_RSH
-export CVSROOT
-
-cd $builddir
-
-cvs update -d -P
-# After CVS update, this script isn't +x anymore (?). Simple workaround.
-chmod +x continuous-integration.sh
-
-# Clean old builds and make the target folder. Logs go here too.
-rm -Rf target
-mkdir target
-
-# Compile and test
-maven test:test &> target/cleanbuild.log
-
-# See if the "compiling" file is there. If it is, compilation
-# failed.
-if [ -e "target/compiling" ] ; then
- # Mail Maven's output to the dev list.
- cat target/cleanbuild.log | mutt -s "[BUILD] Clean build failed" $mailto
-else
- # See if the "testfailure" file is there. If it is, tests failed.
- if [ -e "target/testfailure" ] ; then
- # Mail Maven's output to the dev list.
- cat target/cleanbuild.log | mutt -s "[BUILD] Test failure - see http://www.picocontainer.org/junit-report.html" $mailto
- else
- # Deploy site only if compile and tests pass. Logs currently not used.
- # Must be run separately to get the files uploaded in the proper dir
- # on the server.
- maven jar:deploy &> target/jardeploy.log
- maven dist:deploy &> target/distdeploy.log
- fi
- # We'll deploy the site even if the tests fail. Log currently not used.
- maven site:deploy &> target/sitedeploy.log
-fi
View
1  contrib/Readme.txt
@@ -1 +0,0 @@
-Bits and pieces of code and documentation people have submitted that might eventually be used in a future version of Prevayler.
View
196 contrib/batchedwrites/README
@@ -1,196 +0,0 @@
-From: Weisberg, Robin [robin.weisberg@lehman.com]
-Sent: Monday, May 12, 2003 10:05 PM
-To: 'prevayler-discussion@lists.sourceforge.net'
-Subject: RE: [Prevayler-discussion] TODO for 2.0 and beyond
-
-Here is the code for batching writes. As I mentioned earlier, I threw it together as a proof of concept. We are using currently while perf testing our app so its been exercised a bit but it hasn't been to production yet...
-
-Quick Notes
------------
-1) All changes were in the org.prevayler.implementation package
-2) Added class BatchedCommandOutputStream. This is a replacement for CommandOutputStream.
-3) Added ExecuteCommandThread.
-4) Added some -D options in BatchedCommandOutputStream which I found useful while perf tuning. They are:
- a) PrevaylerMaxWriteBatchSize - This will ensure that no more than this number of commands are written to disk in once "commit". In theory, useful to control latency. Defaults to 1000.
- b) PrevaylerLogFileSize - what size to roll the log file at. Defaults to 5MB.
- c) PrevaylerGzipOutput - whether to Gzip the output stream for smaller logs files and writes. Useful if you got CPU to burn. Defaults to true.
- d) PrevaylerAsyncExecute - whether to execute commands on a dedicated ExecuteCommandThread. Explained further below. Defaults to true.
-5) Changed the way clock interacts w/ system.
-6) Implementation is a little messy, too many objects are interacting w/ other objects (high coupling). This was because I was trying to avoid refactoring the current layout...
-
-Overview
---------
-
-Put your threading helmets on, never have you seen the synchronized keyword so heavily abused! ;-)
-
-When a command is executed the BatchedCommandOutputStream's
-writeAndExecuteCommand(Command) method is called. It wraps the command in a ClockRecoveryCommand and puts it on the writeCommandToDiskQueue which is serviced by the BatchedCommandOutputStream's internal thread. Using wait & notify the write thread is notified and begins to write whatever is on the queue to disk. The application thread (calling thread) then executes a
-wait() on the command it wants results for.
-
-When the disk write completes the thread will pass on the commands written to disk to the ExecuteCommandThread. The ExecuteCommandThread (poorly named since its not always a thread) either executes the commands immediately or puts them in its internal queue to be processed by its own thread (depending on -DPrevaylerAsyncExecute's value. Default is to execute on its thread). Using a separate thread for executing helps maximize CPU usage since commands execute while writing is in progress.
-
-The BatchedCommandOutputStream and ExecuteCommandThread share 2 maps. One for return values and one for exceptions. The ExecuteCommandThread puts values in these maps using the command as the key and return value or Exception as a value. The ExecuteCommandThread then calls notify on the command object it just executed letting the application thread know that the disk write is complete and there is a return result or exception in one of the 2 maps.
-
-Hope this makes sense! Its late and I'm tired so who knows...
-
-Regards,
-Robin
-
-
------Original Message-----
-From: Klaus Wuestefeld [mailto:klauswuestefeld@yahoo.com]
-Sent: Monday, May 12, 2003 4:14 PM
-To: prevayler-discussion@lists.sourceforge.net
-Subject: RE: [Prevayler-discussion] TODO for 2.0 and beyond
-
-
-> I'd think its pretty important for 2.0 simply for PR
-> reasons. Now you can
-> update the website to show that prevayler is X times
-> faster than all the
-> other DB's out there for manipulations (writes).
-
-I think it actually gives us credibility to say that
-we are a bit slower than MySQL in at least one
-criterium.
-
-Technically, though, it is better for Prevayler to be
-faster, of course.
-
-I'll wait for the code.
-
-See you, Klaus.
-
-
-
---- "Weisberg, Robin" <robin.weisberg@lehman.com>
-wrote:
-> The write bottleneck changes I proposed do not
-> change the API or the
-> expected behavior of Prevayler. They just make
-> things faster.
->
-> I'd think its pretty important for 2.0 simply for PR
-> reasons. Now you can
-> update the website to show that prevayler is X times
-> faster than all the
-> other DB's out there for manipulations (writes).
-> Currently prevayler is in
-> the middle somewhere.
->
-> I'll try to post the code I have tonite(EST). Its
-> based off of the 1.02.001
-> production release. I'm not going to be able to make
-> the changes for 2.0
-> though (sorry).
->
-> Robin
->
-> -----Original Message-----
-> From: Dave Orme [mailto:DaveO@ASC-iSeries.com]
-> Sent: Monday, May 12, 2003 12:57 PM
-> To: prevayler-discussion@lists.sourceforge.net
-> Subject: [Prevayler-discussion] TODO for 2.0 and
-> beyond
->
->
->
-> I wasn't able to find a TODO file for 2.0. Should I
-> commit one to the
-> repository?
->
-> Off the top of my head, the things that are still
-> needed are:
->
-> - Finish failover support with multiple Prevaylers /
-> multiple JVMs
->
-> - Resolve the ClockedTransaction / ClockedActor
-> issue
->
-> - Add a (possibly optional) Transaction queue in
-> front of Prevayler that
-> lets us batch Transaction log writes along the lines
-> of the discussion at
->
-http://www.prevayler.org/wiki.jsp?topic=OvercomingTheWriteBottleneck
->
-<http://www.prevayler.org/wiki.jsp?topic=OvercomingTheWriteBottleneck>
-> .
-> Maybe this should go in 3.0 but I put it in 2.0
-> since it might break APIs
-> again.
->
-> Robin, if you're still around, can you comment on
-> this?
->
->
-> Anything else?
->
->
->
-> What do people want to see in 3.0? I put a TODO
-> file in my SocketServer's
-> root folder in Contrib; perhaps some of the items I
-> put there should be
-> migrated into a 3.0 plan for Prevayler?
->
-> Something I'd like to see us try to tackle for 3.0
-> is to experiment with and
-> implement one or more of the solutions described at:
->
-http://www.prevayler.org/wiki.jsp?topic=SchemaEvolution
->
-<http://www.prevayler.org/wiki.jsp?topic=SchemaEvolution>
->
->
->
->
-> What does everyone else think?
->
->
->
-> Regards,
->
-> Dave Orme
->
->
->
-----------------------------------------------------------------------------
---
-> This message is intended only for the personal and confidential use of
-> the designated recipient(s) named above. If you are not the intended
-> recipient of this message you are hereby notified that any
-> review, dissemination, distribution or copying of
-> this message is strictly prohibited. This
-> communication is for information purposes only and
-> should not be regarded as an offer to sell or as a
-> solicitation of an offer to buy any financial
-> product, an official confirmation of any
-> transaction, or as an official statement of Lehman
-> Brothers. Email transmission cannot be guaranteed
-> to be secure or error-free. Therefore, we do not
-> represent that this information is complete or
-> accurate and it should not be relied upon as such.
-> All information is subject to change without notice.
->
->
-
-
-__________________________________
-Do you Yahoo!?
-The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com
-
-
--------------------------------------------------------
-Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara The only event dedicated to issues related to Linux enterprise solutions www.enterpriselinuxforum.com
-
-_______________________________________________
-To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
-_______________________________________________
-"Do you still use a database?" -- http://www.prevayler.org
-
-
-------------------------------------------------------------------------------
-This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice.
-
View
BIN  contrib/batchedwrites/batched_prevayler.zip
Binary file not shown
View
68 contrib/log/ParallelLogger.java
@@ -1,68 +0,0 @@
-
- synchronized void advanceClockTo(Date newTime) { //Synchronized so that a snapshot cannot occur during this method and block the transaction queue.
- _realTime = newTime;
- synchronized (_queueMonitor) {
- if (_lastExecuterInQueue != null) return; // The transactions in the queue will advance the clock at their own pace.
- super.advanceClockTo(newTime);
- }
- }
-
- private class TransactionExecuter {
-
- private final Transaction _transaction;
- private final TransactionLogger _transactionLogger;
- private TransactionExecuter _previousExecuter;
- private Date _time;
- private long _sequence;
-
- TransactionExecuter(Transaction transaction) throws IOException {
- _transaction = transaction;
- _transactionLogger = _transactionLogManager.availableTransactionLogger();
- }
-
- synchronized Object execute() throws Exception {
- _transactionLogger.write(_transaction);
- queueUp();
- _transactionLogger.stamp(_time.getTime(), _sequence);
-
- synchronized (executerToWaitFor()) {
- _transactionLogger.sync(); // sync() is done as the last thing before execute(Transaction) for greater performance scalability. This allows other transactions to be written to the same file and be sync'd with a single sync() call.
- if (_sequence != _systemVersion + 1) throw new RuntimeException("Unexpected state. Transaction sequence is " + _sequence + " but should be " + (_systemVersion + 1)); // After J2SE 1.4 this would be an assert.
-
- AcidPrevayler.super.advanceClockTo(_time);
- try {
- return AcidPrevayler.super.execute(_transaction);
- } finally {
- endMyTurn();
- }
- }
- }
-
- private void queueUp() {
- synchronized (_queueMonitor) {
- _previousExecuter = _lastExecuterInQueue;
- _lastExecuterInQueue = this;
-
- _time = _realTime;
- _sequence = _previousExecuter == null
- ? _systemVersion + 1
- : _previousExecuter._sequence + 1;
- }
- }
-
- private Object executerToWaitFor() {
- return _previousExecuter == null
- ? this // This means I don't have to wait.
- : _previousExecuter;
- }
-
- private void endMyTurn() {
- synchronized (_queueMonitor) {
- if (_lastExecuterInQueue == this) _lastExecuterInQueue = null; // The clock can now advance freely.
- }
- _previousExecuter = null; // Free for Garbage Collection.
- }
-
- }
-
-}
View
130 contrib/log/SimpleTransactionLogger.java
@@ -1,130 +0,0 @@
-// Prevayler(TM) - The Open-Source Prevalence Layer.
-// Copyright (C) 2001-2003 Klaus Wuestefeld.
-// This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library 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 library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-
-package org.prevayler.implementation;
-
-import org.prevayler.*;
-import org.prevayler.foundation.StopWatch;
-import java.io.*;
-
-
-/**
- * Serializes transactions to transactionLog files, along with their execution time and execution sequence number.
- * @see SnapshotPrevayler on the use of the org.prevayler.SafeTransactionLogs, org.prevayler.TransactionLogsThresholdBytes and org.prevayler.TransactionLogsThresholdMinutes system properties.
- * @see TransactionLogRecoverer
- */
-class SimpleTransactionLogger {
-
- private final boolean _safeTransactionLogs = safeTransactionLogsSystemProperty();
- private final long _transactionLogsThresholdBytes = parseSystemProperty("org.prevayler.TransactionLogsThresholdBytes");
- private final long _transactionLogsThresholdMillis = 1000 * 60 * parseSystemProperty("org.prevayler.TransactionLogsThresholdMinutes");
-
- private final File _logFile;
- private final FileOutputStream _fileOutputStream;
- private final ObjectOutputStream _objectOutputStream;
-
- private long _executionTime;
- private long _executionSequence;
-
- private final StopWatch stopWatch = StopWatch.start();
-
-
- SimpleTransactionLogger(File logFile, boolean sequenceRestarted) throws IOException {
- _logFile = logFile;
- _fileOutputStream = new FileOutputStream(logFile);
- _objectOutputStream = new ObjectOutputStream(fileOutputStream);
-
- _objectOutputStream.writeObject(new Character(sequenceRestarted ? 'R' : 'C')); //R - Restart. C - Continue.
- flushStreams(true);
- }
-
-
- void write(Transaction transaction) throws IOException {
- _objectOutputStream.writeObject(transaction);
- }
-
-
- void stamp(long executionTime, long sequence) {
- _executionTime = executionTime.getTime();
- _executionSequence = executionSequence;
- }
-
-
- void sync() throws IOException {
- _objectOutputStream.writeLong(executionTime);
- _objectOutputStream.writeLong(executionSequence);
-
- _flushStreams(safeTransactionLogs);
- }
-
-
- private void flushStreams(boolean sync) throws IOException {
- _objectOutputStream.flush();
- if (sync) _fileOutputStream.getFD().sync();
- }
-
-
- boolean isValid() {
- return !isExpired() && !isFull();
- }
-
- private boolean isExpired() {
- if (_transactionLogsThresholdMillis == 0) return false;
- return stopWatch.millisEllapsed() >= _transactionLogsThresholdMillis;
- }
-
- private boolean isFull() {
- if (_transactionLogsThresholdBytes == 0) return false;
- return _logFile.length() >= _transactionLogsThresholdBytes;
- }
-
-
- void close() throws IOException {
- _objectOutputStream.close();
- }
-
-
- File directory() {
- return _logFile.getParentFile();
- }
-
-
- static private long parseSystemProperty(String propertyName) {
- String property = System.getProperty(propertyName);
- if (property == null) return 0;
- try {
- return Long.parseLong(property);
- } catch (NumberFormatException nfx) {
- return 0;
- }
- }
-
- static private boolean safeTransactionLogsSystemProperty() {
- boolean safe = !"off".equalsIgnoreCase(System.getProperty("org.prevayler.SafeTransactionLogs"));
- safeTransactionLogsMessage(safe);
- return safe;
- }
-
- static private void safeTransactionLogsMessage(boolean safe) {
- if (!safe && _lastTimeWasSafe) {
- out("\n=====================================");
- out("The org.prevayler.SafeTransactionLogs system property is OFF.");
- out("Writes to the transactionLog files will be cached for greater performance. In the event of a system crash, some of the last executed transactions might be lost.");
- out("=====================================\n");
- }
- if (safe && !_lastTimeWasSafe) {
- out("\n=====================================");
- out("The org.prevayler.SafeTransactionLogs system property is ON.");
- out("Writes to the transactionLog files will be flushed to the underlying device before each transaction is executed.");
- out("=====================================\n");
- }
- _lastTimeWasSafe = safe;
- }
- static private boolean _lastTimeWasSafe = true;
-
-
- static private void out(Object message) {
- System.out.println(message);
- }
-}
View
154 contrib/log/TransactionFilesReader.java
@@ -1,154 +0,0 @@
-// Prevayler(TM) - The Open-Source Prevalence Layer.
-// Copyright (C) 2001-2003 Klaus Wuestefeld.
-// This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library 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 library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-
-package org.prevayler.implementation;
-
-import org.prevayler.Transaction;
-import org.prevayler.foundation.FileManager;
-import java.io.*;
-import java.util.*;
-
-
-class TransactionFilesReader {
-
- private final File _transactionFile;
- private final long _firstPossibleTransaction; //This is the number in the name of the .journal file.
- private final LoggedTransactionRecoverer _recoverer;
-
- private final TransactionFilesReader _previousFileReader;
-
- private ObjectInputStream _transactions = null;
- private boolean _EOF = false;
-
-
- static void recover(File directory, LoggedTransactionRecoverer recoverer) {
- List logFiles = logFilesSortedNewestFirst(directory); // Newer log sessions have precedence over older ones.
- if (logFiles.isEmpty()) return;
- TransacionFilesReader reader = new TransacionFilesReader(logFiles, recoverer);
- while (reader.recover(recoverer.nextTransaction()));
- renameRemainingFiles(recoverer.nextTransaction());
- }
-
-
- private TransacionFilesReader(List logFiles, LoggedTransactionRecoverer recoverer) {
- _recoverer = recoverer;
- _transactionFile = logFiles.remove(0);
- _firstPossibleTransaction = number(_transactionFile);
- _previousFileReader = logFiles.isEmpty()
- ? null
- : new TransactionFilesReader(logFiles, recoverer);
- }
-
-
- private boolean recover(long nextTransaction) {
- if (recoverFromMyOwnFile(nextTransaction)) return true;
-
- if (_previousFileReader == null) return false;
- return _previousFileReader.recover(nextTransaction);
- }
-
-
- private boolean recoverFromMyOwnFile(long nextTransaction) {
- if (nextTransaction < _firstPossibleTransaction) return false;
-
- initializeFileReading();
-
- if (_EOF) return false;
- boolean result = _nextStamp.recover(nextTransaction, _recoverer));
- if (result) advanceStamp();
- return result;
- }
-
-
- private void initializeFileReading() {
- if (_transactions != null) return; // Was already initialized.
-
- out("Reading " + _transactionFile + "...");
- _transactions = new ObjectInputStream(new FileInputStream(_transactionFile));
-
- try {
- //if (_transactions.readObject().equals("SessionStarting")) {
- // out(" (first log file in its session)");
- if (previous != null && this.session != previous.session)
- _previousFileReader = null; //Since transaction logging is done in parallel, when the system crashes during the execution of a transaction, a few "future" transactions might already have been written. A session cannot execute such "future" transactions from previous sessions.
- }
- } catch (SerializationExceptions e) { (Ver readNextStep() abaixo) IOExceptions de verdade tem que ser jogadas. Criar AtomicObjectInputStream que só joga EOF (também no lugar das exceptions de serialização) e IOException.
- _EOF = true;
- return;
- }
-
- advanceStamp();
- }
-
-
- private void advanceStamp() throws IOException, ClassNotFoundException {
- try {
- PULAR TRANSACAO: Transaction nextTransaction = (Transaction)_transactions.readObject();
- _nextStamp = (TransactionStamp)logStream.readObject();
- STAMP PODE JA TER TRANSACAO. NAO PRECISA DISSO: _nextStamp.setTransaction(nextTransaction);
- return;
- } catch (EOFException eofx) {
- // Do nothing.
- } catch (StreamCorruptedException scx) {
- message(scx);
- } catch (UTFDataFormatException utfx) {
- message(utfx);
- } catch (RuntimeException rx) { //Some stream corruptions cause runtime exceptions in JDK1.3.1!
- message(rx);
- } RESOLVER OS OUTROS: InvalidClassException, OptionalDataException
-
- _EOF = true;
- }
-
-
- static private logFilesSortedNewestFirst(File directory) throws IOException {
- File[] files = directory.listFiles();
- if (files == null) throw new IOException("Error reading file list from directory " + directory);
-
- List result = new ArrayList();
- for (int i = 0; i < files.length; i++) {
- try {
- number(files[i]); // Can throw a NotATransactionLogFile exception.
- result.add(files[i]);
- catch (NotATransactionLogFile ignored) {
- // Do nothing. The file will not be added to the list.
- }
- Collections.sort(result);
- Collections.reverse(result);
- return result;
- }
-
-
- /** 0000000000000000000-000.journal is the format of the transaction log filename. The first long number (19 digits) is the number of the next transaction to be written at the moment the file is created. All transactions written to a file, therefore, have a sequence number greater or equal to the number in its filename. The second number (3 digits) is used just to distinguish between several files created at the same time by threads running in parallel. */
- static private long number(File file) {
- String name = file.getName();
- if (!name.endsWith(".journal")) throw new NotATransactionLogFile();
- if (name.length != 38) throw new NotATransactionLogFile();
- if (!name.getChar(19).equals('-')) throw new NotATransactionLogFile();
- try {
- Integer.parseInt(name.substring(20, 3));
- return Long.parseLong(name.substring(0, 19));
- } catch (RuntimeException ignored) {
- throw new NotATransactionLogFile();
- }
- }
-
-
- static private void message(Exception exception) {
- out( "\n" + exception + " (File: " + logFile + ")" +
- "\n The above is a stream corruption that can be caused by:" +
- "\n - A system crash while writing to the journal file (that is OK)." +
- "\n - A corruption in the file system (that is NOT OK)." +
- "\n - Tampering with the journal file (that is NOT OK)." +
- "\n Looking for the next transaction...\n" );
- }
-
-
- static private void out(String message) {
- System.out.println(message);
- }
-
-}
-
-class NotATransactionLogFile extends RuntimeException {}
View
121 contrib/log/TransactionLogManager.java
@@ -1,121 +0,0 @@
-// Prevayler(TM) - The Open-Source Prevalence Layer.
-// Copyright (C) 2001 Klaus Wuestefeld.
-// This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library 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 library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-
-package org.prevayler.implementation;
-
-import org.prevayler.Transaction;
-import org.prevayler.foundation.FileManager;
-import java.io.*;
-import java.util.*;
-
-/** Logs and recovers transactions to/from files.
-*/
-public class TransactionLogManager {
-
- private final File _journalDirectory;
- private final int _transactionLogs;
-
- private final List _availableLoggers = new LinkedList();
- private boolean _loggersCreated = false;
-
- /**
- * Creates a TransactionlogManager that will write to 5 transactionLogFiles
- * in parallel in the prevalanceBase directory.
- * @param transactionLogDirectoryName The path of the directory where the
- * pending log files will be read and where the new log files will be
- * created.
- */
- public TransactionLogManager() throws IOException {
- this("PrevalenceBase");
- }
-
- /**
- * Creates a TransactionlogManager that will write to 5 transactionLogFiles
- * in parallel.
- * @param transactionLogDirectoryName The path of the directory where the pending log files will be read and where the new log files will be created.
- */
- public TransactionLogManager(String transactionLogDirectoryName) throws IOException {
- this(transactionLogDirectoryName, 5);
- }
-
- /** @param transactionLogDirectoryName The path of the directory where the pending log files will be read and where the new log files will be created.
- * @param transactionLogs The number of simultaneous transactionLog files
- * that will be created for parallel transaction logging.
- */
- public TransactionLogManager(String transactionLogDirectoryName, int transactionLogs) throws IOException {
- _transactionLogDirectory = FileManager.produceDirectory(transactionLogDirectoryName);
- _transactionLogs = transactionLogs;
- }
-
- Transaction recover(long l) {
- return null;
- }
-
-
-
- TransactionLogger availableTransactionLogger() throws IOException {
- synchronized (_availableLoggers) {
- while (_availableLoggers.isEmpty()) {
- if (_loggersCreated) {
- waitForAvailableLogger();
- } else {
- createLoggers();
- }
- }
-
- return (TransactionLogger)_availableLoggers.remove(0);
- }
- }
-
- private void waitForAvailableLogger() {
- try {
- _availableLoggers.wait();
- } catch (InterruptedException ix) {
- throw new RuntimeException("Unexpected InterruptedException.");
- }
- }
-
- private void createLoggers() throws IOException {
- createLogger(_transactionLogDirectory, true);
- for (int i = 2; i <= _transactionLogs; i++) {
- createLogger(_transactionLogDirectory, false);
- }
-
- _loggersCreated = true;
- }
-
- private void createLogger(File directory, boolean sequenceRestarted) throws IOException {
- File logFile = new File(directory, logFileName(444));
- if(!logFile.createNewFile()) throw new IOException("Attempt to create transaction log file that already existed: " + logFile);;
-
-
- _availableLoggers.add(new TransactionLogger(logFile, sequenceRestarted));
- }
-
-
- static String logFileName(long fileNumber) {
- String fileName = "000000000000000000000" + fileNumber;
- return fileName.substring(fileName.length() - 21) + ".transactionLog";
- }
-
-
- void flushToDisk(TransactionLogger transactionLogger) throws IOException {
- transactionLogger.flushToDisk();
- makeLoggerAvailable(transactionLogger);
- }
-
- private void makeLoggerAvailable(TransactionLogger transactionLogger) throws IOException {
- synchronized (_availableLoggers) {
- if (transactionLogger.isValid()) {
- _availableLoggers.add(transactionLogger);
- } else {
- transactionLogger.close();
- createLogger(transactionLogger.directory(),false);
- }
-
- _availableLoggers.notify();
- }
- }
-
-}
View
11 contrib/rollbackWithMementoPattern/project.xml
@@ -1,11 +0,0 @@
-<?xml version="1.0"?>
-<project>
- <pomVersion>3</pomVersion>
- <name>Prevayler Rollback with Memento</name>
- <id>prevayler-memento</id>
- <currentVersion>2.00.000dev</currentVersion>
-
- <build>
- <sourceDirectory>.</sourceDirectory>
- </build>
-</project>
View
32 contrib/test/ClockMock.java
@@ -1,32 +0,0 @@
-// Prevayler(TM) - The Open-Source Prevalence Layer.
-// Copyright (C) 2001 Klaus Wuestefeld.
-// This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library 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 library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-
-package org.prevayler.test;
-
-import org.prevayler.implementation.SystemClock;
-
-/** A controllable Clock that can be used for running functional tests for business rules involving time.
-*/
-public class ClockMock extends SystemClock {
-
- private long currentTimeMillis;
-
- /** Creates an ClockMock with the internal "current" time set to currentTimeMillis.
- */
- public ClockMock(long currentTimeMillis) {
- this.currentTimeMillis = currentTimeMillis;
- }
-
- /** Sets the internal "current" time of the clock.
- * @throws IllegalArgumentException if newMillis is smaller or equal to the current time. An Clock's time can only progress forwards.
- */
- public synchronized void currentTimeMillis(long newMillis) {
- if (newMillis <= currentTimeMillis) throw new IllegalArgumentException("Clock's time can only be set forwards.");
- currentTimeMillis = newMillis;
- }
-
- public long currentTimeMillis() {
- return currentTimeMillis;
- }
-}
View
115 contrib/test/ClockTest.java
@@ -1,115 +0,0 @@
-// Prevayler(TM) - The Open-Source Prevalence Layer.
-// Copyright (C) 2001 Klaus Wuestefeld.
-// This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library 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 library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-
-package org.prevayler.test;
-
-import java.io.*;
-import java.util.*;
-
-import org.prevayler.*;
-import org.prevayler.implementation.*;
-import org.prevayler.convenience.*;
-
-public class ClockTest {
-
- static private SnapshotPrevayler prevayler;
- static private String prevalenceBase;
-
- static private ClockMock clockMock = new ClockMock(0);
-
- static public void run() throws Exception {
-
- newPrevalenceBase();
-
- crashRecover(); //There is nothing to recover at first. A new system will be created.
- verify(0);
- verify(0);
-
- setTime(1);
- verify(1);
-
- setTime(2);
- verify(2);
- verify(2);
-
- crashRecover();
- verify(2);
-
- setTime(3);
- setTime(4);
- verify(4);
-
- crashRecover();
- crashRecover();
- verify(4);
-
- setTime(10);
- verify(10);
- snapshot();
- verify(10);
-
- setTime(11);
- snapshot();
- crashRecover();
- verify(11);
- setTime(12);
- verify(12);
- }
-
- static private void crashRecover() throws Exception {
- out("CrashRecovery.");
- clockMock = new ClockMock(clockMock.currentTimeMillis()); //A new one is created because a paused clock is needed.
- prevayler = new SnapshotPrevayler(new AbstractPrevalentSystem() {}, prevalenceBase(), clockMock);
- clockMock = (ClockMock)system().clock(); //It might have been recovered from a snapshot.
- }
-
- static private void snapshot() throws IOException {
- out("Snapshot.");
- prevayler.takeSnapshot();
- }
-
-
- static private void setTime(long newTime) throws Exception {
- out("Setting time: " + newTime);
- clockMock.currentTimeMillis(newTime);
- prevayler.executeCommand(new NullCommand());
- }
-
- static private void verify(long expectedTime) {
- out("Expecting time: " + expectedTime);
- compare(system().clock().time().getTime(), expectedTime, "Time");
- }
-
-