Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed the structure to become part of the AxonFramework
Package names have changed to org.axonframework.scynapse Documentation is added to scynapse-core and scynapse test The XStream serializer supports List and Enum by default
- Loading branch information
Showing
36 changed files
with
884 additions
and
1,673 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,73 @@ | ||
Welcome to the Scynapse [![Build Status](https://secure.travis-ci.org/thenewmotion/scynapse.png)](http://travis-ci.org/thenewmotion/scynapse) | ||
================================== | ||
# Welcome to the Scynapse | ||
|
||
Scynapse enables the use of Axon with Scala | ||
|
||
This version (0.2.8) works with Axon version 2.3.2 | ||
|
||
## A quick start in using scynapse (core) | ||
|
||
1) Setup a structure with an event store that makes use of the XStreamSerializer found in scynapse-core | ||
|
||
2) Create your aggregate root as | ||
|
||
class MyAggregateRoot extends AbstractAnnotatedAggregateRoot[MyIdentifier] | ||
|
||
@AggregateIdentifier | ||
private var id : MyIdentifier = _ | ||
|
||
3) Create your Commands and Events | ||
|
||
Note that Commands need an annotation in order to route them to the proper AggregateRoot instance using | ||
the @aggregateId annotation | ||
|
||
case class MyCommand(@aggregateId myId: MyIdentifier, otherParam: String) | ||
|
||
4) Have the Aggregate Root handle the commands that results in events | ||
|
||
@CommandHandler | ||
def handle(cmd: MyCommand) { | ||
apply(MyCommandHappened(id)) | ||
} | ||
|
||
5) Update the state (if required) in the aggregate root | ||
|
||
@EventHandler | ||
def on(e: MyCommandHappened) { | ||
someState = Some(e.otherParam) | ||
} | ||
|
||
6) Have event handlers in views build up specific state. | ||
|
||
|
||
## Make use of akka actors for event listening | ||
|
||
|
||
|
||
## Make use of scalatest to test your domain logic | ||
|
||
It's possible to make use of the Axon given -> when -> then test logic in scalatest and have matchers that work in scala style. | ||
The test in the scynapse-test package shows best in what way this works. | ||
|
||
# Dependencies | ||
|
||
In order to make use of the the scynapse framework, you need to include in your build.sbt | ||
|
||
For Scynapse core: | ||
|
||
libraryDependencies ++= Seq( | ||
"org.axonframework.scynapse" %% "scynapse-core" % 0.2.8 | ||
) | ||
|
||
For Scynapse akka: | ||
|
||
libraryDependencies ++= Seq( | ||
"org.axonframework.scynapse" %% "scynapse-akka" % 0.2.8 | ||
) | ||
|
||
For Scynapse test: | ||
|
||
libraryDependencies ++= Seq( | ||
"org.axonframework.scynapse" %% "scynapse-test" % 0.2.8 % "test" | ||
) | ||
|
||
This project aims to bring more natural experience with Axon Framework (http://www.axonframework.org) in Scala land. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,103 @@ | ||
import sbt._ | ||
import Keys._ | ||
import bintray.Plugin._ | ||
import sbtrelease.ReleasePlugin._ | ||
import scala._ | ||
|
||
object ScynapseBuild extends Build { | ||
import Deps._ | ||
|
||
lazy val basicSettings = seq( | ||
organization := "com.thenewmotion", | ||
description := "Scala add-on to Axon framework", | ||
import Deps._ | ||
|
||
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0")), | ||
lazy val basicSettings = seq( | ||
organization := "org.axonframework.scynapse", | ||
description := "Scala add-on to the Axon framework", | ||
|
||
bintray.Keys.bintrayOrganization := Some("thenewmotion"), | ||
resolvers += bintray.Opts.resolver.mavenRepo("thenewmotion"), | ||
licenses +=("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0")), | ||
|
||
scalaVersion := V.scala, | ||
scalaVersion := V.scala, | ||
|
||
scalacOptions := Seq( | ||
"-encoding", "UTF-8", | ||
"-unchecked", | ||
"-deprecation" | ||
) | ||
scalacOptions := Seq( | ||
"-encoding", "UTF-8", | ||
"-unchecked", | ||
"-deprecation" | ||
) | ||
|
||
) ++ releaseSettings ++ bintraySettings | ||
) ++ releaseSettings | ||
|
||
lazy val moduleSettings = basicSettings ++ seq( | ||
publishMavenStyle := true, | ||
pomExtra := | ||
<licenses> | ||
<license> | ||
<name>Apache License, Version 2.0</name> | ||
<url>http://www.apache.org/licenses/LICENSE-2.0</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
) | ||
lazy val moduleSettings = basicSettings ++ seq( | ||
publishMavenStyle := true, | ||
publishTo := { | ||
val nexus = "https://oss.sonatype.org/" | ||
if (isSnapshot.value) | ||
Some("snapshots" at nexus + "content/repositories/snapshots") | ||
else | ||
Some("releases" at nexus + "service/local/staging/deploy/maven2") | ||
}, | ||
publishArtifact in Test := false, | ||
pomIncludeRepository := { _ => false }, | ||
pomExtra := | ||
<licenses> | ||
<license> | ||
<name>Apache License, Version 2.0</name> | ||
<url>http://www.apache.org/licenses/LICENSE-2.0</url> | ||
</license> | ||
</licenses> | ||
<issueManagement> | ||
<system>YouTrack</system> | ||
<url>http://issues.axonframework.org</url> | ||
</issueManagement> | ||
<scm> | ||
<url>git@github.com:AxonFramework/Scynapse.git</url> | ||
<connection>scm:git:git@github.com:AxonFramework/Scynapse.git</connection> | ||
</scm> | ||
<developer> | ||
<id>olger</id> | ||
<name>Olger Warnier</name> | ||
<email>olger@spectare.nl</email> | ||
</developer> | ||
) | ||
|
||
lazy val root = Project("scynapse-root", file(".")) | ||
.settings(basicSettings: _*) | ||
.aggregate(scynapseCore, scynapseAkka, scynapseTest) | ||
lazy val root = Project("scynapse-root", file(".")) | ||
.settings(basicSettings: _*) | ||
.aggregate(scynapseCore, scynapseAkka, scynapseTest) | ||
|
||
lazy val scynapseCore = Project("scynapse-core", file("scynapse-core")) | ||
.settings(moduleSettings: _*) | ||
.settings( | ||
libraryDependencies ++= Seq( | ||
axonCore, | ||
scalaTest % "test")) | ||
lazy val scynapseCore = Project("scynapse-core", file("scynapse-core")) | ||
.settings(moduleSettings: _*) | ||
.settings( | ||
libraryDependencies ++= Seq( | ||
axonCore, | ||
scalaTest % "test")) | ||
|
||
lazy val scynapseAkka = Project("scynapse-akka", file("scynapse-akka")) | ||
.dependsOn(scynapseCore) | ||
.settings(moduleSettings: _*) | ||
.settings( | ||
libraryDependencies ++= Seq( | ||
akkaActor, | ||
akkaTestkit % "test", | ||
scalaTest % "test")) | ||
lazy val scynapseAkka = Project("scynapse-akka", file("scynapse-akka")) | ||
.dependsOn(scynapseCore) | ||
.settings(moduleSettings: _*) | ||
.settings( | ||
libraryDependencies ++= Seq( | ||
akkaActor, | ||
akkaTestkit % "test", | ||
scalaTest % "test")) | ||
|
||
lazy val scynapseTest = Project("scynapse-test", file("scynapse-test")) | ||
.dependsOn(scynapseCore) | ||
.settings(moduleSettings: _*) | ||
.settings( | ||
libraryDependencies ++= Seq( | ||
axonTest, | ||
hamcrest, | ||
scalaTest | ||
)) | ||
lazy val scynapseTest = Project("scynapse-test", file("scynapse-test")) | ||
.dependsOn(scynapseCore) | ||
.settings(moduleSettings: _*) | ||
.settings( | ||
libraryDependencies ++= Seq( | ||
axonTest, | ||
hamcrest, | ||
scalaTest | ||
)) | ||
} | ||
|
||
object Deps { | ||
object V { | ||
val scala = "2.11.2" | ||
val axon = "2.3.2" | ||
val akka = "2.3.6" | ||
} | ||
|
||
val axonCore = "org.axonframework" % "axon-core" % V.axon | ||
val axonTest = "org.axonframework" % "axon-test" % V.axon | ||
val akkaActor = "com.typesafe.akka" %% "akka-actor" % V.akka | ||
val akkaTestkit = "com.typesafe.akka" %% "akka-testkit" % V.akka | ||
val hamcrest = "org.hamcrest" % "hamcrest-core" % "1.3" | ||
val scalaTest = "org.scalatest" %% "scalatest" % "2.2.2" | ||
object V { | ||
val scala = "2.11.2" | ||
val axon = "2.3.2" | ||
val akka = "2.3.6" | ||
} | ||
|
||
val axonCore = "org.axonframework" % "axon-core" % V.axon | ||
val axonTest = "org.axonframework" % "axon-test" % V.axon | ||
val akkaActor = "com.typesafe.akka" %% "akka-actor" % V.akka | ||
val akkaTestkit = "com.typesafe.akka" %% "akka-testkit" % V.akka | ||
val hamcrest = "org.hamcrest" % "hamcrest-core" % "1.3" | ||
val scalaTest = "org.scalatest" %% "scalatest" % "2.2.2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=0.13.5 | ||
sbt.version=0.13.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1 @@ | ||
resolvers += Resolver.url( | ||
"bintray-sbt-plugin-releases", | ||
url("http://dl.bintray.com/content/sbt/sbt-plugin-releases"))( | ||
Resolver.ivyStylePatterns) | ||
|
||
addSbtPlugin("com.github.gseitz" % "sbt-release" % "0.8.4") | ||
|
||
addSbtPlugin("com.orrsella" % "sbt-sublime" % "1.0.9") | ||
|
||
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.1.2") |
54 changes: 0 additions & 54 deletions
54
scynapse-akka/src/main/scala/com/thenewmotion/scynapse/akka/AxonExtension.scala
This file was deleted.
Oops, something went wrong.
65 changes: 0 additions & 65 deletions
65
scynapse-akka/src/main/scala/com/thenewmotion/scynapse/akka/SubscriptionManager.scala
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.