Skip to content

Commit

Permalink
Changed the structure to become part of the AxonFramework
Browse files Browse the repository at this point in the history
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
olger committed Oct 25, 2014
1 parent 4c7a2bd commit f044768
Show file tree
Hide file tree
Showing 36 changed files with 884 additions and 1,673 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -2,6 +2,7 @@
.idea
.idea_modules
*.iml
**/*.iml
*.ipr
*.iws

Expand All @@ -28,3 +29,5 @@ logs
# sbt
.lib
project/target
.settings/
events/
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

1,328 changes: 201 additions & 1,127 deletions LICENSE.txt

Large diffs are not rendered by default.

74 changes: 71 additions & 3 deletions README.md
@@ -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.

146 changes: 82 additions & 64 deletions project/ScynapseBuild.scala
@@ -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"
}
2 changes: 1 addition & 1 deletion project/build.properties
@@ -1 +1 @@
sbt.version=0.13.5
sbt.version=0.13.6
9 changes: 0 additions & 9 deletions project/build.sbt
@@ -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")

This file was deleted.

This file was deleted.

0 comments on commit f044768

Please sign in to comment.