Update tutorials and include source in the distribution
This commit is contained in:
parent
c581e4be28
commit
8dec4bcbc4
18 changed files with 243 additions and 194 deletions
7
akka-tutorials/akka-tutorial-second/README
Normal file
7
akka-tutorials/akka-tutorial-second/README
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
=================
|
||||
Second Tutorial
|
||||
=================
|
||||
|
||||
This is the source code for the second tutorial.
|
||||
|
||||
See the Akka Documentation for information about this tutorial.
|
||||
43
akka-tutorials/akka-tutorial-second/pom.xml
Normal file
43
akka-tutorials/akka-tutorial-second/pom.xml
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<name>akka-tutorial-second-java</name>
|
||||
<groupId>akka.tutorial.second.java</groupId>
|
||||
<artifactId>akka-tutorial-second-java</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.2-SNAPSHOT</version>
|
||||
<url>http://akka.io</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>se.scalablesolutions.akka</groupId>
|
||||
<artifactId>akka-actor</artifactId>
|
||||
<version>1.2-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>Akka</id>
|
||||
<name>Akka Maven2 Repository</name>
|
||||
<url>http://akka.io/repository/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
project.organization=akka.tutorial.second.scala
|
||||
project.name=akka-tutorial-second-scala
|
||||
project.version=1.2-SNAPSHOT
|
||||
build.scala.versions=2.9.0.RC3
|
||||
sbt.version=0.7.6.RC0
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import sbt._
|
||||
|
||||
class TutorialTwoProject(info: ProjectInfo) extends DefaultProject(info) with AkkaProject
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
import sbt._
|
||||
|
||||
class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
|
||||
val akkaRepo = "Akka Repo" at "http://akka.io/repository"
|
||||
val akkaPlugin = "se.scalablesolutions.akka" % "akka-sbt-plugin" % "1.2-SNAPSHOT"
|
||||
}
|
||||
|
|
@ -20,31 +20,6 @@ import akka.routing.InfiniteIterator;
|
|||
import akka.routing.Routing.Broadcast;
|
||||
import akka.routing.UntypedLoadBalancer;
|
||||
|
||||
/**
|
||||
* Second part in Akka tutorial for Java.
|
||||
* <p/>
|
||||
* Calculates Pi.
|
||||
* <p/>
|
||||
* Run on command line:
|
||||
* <pre>
|
||||
* $ cd akka-1.1
|
||||
* $ export AKKA_HOME=`pwd`
|
||||
* $ javac -cp dist/akka-actor-1.2-SNAPSHOT.jar:scala-library.jar akka/tutorial/java/second/Pi.java
|
||||
* $ java -cp dist/akka-actor-1.2-SNAPSHOT.jar:scala-library.jar:. akka.tutorial.java.second.Pi
|
||||
* $ ...
|
||||
* </pre>
|
||||
* <p/>
|
||||
* Run it in Maven:
|
||||
* <pre>
|
||||
* $ mvn
|
||||
* > scala:console
|
||||
* > val pi = new akka.tutorial.java.second.Pi
|
||||
* > pi.calculate(4, 10000, 10000)
|
||||
* > ...
|
||||
* </pre>
|
||||
*
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
public class Pi {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
|
|
|||
|
|
@ -13,32 +13,6 @@ import akka.dispatch.Future
|
|||
|
||||
import System.{currentTimeMillis => now}
|
||||
|
||||
/**
|
||||
* Second part in Akka tutorial.
|
||||
* <p/>
|
||||
* Calculates Pi.
|
||||
* <p/>
|
||||
* Run on command line:
|
||||
* <pre>
|
||||
* $ cd akka-1.1
|
||||
* $ export AKKA_HOME=`pwd`
|
||||
* $ scalac -cp dist/akka-actor-1.2-SNAPSHOT.jar Pi.scala
|
||||
* $ java -cp dist/akka-actor-1.2-SNAPSHOT.jar:scala-library.jar:. akka.tutorial.second.Pi
|
||||
* $ ...
|
||||
* </pre>
|
||||
* <p/>
|
||||
* Run it in SBT:
|
||||
* <pre>
|
||||
* $ sbt
|
||||
* > update
|
||||
* > console
|
||||
* > akka.tutorial.second.Pi.calculate(nrOfWorkers = 4, nrOfElements = 10000, nrOfMessages = 10000)
|
||||
* > ...
|
||||
* > :quit
|
||||
* </pre>
|
||||
*
|
||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||
*/
|
||||
object Pi extends App {
|
||||
|
||||
calculate(nrOfWorkers = 4, nrOfElements = 10000, nrOfMessages = 10000)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue