added runner to buildr
This commit is contained in:
parent
c3bbf79ce4
commit
18794aa531
63 changed files with 90 additions and 602 deletions
|
|
@ -1,75 +0,0 @@
|
||||||
<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/maven-v4_0_0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<name>Akka Java API</name>
|
|
||||||
<artifactId>akka-api-java</artifactId>
|
|
||||||
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<artifactId>akka</artifactId>
|
|
||||||
<groupId>${akka.groupId}</groupId>
|
|
||||||
<version>${akka.version}</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>${akka.groupId}</groupId>
|
|
||||||
<artifactId>akka-kernel</artifactId>
|
|
||||||
<version>${akka.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<version>4.5</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<sourceDirectory>src/main</sourceDirectory>
|
|
||||||
<testSourceDirectory>src/test/java</testSourceDirectory>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<source>1.5</source>
|
|
||||||
<target>1.5</target>
|
|
||||||
<includes>
|
|
||||||
<include>**/*</include>
|
|
||||||
</includes>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<excludes>
|
|
||||||
<exclude>**/Abstract*</exclude>
|
|
||||||
</excludes>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<filtering>false</filtering>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
</resource>
|
|
||||||
<resource>
|
|
||||||
<filtering>false</filtering>
|
|
||||||
<directory>src/main/java</directory>
|
|
||||||
<includes>
|
|
||||||
<include>**</include>
|
|
||||||
</includes>
|
|
||||||
<excludes>
|
|
||||||
<exclude>**/*.java</exclude>
|
|
||||||
</excludes>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
</build>
|
|
||||||
<reporting>
|
|
||||||
<plugins></plugins>
|
|
||||||
</reporting>
|
|
||||||
</project>
|
|
||||||
35
buildfile
35
buildfile
|
|
@ -4,6 +4,8 @@ require 'buildr/scala'
|
||||||
|
|
||||||
VERSION_NUMBER = '0.1'
|
VERSION_NUMBER = '0.1'
|
||||||
|
|
||||||
|
ENV['AKKA_HOME'] ||= '.'
|
||||||
|
|
||||||
repositories.remote << 'http://www.ibiblio.org/maven2'
|
repositories.remote << 'http://www.ibiblio.org/maven2'
|
||||||
repositories.remote << 'http://scala-tools.org/repo-releases'
|
repositories.remote << 'http://scala-tools.org/repo-releases'
|
||||||
repositories.remote << 'http://scala-tools.org/repo-snapshots'
|
repositories.remote << 'http://scala-tools.org/repo-snapshots'
|
||||||
|
|
@ -12,7 +14,9 @@ repositories.remote << 'http://www.lag.net/repo'
|
||||||
AKKA_KERNEL = 'com.scalablesolutions.akka:akka-kernel:jar:0.1'
|
AKKA_KERNEL = 'com.scalablesolutions.akka:akka-kernel:jar:0.1'
|
||||||
AKKA_SUPERVISOR = 'com.scalablesolutions.akka:akka-supervisor:jar:0.1'
|
AKKA_SUPERVISOR = 'com.scalablesolutions.akka:akka-supervisor:jar:0.1'
|
||||||
AKKA_UTIL_JAVA = 'com.scalablesolutions.akka:akka-util-java:jar:0.1'
|
AKKA_UTIL_JAVA = 'com.scalablesolutions.akka:akka-util-java:jar:0.1'
|
||||||
|
AKKA_API_JAVA = 'com.scalablesolutions.akka:akka-api-java:jar:0.1'
|
||||||
|
|
||||||
|
SCALA = 'org.scala-lang:scala-library:jar:2.7.3'
|
||||||
GUICEYFRUIT = ['org.guiceyfruit:guice-core:jar:2.0-SNAPSHOT',
|
GUICEYFRUIT = ['org.guiceyfruit:guice-core:jar:2.0-SNAPSHOT',
|
||||||
'org.guiceyfruit:guice-jsr250:jar:2.0-SNAPSHOT']
|
'org.guiceyfruit:guice-jsr250:jar:2.0-SNAPSHOT']
|
||||||
JERSEY = ['com.sun.jersey:jersey-core:jar:1.0.1',
|
JERSEY = ['com.sun.jersey:jersey-core:jar:1.0.1',
|
||||||
|
|
@ -29,6 +33,10 @@ CONFIGGY = 'net.lag:configgy:jar:1.2'
|
||||||
ZOOKEEPER = 'org.apache:zookeeper:jar:3.1.0'
|
ZOOKEEPER = 'org.apache:zookeeper:jar:3.1.0'
|
||||||
GRIZZLY = 'com.sun.grizzly:grizzly-servlet-webserver:jar:1.8.6.3'
|
GRIZZLY = 'com.sun.grizzly:grizzly-servlet-webserver:jar:1.8.6.3'
|
||||||
JUNIT4 = 'junit:junit:jar:4.0'
|
JUNIT4 = 'junit:junit:jar:4.0'
|
||||||
|
GOOGLE_COLLECT = 'com.google.code.google-collections:google-collect:jar:snapshot-20080530'
|
||||||
|
JDOM = 'jdom:jdom:jar:1.0'
|
||||||
|
MINA_CORE = 'com.assembla.scala.mina:mina-core:jar:2.0.0-M2-SNAPSHOT'
|
||||||
|
MINA_SCALA = 'com.assembla.scala.mina:mina-integration-scala:jar:2.0.0-M2-SNAPSHOT'
|
||||||
|
|
||||||
desc 'The Akka Actor Kernel'
|
desc 'The Akka Actor Kernel'
|
||||||
define 'akka' do
|
define 'akka' do
|
||||||
|
|
@ -52,7 +60,14 @@ define 'akka' do
|
||||||
|
|
||||||
desc 'Akka Actor kernel core implementation'
|
desc 'Akka Actor kernel core implementation'
|
||||||
define 'kernel' do
|
define 'kernel' do
|
||||||
compile.with(AKKA_SUPERVISOR, AKKA_UTIL_JAVA, GUICEYFRUIT, JERSEY, VOLDEMORT, ZOOKEEPER, SLF4J, GRIZZLY, CONFIGGY, JUNIT4)
|
compile.with(AKKA_SUPERVISOR, AKKA_UTIL_JAVA, GUICEYFRUIT, MINA_CORE, MINA_SCALA, JERSEY, VOLDEMORT, ZOOKEEPER, SLF4J, GRIZZLY, CONFIGGY, JUNIT4)
|
||||||
|
test.using :specs
|
||||||
|
package :jar
|
||||||
|
end
|
||||||
|
|
||||||
|
desc 'Akka DB'
|
||||||
|
define 'db' do
|
||||||
|
compile.with(AKKA_KERNEL, MINA_CORE, MINA_SCALA, ZOOKEEPER, CONFIGGY, SLF4J, JUNIT4)
|
||||||
test.using :specs
|
test.using :specs
|
||||||
package :jar
|
package :jar
|
||||||
end
|
end
|
||||||
|
|
@ -71,5 +86,23 @@ define 'akka' do
|
||||||
package(:zip).include 'supervisor/target/*.jar', :path=>'lib'
|
package(:zip).include 'supervisor/target/*.jar', :path=>'lib'
|
||||||
package(:zip).include 'api-java/target/*.jar', :path=>'lib'
|
package(:zip).include 'api-java/target/*.jar', :path=>'lib'
|
||||||
package(:zip).include 'util-java/target/*.jar', :path=>'lib'
|
package(:zip).include 'util-java/target/*.jar', :path=>'lib'
|
||||||
|
|
||||||
|
task :run => [:package] do |t|
|
||||||
|
puts "-------------------------"
|
||||||
|
puts "Running Akka Actor Kernel"
|
||||||
|
puts "-------------------------"
|
||||||
|
puts "\n"
|
||||||
|
|
||||||
|
# uri = URI("file://./lib")
|
||||||
|
# uri.upload file('kernel')
|
||||||
|
|
||||||
|
cp = [SCALA, GUICEYFRUIT, JERSEY, VOLDEMORT, GOOGLE_COLLECT, JDOM, ZOOKEEPER, SLF4J, GRIZZLY, CONFIGGY, project('kernel').package(:jar)]
|
||||||
|
# Java.java('com.scalablesolutions.akka.kernel.Kernel', {:classpath => '-cp ' + cp})
|
||||||
|
|
||||||
|
# cp = FileList[_('lib/*')].join(File::PATH_SEPARATOR)
|
||||||
|
puts "Running with classpath:\n" + cp
|
||||||
|
Java.java('com.scalablesolutions.akka.Boot', 'com.scalablesolutions.akka.kernel.Kernel', {:classpath => cp})
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<stores>
|
<stores>
|
||||||
<store>
|
<store>
|
||||||
<name>snapshot</name>
|
<name>actors</name>
|
||||||
<persistence>bdb</persistence>
|
<persistence>bdb</persistence>
|
||||||
<routing>client</routing>
|
<routing>client</routing>
|
||||||
<replication-factor>1</replication-factor>
|
<replication-factor>1</replication-factor>
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
206
kernel/pom.xml
206
kernel/pom.xml
|
|
@ -1,206 +0,0 @@
|
||||||
<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/maven-v4_0_0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<artifactId>akka-kernel</artifactId>
|
|
||||||
<name>Akka Kernel Module</name>
|
|
||||||
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<artifactId>akka</artifactId>
|
|
||||||
<groupId>${akka.groupId}</groupId>
|
|
||||||
<version>${akka.version}</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>${akka.groupId}</groupId>
|
|
||||||
<artifactId>akka-supervisor</artifactId>
|
|
||||||
<version>${akka.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.scala-lang</groupId>
|
|
||||||
<artifactId>scala-library</artifactId>
|
|
||||||
<version>${scala.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.lag</groupId>
|
|
||||||
<artifactId>configgy</artifactId>
|
|
||||||
<version>1.2</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.guiceyfruit</groupId>
|
|
||||||
<artifactId>guice-core</artifactId>
|
|
||||||
<version>2.0-SNAPSHOT</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.guiceyfruit</groupId>
|
|
||||||
<artifactId>guice-jsr250</artifactId>
|
|
||||||
<version>2.0-SNAPSHOT</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.sun.grizzly</groupId>
|
|
||||||
<artifactId>grizzly-servlet-webserver</artifactId>
|
|
||||||
<version>1.8.6.3</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.sun.jersey</groupId>
|
|
||||||
<artifactId>jersey-server</artifactId>
|
|
||||||
<version>1.0.1</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.sun.jersey</groupId>
|
|
||||||
<artifactId>jersey-json</artifactId>
|
|
||||||
<version>1.0.1</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.sun.jersey</groupId>
|
|
||||||
<artifactId>jersey-atom</artifactId>
|
|
||||||
<version>1.0.1</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>voldemort</groupId>
|
|
||||||
<artifactId>voldemort</artifactId>
|
|
||||||
<version>0.4a</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>voldemort</groupId>
|
|
||||||
<artifactId>voldemort-contrib</artifactId>
|
|
||||||
<version>0.4a</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache</groupId>
|
|
||||||
<artifactId>zookeeper</artifactId>
|
|
||||||
<version>3.1.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-log4j12</artifactId>
|
|
||||||
<version>1.4.3</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-api</artifactId>
|
|
||||||
<version>1.4.3</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>log4j</groupId>
|
|
||||||
<artifactId>log4j</artifactId>
|
|
||||||
<version>1.2.13</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.specs</groupId>
|
|
||||||
<artifactId>specs</artifactId>
|
|
||||||
<version>1.4.3</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.scalacheck</groupId>
|
|
||||||
<artifactId>scalacheck</artifactId>
|
|
||||||
<version>1.5</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<sourceDirectory>src/main/scala</sourceDirectory>
|
|
||||||
<testSourceDirectory>src/test/scala</testSourceDirectory>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.scala-tools</groupId>
|
|
||||||
<artifactId>maven-scala-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>compile</goal>
|
|
||||||
<goal>testCompile</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<args>
|
|
||||||
<arg>-target:jvm-1.5</arg>
|
|
||||||
<arg>-unchecked</arg>
|
|
||||||
</args>
|
|
||||||
<scalaVersion>${scala.version}</scalaVersion>
|
|
||||||
<vscaladocVersion>1.0</vscaladocVersion>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-eclipse-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<downloadSources>true</downloadSources>
|
|
||||||
<buildcommands>
|
|
||||||
<buildcommand>
|
|
||||||
ch.epfl.lamp.sdt.core.scalabuilder
|
|
||||||
</buildcommand>
|
|
||||||
</buildcommands>
|
|
||||||
<additionalProjectnatures>
|
|
||||||
<projectnature>
|
|
||||||
ch.epfl.lamp.sdt.core.scalanature
|
|
||||||
</projectnature>
|
|
||||||
</additionalProjectnatures>
|
|
||||||
<classpathContainers>
|
|
||||||
<classpathContainer>
|
|
||||||
org.eclipse.jdt.launching.JRE_CONTAINER
|
|
||||||
</classpathContainer>
|
|
||||||
<classpathContainer>
|
|
||||||
ch.epfl.lamp.sdt.launching.SCALA_CONTAINER
|
|
||||||
</classpathContainer>
|
|
||||||
</classpathContainers>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<excludes>
|
|
||||||
<exclude>**/Abstract*</exclude>
|
|
||||||
</excludes>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>cobertura-maven-plugin</artifactId>
|
|
||||||
<version>2.2</version>
|
|
||||||
<configuration>
|
|
||||||
<formats>
|
|
||||||
<format>xml</format>
|
|
||||||
<format>html</format>
|
|
||||||
</formats>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<filtering>false</filtering>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
</resource>
|
|
||||||
<resource>
|
|
||||||
<filtering>false</filtering>
|
|
||||||
<directory>src/main/scala</directory>
|
|
||||||
<includes>
|
|
||||||
<include>**</include>
|
|
||||||
</includes>
|
|
||||||
<excludes>
|
|
||||||
<exclude>**/*.scala</exclude>
|
|
||||||
</excludes>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
</build>
|
|
||||||
<reporting>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.scala-tools</groupId>
|
|
||||||
<artifactId>maven-scala-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<vscaladocVersion>1.1</vscaladocVersion>
|
|
||||||
<scalaVersion>${scala.version}</scalaVersion>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</reporting>
|
|
||||||
</project>
|
|
||||||
|
|
@ -11,6 +11,9 @@ import java.util.{List => JList, ArrayList}
|
||||||
import java.lang.reflect.{Method, Field, InvocationHandler, Proxy, InvocationTargetException}
|
import java.lang.reflect.{Method, Field, InvocationHandler, Proxy, InvocationTargetException}
|
||||||
import java.lang.annotation.Annotation
|
import java.lang.annotation.Annotation
|
||||||
|
|
||||||
|
import voldemort.client.{SocketStoreClientFactory, StoreClient, StoreClientFactory}
|
||||||
|
import voldemort.versioning.Versioned
|
||||||
|
|
||||||
sealed class ActiveObjectException(msg: String) extends RuntimeException(msg)
|
sealed class ActiveObjectException(msg: String) extends RuntimeException(msg)
|
||||||
class ActiveObjectInvocationTimeoutException(msg: String) extends ActiveObjectException(msg)
|
class ActiveObjectInvocationTimeoutException(msg: String) extends ActiveObjectException(msg)
|
||||||
|
|
||||||
|
|
@ -94,14 +97,16 @@ class ActiveObjectProxy(val intf: Class[_], val target: Class[_], val timeout: I
|
||||||
invoke(Invocation(m, args, targetInstance))
|
invoke(Invocation(m, args, targetInstance))
|
||||||
|
|
||||||
def invoke(invocation: Invocation): AnyRef = {
|
def invoke(invocation: Invocation): AnyRef = {
|
||||||
if (invocation.method.isAnnotationPresent(oneway)) server ! invocation
|
val result: AnyRef =
|
||||||
else {
|
if (invocation.method.isAnnotationPresent(oneway)) server ! invocation
|
||||||
val result: ErrRef[AnyRef] = server !!! (invocation, ErrRef({
|
else {
|
||||||
throw new ActiveObjectInvocationTimeoutException(
|
val result: ErrRef[AnyRef] = server !!! (invocation, ErrRef({
|
||||||
"proxy invocation timed out after " + timeout + " milliseconds")
|
throw new ActiveObjectInvocationTimeoutException(
|
||||||
}))
|
"proxy invocation timed out after " + timeout + " milliseconds")
|
||||||
result()
|
}))
|
||||||
}
|
result()
|
||||||
|
}
|
||||||
|
result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
|
|
||||||
package com.scalablesolutions.akka
|
package com.scalablesolutions.akka
|
||||||
|
|
||||||
import com.scalablesolutions.akka.kernel.Logging
|
import kernel.Logging
|
||||||
|
import kernel.configuration.ConfigurationException
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.lang.reflect.Method
|
import java.lang.reflect.Method
|
||||||
|
|
@ -15,6 +16,11 @@ import java.net.{URL, URLClassLoader}
|
||||||
*/
|
*/
|
||||||
object Boot extends Logging {
|
object Boot extends Logging {
|
||||||
|
|
||||||
|
val HOME = try { System.getenv("AKKA_HOME") } catch { case e: NullPointerException => throw new ConfigurationException("AKKA_HOME system variable needs to be set") }
|
||||||
|
val CLASSES = HOME + "/classes"
|
||||||
|
val LIB = HOME + "/lib"
|
||||||
|
val CONFIG = HOME + "/config"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assumes that the AKKA_HOME directory is set with /config, /classes and /lib beneath it holding files and jars.
|
* Assumes that the AKKA_HOME directory is set with /config, /classes and /lib beneath it holding files and jars.
|
||||||
* Thus:
|
* Thus:
|
||||||
|
|
@ -25,12 +31,6 @@ object Boot extends Logging {
|
||||||
* $AKKA_HOME/config
|
* $AKKA_HOME/config
|
||||||
*/
|
*/
|
||||||
def main(args: Array[String]): Unit = {
|
def main(args: Array[String]): Unit = {
|
||||||
// TODO: read from env rather than jvm variables
|
|
||||||
val HOME = System.getProperty("AKKA_HOME", ".")
|
|
||||||
val CLASSES = HOME + "/classes"
|
|
||||||
val LIB = HOME + "/lib"
|
|
||||||
val CONFIG = HOME + "/config"
|
|
||||||
|
|
||||||
log.info("Bootstrapping Akka server from AKKA_HOME=%s", HOME)
|
log.info("Bootstrapping Akka server from AKKA_HOME=%s", HOME)
|
||||||
|
|
||||||
val libs = for (f <- new File(LIB).listFiles().toArray.toList.asInstanceOf[List[File]]) yield f.toURL
|
val libs = for (f <- new File(LIB).listFiles().toArray.toList.asInstanceOf[List[File]]) yield f.toURL
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@ import scala.reflect.BeanProperty
|
||||||
// ============================================
|
// ============================================
|
||||||
// Java version of the configuration API
|
// Java version of the configuration API
|
||||||
|
|
||||||
|
sealed class ConfigurationException(msg: String) extends RuntimeException(msg)
|
||||||
|
|
||||||
sealed abstract class Configuration
|
sealed abstract class Configuration
|
||||||
|
|
||||||
class RestartStrategy(@BeanProperty val scheme: FailOverScheme, @BeanProperty val maxNrOfRetries: Int, @BeanProperty val withinTimeRange: Int) extends Configuration {
|
class RestartStrategy(@BeanProperty val scheme: FailOverScheme, @BeanProperty val maxNrOfRetries: Int, @BeanProperty val withinTimeRange: Int) extends Configuration {
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,7 @@ import javax.management.JMException
|
||||||
object Kernel extends Logging {
|
object Kernel extends Logging {
|
||||||
|
|
||||||
val SERVER_URL = "localhost"
|
val SERVER_URL = "localhost"
|
||||||
val HOME = System.getProperty("AKKA_HOME", ".")
|
|
||||||
|
|
||||||
val JERSEY_SERVER_URL = "http://" + SERVER_URL + "/"
|
val JERSEY_SERVER_URL = "http://" + SERVER_URL + "/"
|
||||||
val JERSEY_SERVER_PORT = 9998
|
val JERSEY_SERVER_PORT = 9998
|
||||||
val JERSEY_REST_CLASSES_ROOT_PACKAGE = "com.scalablesolutions.akka.kernel"
|
val JERSEY_REST_CLASSES_ROOT_PACKAGE = "com.scalablesolutions.akka.kernel"
|
||||||
|
|
@ -39,10 +38,14 @@ object Kernel extends Logging {
|
||||||
|
|
||||||
val VOLDEMORT_SERVER_URL = "tcp://" + SERVER_URL
|
val VOLDEMORT_SERVER_URL = "tcp://" + SERVER_URL
|
||||||
val VOLDEMORT_SERVER_PORT = 6666
|
val VOLDEMORT_SERVER_PORT = 6666
|
||||||
|
val VOLDEMORT_BOOTSTRAP_URL = VOLDEMORT_SERVER_URL + ":" + VOLDEMORT_SERVER_PORT
|
||||||
|
|
||||||
val ZOO_KEEPER_SERVER_URL = SERVER_URL
|
val ZOO_KEEPER_SERVER_URL = SERVER_URL
|
||||||
val ZOO_KEEPER_SERVER_PORT = 9898
|
val ZOO_KEEPER_SERVER_PORT = 9898
|
||||||
|
|
||||||
|
private[this] var storageFactory: StoreClientFactory = _
|
||||||
|
private[this] var storageServer: VoldemortServer = _
|
||||||
|
|
||||||
def main(args: Array[String]): Unit = {
|
def main(args: Array[String]): Unit = {
|
||||||
//startZooKeeper
|
//startZooKeeper
|
||||||
startVoldemort
|
startVoldemort
|
||||||
|
|
@ -63,12 +66,36 @@ object Kernel extends Logging {
|
||||||
}
|
}
|
||||||
|
|
||||||
private[akka] def startVoldemort = {
|
private[akka] def startVoldemort = {
|
||||||
val config = VoldemortConfig.loadFromVoldemortHome(HOME)
|
// Start Voldemort server
|
||||||
val server = new VoldemortServer(config)
|
val config = VoldemortConfig.loadFromVoldemortHome(Boot.HOME)
|
||||||
server.start
|
storageServer = new VoldemortServer(config)
|
||||||
log.info("Replicated persistent storage server started at %s", VOLDEMORT_SERVER_URL + ":" + VOLDEMORT_SERVER_PORT)
|
storageServer.start
|
||||||
|
log.info("Replicated persistent storage server started at %s", VOLDEMORT_BOOTSTRAP_URL)
|
||||||
|
|
||||||
|
// Create Voldemort client factory
|
||||||
|
val numThreads = 10
|
||||||
|
val maxQueuedRequests = 10
|
||||||
|
val maxConnectionsPerNode = 10
|
||||||
|
val maxTotalConnections = 100
|
||||||
|
storageFactory = new SocketStoreClientFactory(
|
||||||
|
numThreads,
|
||||||
|
numThreads,
|
||||||
|
maxQueuedRequests,
|
||||||
|
maxConnectionsPerNode,
|
||||||
|
maxTotalConnections,
|
||||||
|
VOLDEMORT_BOOTSTRAP_URL)
|
||||||
|
|
||||||
|
val name = this.getClass.getName
|
||||||
|
val storage = getStorageFor("actors")
|
||||||
|
// val value = storage.get(name)
|
||||||
|
val value = new Versioned("state")
|
||||||
|
//value.setObject("state")
|
||||||
|
storage.put(name, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private[akka] def getStorageFor(storageName: String): StoreClient[String, String] =
|
||||||
|
storageFactory.getStoreClient(storageName)
|
||||||
|
|
||||||
// private[akka] def startZooKeeper = {
|
// private[akka] def startZooKeeper = {
|
||||||
// try {
|
// try {
|
||||||
// ManagedUtil.registerLog4jMBeans
|
// ManagedUtil.registerLog4jMBeans
|
||||||
|
|
@ -100,25 +127,6 @@ object Kernel extends Logging {
|
||||||
// } catch { case e => log.fatal("Unexpected exception: s%",e) }
|
// } catch { case e => log.fatal("Unexpected exception: s%",e) }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
private[akka] def getStorage(storageName: String): StoreClient[String, String] = {
|
|
||||||
//Versioned value = client.get("some_key");
|
|
||||||
//value.setObject("some_value");
|
|
||||||
//client.put("some_key", value);
|
|
||||||
val numThreads = 10
|
|
||||||
val maxQueuedRequests = 10
|
|
||||||
val maxConnectionsPerNode = 10
|
|
||||||
val maxTotalConnections = 100
|
|
||||||
val bootstrapUrl = VOLDEMORT_SERVER_URL + VOLDEMORT_SERVER_PORT
|
|
||||||
val factory = new SocketStoreClientFactory(
|
|
||||||
numThreads,
|
|
||||||
numThreads,
|
|
||||||
maxQueuedRequests,
|
|
||||||
maxConnectionsPerNode,
|
|
||||||
maxTotalConnections,
|
|
||||||
bootstrapUrl)
|
|
||||||
factory.getStoreClient(storageName)
|
|
||||||
}
|
|
||||||
|
|
||||||
private def getPort(defaultPort: Int) = {
|
private def getPort(defaultPort: Int) = {
|
||||||
val port = System.getenv("JERSEY_HTTP_PORT")
|
val port = System.getenv("JERSEY_HTTP_PORT")
|
||||||
if (null != port) Integer.parseInt(port)
|
if (null != port) Integer.parseInt(port)
|
||||||
|
|
|
||||||
107
pom.xml
107
pom.xml
|
|
@ -1,107 +0,0 @@
|
||||||
<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/maven-v4_0_0.xsd">
|
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<name>Akka Actor Kernel</name>
|
|
||||||
<artifactId>akka</artifactId>
|
|
||||||
<groupId>${akka.groupId}</groupId>
|
|
||||||
<version>${akka.version}</version>
|
|
||||||
<inceptionYear>2009</inceptionYear>
|
|
||||||
<packaging>pom</packaging>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<akka.version>0.1</akka.version>
|
|
||||||
<akka.groupId>com.scalablesolutions.akka</akka.groupId>
|
|
||||||
<scala.version>2.7.3</scala.version>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<modules>
|
|
||||||
<module>util-java</module>
|
|
||||||
<module>supervisor</module>
|
|
||||||
<module>kernel</module>
|
|
||||||
<module>api-java</module>
|
|
||||||
</modules>
|
|
||||||
|
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>repo1.maven</id>
|
|
||||||
<name>Maven Main Repository</name>
|
|
||||||
<url>http://repo1.maven.org/maven2</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<id>scala-tools-snapshots</id>
|
|
||||||
<name>Scala-Tools Maven2 Snapshot Repository</name>
|
|
||||||
<url>http://scala-tools.org/repo-snapshots</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<id>scala-tools</id>
|
|
||||||
<name>Scala-Tools Maven2 Repository</name>
|
|
||||||
<url>http://scala-tools.org/repo-releases</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<id>lag</id>
|
|
||||||
<name>Configgy's' Repository</name>
|
|
||||||
<url>http://www.lag.net/repo</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<id>maven2-repository.dev.java.net</id>
|
|
||||||
<name>Java.net Repository for Maven</name>
|
|
||||||
<url>http://download.java.net/maven/2</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<id>java.net</id>
|
|
||||||
<url>http://download.java.net/maven/1</url>
|
|
||||||
<layout>legacy</layout>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
|
|
||||||
<pluginRepositories>
|
|
||||||
<pluginRepository>
|
|
||||||
<id>scala-tools.org</id>
|
|
||||||
<name>Scala-Tools Maven2 Repository</name>
|
|
||||||
<url>http://scala-tools.org/repo-releases</url>
|
|
||||||
</pluginRepository>
|
|
||||||
</pluginRepositories>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-antrun-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<tasks>
|
|
||||||
<!-- To start an akka server, use: mvn antrun:run -->
|
|
||||||
<echo message="akka kernel starting..."/>
|
|
||||||
|
|
||||||
<property name="compile_classpath" refid="maven.compile.classpath"/>
|
|
||||||
<property name="runtime_classpath" refid="maven.runtime.classpath"/>
|
|
||||||
<property name="test_classpath" refid="maven.test.classpath"/>
|
|
||||||
|
|
||||||
<java classname="com.scalablesolutions.akka.Boot" fork="true">
|
|
||||||
<classpath>
|
|
||||||
<pathelement path="${runtime_classpath}"/>
|
|
||||||
<pathelement path="${compile_classpath}"/>
|
|
||||||
</classpath>
|
|
||||||
<jvmarg value="-server"/>
|
|
||||||
<jvmarg value="-Xms256M"/>
|
|
||||||
<jvmarg value="-Xmx256M"/>
|
|
||||||
<jvmarg value="-verbosegc"/>
|
|
||||||
<!-- for profiling/performance...
|
|
||||||
<jvmarg value="-javaagent:tmp/shiftone-jrat.jar"/>
|
|
||||||
<jvmarg value="-agentlib:hprof=heap=sites"/>
|
|
||||||
<jvmarg value="-agentlib:hprof=cpu=samples"/>
|
|
||||||
<jvmarg value="-agentlib:hprof=cpu=times,thread=y"/>
|
|
||||||
-->
|
|
||||||
<arg value="com.scalablesolutions.akka.kernel.Kernel"/>
|
|
||||||
<arg value="."/>
|
|
||||||
</java>
|
|
||||||
<echo message="akka server is shutdown"/>
|
|
||||||
</tasks>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
</project>
|
|
||||||
|
|
@ -1,139 +0,0 @@
|
||||||
<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/maven-v4_0_0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<artifactId>akka-supervisor</artifactId>
|
|
||||||
<name>Akka Supervisor Module</name>
|
|
||||||
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<artifactId>akka</artifactId>
|
|
||||||
<groupId>${akka.groupId}</groupId>
|
|
||||||
<version>${akka.version}</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>${akka.groupId}</groupId>
|
|
||||||
<artifactId>akka-util-java</artifactId>
|
|
||||||
<version>${akka.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.scala-lang</groupId>
|
|
||||||
<artifactId>scala-library</artifactId>
|
|
||||||
<version>${scala.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.lag</groupId>
|
|
||||||
<artifactId>configgy</artifactId>
|
|
||||||
<version>1.2</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.specs</groupId>
|
|
||||||
<artifactId>specs</artifactId>
|
|
||||||
<version>1.4.3</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<sourceDirectory>src/main/scala</sourceDirectory>
|
|
||||||
<testSourceDirectory>src/test/scala</testSourceDirectory>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.scala-tools</groupId>
|
|
||||||
<artifactId>maven-scala-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>compile</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<args>
|
|
||||||
<arg>-target:jvm-1.5</arg>
|
|
||||||
<arg>-unchecked</arg>
|
|
||||||
</args>
|
|
||||||
<scalaVersion>${scala.version}</scalaVersion>
|
|
||||||
<vscaladocVersion>1.0</vscaladocVersion>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-eclipse-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<downloadSources>true</downloadSources>
|
|
||||||
<buildcommands>
|
|
||||||
<buildcommand>
|
|
||||||
ch.epfl.lamp.sdt.core.scalabuilder
|
|
||||||
</buildcommand>
|
|
||||||
</buildcommands>
|
|
||||||
<additionalProjectnatures>
|
|
||||||
<projectnature>
|
|
||||||
ch.epfl.lamp.sdt.core.scalanature
|
|
||||||
</projectnature>
|
|
||||||
</additionalProjectnatures>
|
|
||||||
<classpathContainers>
|
|
||||||
<classpathContainer>
|
|
||||||
org.eclipse.jdt.launching.JRE_CONTAINER
|
|
||||||
</classpathContainer>
|
|
||||||
<classpathContainer>
|
|
||||||
ch.epfl.lamp.sdt.launching.SCALA_CONTAINER
|
|
||||||
</classpathContainer>
|
|
||||||
</classpathContainers>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<excludes>
|
|
||||||
<exclude>**/Abstract*</exclude>
|
|
||||||
</excludes>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>cobertura-maven-plugin</artifactId>
|
|
||||||
<version>2.2</version>
|
|
||||||
<configuration>
|
|
||||||
<formats>
|
|
||||||
<format>xml</format>
|
|
||||||
<format>html</format>
|
|
||||||
</formats>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<filtering>false</filtering>
|
|
||||||
<directory>src/main/resources</directory>
|
|
||||||
</resource>
|
|
||||||
<resource>
|
|
||||||
<filtering>false</filtering>
|
|
||||||
<directory>src/main/scala</directory>
|
|
||||||
<includes>
|
|
||||||
<include>**</include>
|
|
||||||
</includes>
|
|
||||||
<excludes>
|
|
||||||
<exclude>**/*.scala</exclude>
|
|
||||||
</excludes>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
</build>
|
|
||||||
<reporting>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.scala-tools</groupId>
|
|
||||||
<artifactId>maven-scala-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<vscaladocVersion>1.1</vscaladocVersion>
|
|
||||||
<scalaVersion>${scala.version}</scalaVersion>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</reporting>
|
|
||||||
</project>
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
<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/maven-v4_0_0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<artifactId>akka-util-java</artifactId>
|
|
||||||
<name>Akka Java Utilities Module</name>
|
|
||||||
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<artifactId>akka</artifactId>
|
|
||||||
<groupId>${akka.groupId}</groupId>
|
|
||||||
<version>${akka.version}</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<sourceDirectory>src/main/java</sourceDirectory>
|
|
||||||
<testSourceDirectory>src/test/java</testSourceDirectory>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<source>1.5</source>
|
|
||||||
<target>1.5</target>
|
|
||||||
<includes>
|
|
||||||
<include>**/*</include>
|
|
||||||
</includes>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue