cleaned up supervisor and actor api, breaking changes

This commit is contained in:
jboner 2009-11-20 08:29:31 +01:00
parent 50e73c2a9f
commit a1adfd42e8
51 changed files with 637 additions and 806 deletions

View file

@ -7,111 +7,6 @@
<element id="directory" name="classes"> <element id="directory" name="classes">
<element id="module-output" name="akka-samples-lift" /> <element id="module-output" name="akka-samples-lift" />
</element> </element>
<element id="directory" name="lib">
<element id="archive" name="akka-util-java-0.6.jar">
<element id="module-output" name="akka-util-java" />
</element>
<element id="library" level="project" name="Maven: org.guiceyfruit:guice-core:2.0-beta-4" />
<element id="library" level="project" name="Maven: com.google.code.google-collections:google-collect:snapshot-20080530" />
<element id="library" level="project" name="Maven: cglib:cglib:2.2" />
<element id="library" level="project" name="Maven: asm:asm:3.1" />
<element id="library" level="project" name="Maven: aopalliance:aopalliance:1.0" />
<element id="library" level="project" name="Maven: com.google.protobuf:protobuf-java:2.2.0" />
<element id="library" level="project" name="Maven: org.multiverse:multiverse-core:0.3-SNAPSHOT" />
<element id="library" level="project" name="Maven: org.multiverse:multiverse-alpha:0.3-SNAPSHOT" />
<element id="library" level="project" name="Maven: asm:asm-tree:3.1" />
<element id="library" level="project" name="Maven: asm:asm-commons:3.1" />
<element id="library" level="project" name="Maven: asm:asm-util:3.1" />
<element id="archive" name="akka-util-0.6.jar">
<element id="module-output" name="akka-util" />
</element>
<element id="library" level="project" name="Maven: org.scala-lang:scala-library:2.7.5" />
<element id="library" level="project" name="Maven: net.lag:configgy:1.3" />
<element id="library" level="project" name="Maven: org.scala-tools:vscaladoc:1.1-md-3" />
<element id="library" level="project" name="Maven: markdownj:markdownj:1.0.2b4-0.3.0" />
<element id="library" level="project" name="Maven: org.scala-tools.testing:specs:1.4.4" />
<element id="archive" name="akka-actors-0.6.jar">
<element id="module-output" name="akka-actors" />
</element>
<element id="library" level="project" name="Maven: org.codehaus.aspectwerkz:aspectwerkz-nodeps-jdk5:2.1" />
<element id="library" level="project" name="Maven: org.codehaus.aspectwerkz:aspectwerkz-jdk5:2.1" />
<element id="library" level="project" name="Maven: org.jboss.netty:netty:3.2.0.ALPHA1" />
<element id="library" level="project" name="Maven: org.scala-tools:javautils:2.7.4-0.1" />
<element id="library" level="project" name="Maven: org.codehaus.jackson:jackson-core-asl:1.1.0" />
<element id="library" level="project" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.1.0" />
<element id="library" level="project" name="Maven: sbinary:sbinary:0.3" />
<element id="library" level="project" name="Maven: dispatch.json:dispatch-json:0.5.2" />
<element id="library" level="project" name="Maven: dispatch.http:dispatch-http:0.5.2" />
<element id="library" level="project" name="Maven: sjson.json:sjson:0.2" />
<element id="library" level="project" name="Maven: org.slf4j:slf4j-log4j12:1.4.3" />
<element id="library" level="project" name="Maven: org.slf4j:slf4j-api:1.4.3" />
<element id="library" level="project" name="Maven: log4j:log4j:1.2.13" />
<element id="library" level="project" name="Maven: commons-logging:commons-logging:1.0.4" />
<element id="archive" name="akka-persistence-0.6.jar">
<element id="module-output" name="akka-persistence" />
</element>
<element id="library" level="project" name="Maven: com.mongodb:mongo:0.6" />
<element id="library" level="project" name="Maven: org.apache.cassandra:cassandra:0.4.1" />
<element id="library" level="project" name="Maven: com.facebook:thrift:1.0" />
<element id="library" level="project" name="Maven: commons-pool:commons-pool:1.5.1" />
<element id="archive" name="akka-rest-0.6.jar">
<element id="module-output" name="akka-rest" />
</element>
<element id="library" level="project" name="Maven: com.sun.grizzly:grizzly-comet-webserver:1.8.6.3" />
<element id="library" level="project" name="Maven: com.sun.grizzly:grizzly-servlet-webserver:1.8.6.3" />
<element id="library" level="project" name="Maven: com.sun.grizzly:grizzly-http:1.8.6.3" />
<element id="library" level="project" name="Maven: com.sun.grizzly:grizzly-framework:1.8.6.3" />
<element id="library" level="project" name="Maven: com.sun.grizzly:grizzly-http-utils:1.8.6.3" />
<element id="library" level="project" name="Maven: com.sun.grizzly:grizzly-rcm:1.8.6.3" />
<element id="library" level="project" name="Maven: com.sun.grizzly:grizzly-portunif:1.8.6.3" />
<element id="library" level="project" name="Maven: com.sun.grizzly:grizzly-http-servlet:1.8.6.3" />
<element id="library" level="project" name="Maven: com.sun.grizzly:grizzly-comet:1.8.6.3" />
<element id="library" level="project" name="Maven: com.sun.jersey:jersey-core:1.1.3-ea" />
<element id="library" level="project" name="Maven: javax.ws.rs:jsr311-api:1.0" />
<element id="library" level="project" name="Maven: com.sun.jersey:jersey-server:1.1.3-ea" />
<element id="library" level="project" name="Maven: com.sun.jersey:jersey-json:1.1.3-ea" />
<element id="library" level="project" name="Maven: org.codehaus.jettison:jettison:1.1" />
<element id="library" level="project" name="Maven: stax:stax-api:1.0.1" />
<element id="library" level="project" name="Maven: com.sun.xml.bind:jaxb-impl:2.1.12" />
<element id="library" level="project" name="Maven: javax.xml.bind:jaxb-api:2.1" />
<element id="library" level="project" name="Maven: javax.xml.stream:stax-api:1.0-2" />
<element id="library" level="project" name="Maven: javax.activation:activation:1.1" />
<element id="library" level="project" name="Maven: com.sun.jersey.contribs:jersey-scala:1.1.3-ea" />
<element id="archive" name="akka-kernel-0.6.jar">
<element id="module-output" name="akka-kernel" />
</element>
<element id="archive" name="akka-amqp-0.6.jar">
<element id="module-output" name="akka-amqp" />
</element>
<element id="library" level="project" name="Maven: com.rabbitmq:rabbitmq-client:0.9.1" />
<element id="library" level="project" name="Maven: commons-io:commons-io:1.4" />
<element id="archive" name="akka-camel-0.6.jar">
<element id="module-output" name="akka-camel" />
</element>
<element id="library" level="project" name="Maven: org.apache.camel:camel-core:2.0-SNAPSHOT" />
<element id="library" level="project" name="Maven: commons-logging:commons-logging-api:1.1" />
<element id="archive" name="akka-security-0.6.jar">
<element id="module-output" name="akka-security" />
</element>
<element id="library" level="project" name="Maven: javax.annotation:jsr250-api:1.0" />
<element id="library" level="project" name="Maven: net.liftweb:lift-util:1.1-M6" />
<element id="library" level="project" name="Maven: javax.mail:mail:1.4" />
<element id="library" level="project" name="Maven: commons-httpclient:commons-httpclient:3.1" />
<element id="library" level="project" name="Maven: commons-codec:commons-codec:1.3" />
<element id="library" level="project" name="Maven: commons-fileupload:commons-fileupload:1.2.1" />
<element id="library" level="project" name="Maven: commons-collections:commons-collections:3.2.1" />
<element id="library" level="project" name="Maven: org.guiceyfruit:guiceyfruit-core:2.0" />
<element id="library" level="project" name="Maven: org.guiceyfruit:guice-all:2.0" />
<element id="library" level="project" name="Maven: javax.annotation:com.springsource.javax.annotation:1.0.0" />
<element id="library" level="project" name="Maven: org.aopalliance:com.springsource.org.aopalliance:1.0.0" />
<element id="library" level="project" name="Maven: org.apache:zookeeper:3.1.0" />
<element id="library" level="project" name="Maven: org.atmosphere:atmosphere-runtime:0.4.1" />
<element id="library" level="project" name="Maven: org.atmosphere:atmosphere-compat:0.4.1" />
<element id="library" level="project" name="Maven: org.atmosphere:atmosphere-core:0.4-SNAPSHOT" />
<element id="library" level="project" name="Maven: org.atmosphere:atmosphere-portable-runtime:0.4-SNAPSHOT" />
<element id="library" level="project" name="Maven: net.liftweb:lift-webkit:1.1-M6" />
<element id="library" level="project" name="Maven: net.liftweb:lift-actor:1.1-M6" />
</element>
</element> </element>
</root> </root>
</artifact> </artifact>

View file

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: com.google.protobuf:protobuf-java:2.1.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/google/protobuf/protobuf-java/2.1.0/protobuf-java-2.1.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/google/protobuf/protobuf-java/2.1.0/protobuf-java-2.1.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/google/protobuf/protobuf-java/2.1.0/protobuf-java-2.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: net.liftweb:lift-actor:1.1-M6">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/net/liftweb/lift-actor/1.1-M6/lift-actor-1.1-M6.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/net/liftweb/lift-actor/1.1-M6/lift-actor-1.1-M6-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/net/liftweb/lift-actor/1.1-M6/lift-actor-1.1-M6-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: net.liftweb:lift-webkit:1.1-M6">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/net/liftweb/lift-webkit/1.1-M6/lift-webkit-1.1-M6.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/net/liftweb/lift-webkit/1.1-M6/lift-webkit-1.1-M6-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/net/liftweb/lift-webkit/1.1-M6/lift-webkit-1.1-M6-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: org.mortbay.jetty:jetty:6.1.22">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/mortbay/jetty/jetty/6.1.22/jetty-6.1.22.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/mortbay/jetty/jetty/6.1.22/jetty-6.1.22-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/mortbay/jetty/jetty/6.1.22/jetty-6.1.22-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: org.mortbay.jetty:jetty-util:6.1.22">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/mortbay/jetty/jetty-util/6.1.22/jetty-util-6.1.22.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/mortbay/jetty/jetty-util/6.1.22/jetty-util-6.1.22-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/mortbay/jetty/jetty-util/6.1.22/jetty-util-6.1.22-sources.jar!/" />
</SOURCES>
</library>
</component>

View file

@ -1,13 +0,0 @@
<component name="libraryTable">
<library name="Maven: org.mortbay.jetty:servlet-api:2.5-20081211">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211-sources.jar!/" />
</SOURCES>
</library>
</component>

223
.idea/workspace.xml generated
View file

@ -2,7 +2,57 @@
<project version="4"> <project version="4">
<component name="ChangeListManager" verified="true"> <component name="ChangeListManager" verified="true">
<list default="true" id="e5228cd0-f5f0-4bab-b96d-de1a99e71911" name="Default" comment=""> <list default="true" id="e5228cd0-f5f0-4bab-b96d-de1a99e71911" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-actors/src/test/scala/ThreadBasedActorTest.scala" afterPath="$PROJECT_DIR$/akka-actors/src/test/scala/ThreadBasedActorTest.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-security/src/main/scala/Security.scala" afterPath="$PROJECT_DIR$/akka-security/src/main/scala/Security.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/scaladocs-akka-security/se/scalablesolutions/akka/security/AuthenticationActor.html" afterPath="$PROJECT_DIR$/docs/scaladocs-akka-security/se/scalablesolutions/akka/security/AuthenticationActor.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-actors/src/test/scala/ThreadBasedDispatcherTest.scala" afterPath="$PROJECT_DIR$/akka-actors/src/test/scala/ThreadBasedDispatcherTest.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-amqp/src/main/scala/ExampleSession.scala" afterPath="$PROJECT_DIR$/akka-amqp/src/main/scala/ExampleSession.scala" />
<change type="DELETED" beforePath="$PROJECT_DIR$/.idea/libraries/Maven__net_liftweb_lift_actor_1_1_M6.xml" afterPath="" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/scaladocs-akka-security/Security.scala.html" afterPath="$PROJECT_DIR$/docs/scaladocs-akka-security/Security.scala.html" />
<change type="DELETED" beforePath="$PROJECT_DIR$/.idea/libraries/Maven__org_mortbay_jetty_jetty_6_1_22.xml" afterPath="" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-actors/src/test/scala/EventBasedThreadPoolDispatcherTest.scala" afterPath="$PROJECT_DIR$/akka-actors/src/test/scala/EventBasedThreadPoolDispatcherTest.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-actors/src/test/scala/EventBasedThreadPoolActorTest.scala" afterPath="$PROJECT_DIR$/akka-actors/src/test/scala/EventBasedThreadPoolActorTest.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-actors/src/test/scala/EventBasedSingleThreadActorTest.scala" afterPath="$PROJECT_DIR$/akka-actors/src/test/scala/EventBasedSingleThreadActorTest.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-actors/src/test/scala/InMemoryActorTest.scala" afterPath="$PROJECT_DIR$/akka-actors/src/test/scala/InMemoryActorTest.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-amqp/src/main/scala/AMQP.scala" afterPath="$PROJECT_DIR$/akka-amqp/src/main/scala/AMQP.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-actors/src/test/scala/SupervisorTest.scala" afterPath="$PROJECT_DIR$/akka-actors/src/test/scala/SupervisorTest.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/scaladocs-akka-actors/se/scalablesolutions/akka/actor/Scheduler$object.html" afterPath="$PROJECT_DIR$/docs/scaladocs-akka-actors/se/scalablesolutions/akka/actor/Scheduler$object.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/scaladocs-akka-security/se/scalablesolutions/akka/security/BasicAuthenticationActor.html" afterPath="$PROJECT_DIR$/docs/scaladocs-akka-security/se/scalablesolutions/akka/security/BasicAuthenticationActor.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/scaladocs-akka-actors/actor/Actor.scala.html" afterPath="$PROJECT_DIR$/docs/scaladocs-akka-actors/actor/Actor.scala.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-persistence/src/test/scala/MongoPersistentActorSpec.scala" afterPath="$PROJECT_DIR$/akka-persistence/src/test/scala/MongoPersistentActorSpec.scala" />
<change type="DELETED" beforePath="$PROJECT_DIR$/.idea/libraries/Maven__org_mortbay_jetty_servlet_api_2_5_20081211.xml" afterPath="" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/scaladocs-akka-actors/se/scalablesolutions/akka/actor/Actor.html" afterPath="$PROJECT_DIR$/docs/scaladocs-akka-actors/se/scalablesolutions/akka/actor/Actor.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemNestedStateTest.java" afterPath="$PROJECT_DIR$/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemNestedStateTest.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-samples-security/src/main/scala/SimpleService.scala" afterPath="$PROJECT_DIR$/akka-samples-security/src/main/scala/SimpleService.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/scaladocs-akka-amqp/ExampleSession.scala.html" afterPath="$PROJECT_DIR$/docs/scaladocs-akka-amqp/ExampleSession.scala.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-samples-lift/src/main/scala/bootstrap/liftweb/Boot.scala" afterPath="$PROJECT_DIR$/akka-samples-lift/src/main/scala/bootstrap/liftweb/Boot.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java" afterPath="$PROJECT_DIR$/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/scaladocs-akka-amqp/se/scalablesolutions/akka/amqp/AMQP$object.html" afterPath="$PROJECT_DIR$/docs/scaladocs-akka-amqp/se/scalablesolutions/akka/amqp/AMQP$object.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/scaladocs-akka-actors/actor/Supervisor.scala.html" afterPath="$PROJECT_DIR$/docs/scaladocs-akka-actors/actor/Supervisor.scala.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-actors/src/main/scala/actor/Actor.scala" afterPath="$PROJECT_DIR$/akka-actors/src/main/scala/actor/Actor.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-actors/src/main/scala/actor/Supervisor.scala" afterPath="$PROJECT_DIR$/akka-actors/src/main/scala/actor/Supervisor.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/scaladocs-akka-amqp/AMQP.scala.html" afterPath="$PROJECT_DIR$/docs/scaladocs-akka-amqp/AMQP.scala.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-actors/src/main/scala/config/ActiveObjectGuiceConfigurator.scala" afterPath="$PROJECT_DIR$/akka-actors/src/main/scala/config/ActiveObjectGuiceConfigurator.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-actors/src/test/scala/SchedulerTest.scala" afterPath="$PROJECT_DIR$/akka-actors/src/test/scala/SchedulerTest.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/scaladocs-akka-security/se/scalablesolutions/akka/security/DigestAuthenticationActor.html" afterPath="$PROJECT_DIR$/docs/scaladocs-akka-security/se/scalablesolutions/akka/security/DigestAuthenticationActor.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-actors/src/main/scala/actor/Scheduler.scala" afterPath="$PROJECT_DIR$/akka-actors/src/main/scala/actor/Scheduler.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/scaladocs-akka-security/se/scalablesolutions/akka/security/SpnegoAuthenticationActor.html" afterPath="$PROJECT_DIR$/docs/scaladocs-akka-security/se/scalablesolutions/akka/security/SpnegoAuthenticationActor.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-samples-lift/src/main/scala/akka/SimpleService.scala" afterPath="$PROJECT_DIR$/akka-samples-lift/src/main/scala/akka/SimpleService.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/scaladocs-akka-actors/se/scalablesolutions/akka/actor/Supervisor.html" afterPath="$PROJECT_DIR$/docs/scaladocs-akka-actors/se/scalablesolutions/akka/actor/Supervisor.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-samples-scala/src/main/scala/SimpleService.scala" afterPath="$PROJECT_DIR$/akka-samples-scala/src/main/scala/SimpleService.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-actors/src/test/scala/RemoteActorTest.scala" afterPath="$PROJECT_DIR$/akka-actors/src/test/scala/RemoteActorTest.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-actors/src/test/scala/EventBasedSingleThreadDispatcherTest.scala" afterPath="$PROJECT_DIR$/akka-actors/src/test/scala/EventBasedSingleThreadDispatcherTest.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/artifacts/akka_samples_lift_war_exploded.xml" afterPath="$PROJECT_DIR$/.idea/artifacts/akka_samples_lift_war_exploded.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-actors/src/main/scala/actor/ActiveObject.scala" afterPath="$PROJECT_DIR$/akka-actors/src/main/scala/actor/ActiveObject.scala" />
<change type="DELETED" beforePath="$PROJECT_DIR$/.idea/libraries/Maven__org_mortbay_jetty_jetty_util_6_1_22.xml" afterPath="" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/scaladocs-akka-actors/actor/Scheduler.scala.html" afterPath="$PROJECT_DIR$/docs/scaladocs-akka-actors/actor/Scheduler.scala.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-actors/src/test/scala/RemoteSupervisorTest.scala" afterPath="$PROJECT_DIR$/akka-actors/src/test/scala/RemoteSupervisorTest.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/scaladocs-akka-actors/se/scalablesolutions/akka/actor/ScheduleActor.html" afterPath="$PROJECT_DIR$/docs/scaladocs-akka-actors/se/scalablesolutions/akka/actor/ScheduleActor.html" />
<change type="DELETED" beforePath="$PROJECT_DIR$/.idea/libraries/Maven__com_google_protobuf_protobuf_java_2_1_0.xml" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/.idea/libraries/Maven__net_liftweb_lift_webkit_1_1_M6.xml" afterPath="" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/akka-persistence/src/test/scala/CassandraPersistentActorSpec.scala" afterPath="$PROJECT_DIR$/akka-persistence/src/test/scala/CassandraPersistentActorSpec.scala" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/scaladocs-akka-actors/actor/ActiveObject.scala.html" afterPath="$PROJECT_DIR$/docs/scaladocs-akka-actors/actor/ActiveObject.scala.html" />
</list> </list>
<ignored path=".idea/workspace.xml" /> <ignored path=".idea/workspace.xml" />
<ignored path="akka.iws" /> <ignored path="akka.iws" />
@ -62,91 +112,91 @@
<component name="FileColors" enabled="true" enabledForTabs="true" /> <component name="FileColors" enabled="true" enabledForTabs="true" />
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf> <leaf>
<file leaf-file-name="Actor.scala" pinned="false" current="false" current-in-tab="false"> <file leaf-file-name="Supervisor.scala" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/akka-actors/src/main/scala/actor/Actor.scala"> <entry file="file://$PROJECT_DIR$/akka-actors/src/main/scala/actor/Supervisor.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="2" column="28" selection-start="49" selection-end="49" vertical-scroll-proportion="0.0"> <state line="10" column="0" selection-start="319" selection-end="319" vertical-scroll-proportion="-5.8461537">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="RemoteProtocol.proto" pinned="false" current="false" current-in-tab="false"> <file leaf-file-name="SimpleService.scala" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/akka-util-java/src/main/java/se/scalablesolutions/akka/nio/protobuf/RemoteProtocol.proto"> <entry file="file://$PROJECT_DIR$/akka-samples-security/src/main/scala/SimpleService.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="9" column="81" selection-start="158" selection-end="237" vertical-scroll-proportion="0.0"> <state line="33" column="0" selection-start="1036" selection-end="1036" vertical-scroll-proportion="-1.5">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="RemoteProtocol.java" pinned="false" current="false" current-in-tab="false"> <file leaf-file-name="SimpleService.scala" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/akka-util-java/src/main/java/se/scalablesolutions/akka/nio/protobuf/RemoteProtocol.java"> <entry file="file://$PROJECT_DIR$/akka-samples-scala/src/main/scala/SimpleService.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="4" column="2" selection-start="112" selection-end="112" vertical-scroll-proportion="0.0"> <state line="33" column="0" selection-start="989" selection-end="989" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="pom.xml" pinned="false" current="true" current-in-tab="true"> <file leaf-file-name="SimpleService.scala" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/akka-util-java/pom.xml"> <entry file="file://$PROJECT_DIR$/akka-samples-lift/src/main/scala/akka/SimpleService.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="25" column="18" selection-start="838" selection-end="838" vertical-scroll-proportion="0.6445047"> <state line="19" column="6" selection-start="622" selection-end="622" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="ProtobufProtocol.proto" pinned="false" current="false" current-in-tab="false"> <file leaf-file-name="Boot.scala" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ProtobufProtocol.proto"> <entry file="file://$PROJECT_DIR$/akka-samples-lift/src/main/scala/bootstrap/liftweb/Boot.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="9" column="74" selection-start="147" selection-end="219" vertical-scroll-proportion="0.0"> <state line="38" column="35" selection-start="1081" selection-end="1112" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="pom.xml" pinned="false" current="false" current-in-tab="false"> <file leaf-file-name="ActiveObject.scala" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/pom.xml"> <entry file="file://$PROJECT_DIR$/akka-actors/src/main/scala/actor/ActiveObject.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="432" column="0" selection-start="13356" selection-end="13356" vertical-scroll-proportion="0.0"> <state line="128" column="9" selection-start="6068" selection-end="6068" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="pom.xml" pinned="false" current="false" current-in-tab="false"> <file leaf-file-name="SupervisorTest.scala" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/akka-fun-test-java/pom.xml"> <entry file="file://$PROJECT_DIR$/akka-actors/src/test/scala/SupervisorTest.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="18" column="106" selection-start="590" selection-end="590" vertical-scroll-proportion="0.0"> <state line="23" column="33" selection-start="527" selection-end="527" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="ProtobufProtocol.java" pinned="false" current="false" current-in-tab="false"> <file leaf-file-name="Security.scala" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ProtobufProtocol.java"> <entry file="file://$PROJECT_DIR$/akka-security/src/main/scala/Security.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="14" column="49" selection-start="562" selection-end="580" vertical-scroll-proportion="0.0"> <state line="287" column="22" selection-start="10447" selection-end="10447" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="pom.xml" pinned="false" current="false" current-in-tab="false"> <file leaf-file-name="InMemNestedStateTest.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/akka-actors/pom.xml"> <entry file="file://$PROJECT_DIR$/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemNestedStateTest.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="88" column="31" selection-start="2735" selection-end="2748" vertical-scroll-proportion="0.0"> <state line="36" column="0" selection-start="1434" selection-end="1434" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="pom.xml" pinned="false" current="false" current-in-tab="false"> <file leaf-file-name="InMemoryStateTest.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/akka-kernel/pom.xml"> <entry file="file://$PROJECT_DIR$/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="131" column="18" selection-start="4034" selection-end="4034" vertical-scroll-proportion="0.0"> <state line="22" column="17" selection-start="604" selection-end="604" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
@ -162,19 +212,22 @@
<component name="IdeDocumentHistory"> <component name="IdeDocumentHistory">
<option name="changedFiles"> <option name="changedFiles">
<list> <list>
<option value="$PROJECT_DIR$/akka-actors/src/main/scala/actor/Scheduler.scala" />
<option value="$PROJECT_DIR$/akka-actors/src/main/scala/actor/Supervisor.scala" />
<option value="$PROJECT_DIR$/akka-amqp/src/main/scala/AMQP.scala" />
<option value="$PROJECT_DIR$/akka-security/src/test/scala/SecuritySpec.scala" />
<option value="$PROJECT_DIR$/akka-security/src/main/scala/Security.scala" />
<option value="$PROJECT_DIR$/akka-actors/src/main/scala/nio/RemoteServer.scala" />
<option value="$PROJECT_DIR$/akka-actors/src/main/scala/actor/Actor.scala" />
<option value="$PROJECT_DIR$/akka-actors/pom.xml" />
<option value="$PROJECT_DIR$/akka-util-java/src/main/java/se/scalablesolutions/akka/nio/protobuf/RemoteProtocol.java" />
<option value="$PROJECT_DIR$/akka-util-java/pom.xml" />
<option value="$PROJECT_DIR$/akka-fun-test-java/pom.xml" />
<option value="$PROJECT_DIR$/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ProtobufProtocol.proto" /> <option value="$PROJECT_DIR$/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ProtobufProtocol.proto" />
<option value="$PROJECT_DIR$/akka-kernel/pom.xml" /> <option value="$PROJECT_DIR$/akka-kernel/pom.xml" />
<option value="$PROJECT_DIR$/akka-actors/src/main/scala/dispatch/ThreadBasedDispatcher.scala" />
<option value="$PROJECT_DIR$/akka-actors/src/main/scala/config/ActiveObjectGuiceConfigurator.scala" />
<option value="$PROJECT_DIR$/akka-amqp/src/main/scala/AMQP.scala" />
<option value="$PROJECT_DIR$/akka-actors/src/main/scala/actor/Actor.scala" />
<option value="$PROJECT_DIR$/akka-actors/src/test/scala/RemoteSupervisorTest.scala" />
<option value="$PROJECT_DIR$/akka-actors/src/test/scala/SupervisorTest.scala" />
<option value="$PROJECT_DIR$/akka-security/src/main/scala/Security.scala" />
<option value="$PROJECT_DIR$/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemNestedStateTest.java" />
<option value="$PROJECT_DIR$/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java" />
<option value="$PROJECT_DIR$/akka-samples-scala/src/main/scala/SimpleService.scala" />
<option value="$PROJECT_DIR$/akka-samples-lift/src/main/scala/bootstrap/liftweb/Boot.scala" />
<option value="$PROJECT_DIR$/akka-actors/src/main/scala/actor/ActiveObject.scala" />
<option value="$PROJECT_DIR$/akka-actors/src/main/scala/actor/Supervisor.scala" />
<option value="$PROJECT_DIR$/akka-samples-security/src/main/scala/SimpleService.scala" />
</list> </list>
</option> </option>
</component> </component>
@ -372,7 +425,8 @@
<window_info id="IDEtalk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="IDEtalk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Web" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> <window_info id="Web" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.19480519" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.19480519" sideWeight="0.6619898" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32908162" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
<window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
@ -384,7 +438,6 @@
<window_info id="IDEtalk Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="IDEtalk Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
@ -419,114 +472,116 @@
<breakpoint-manager /> <breakpoint-manager />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/akka-security/src/main/scala/Security.scala">
<provider selected="true" editor-type-id="text-editor">
<state line="38" column="3" selection-start="1677" selection-end="1677" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/akka-security/src/test/scala/SecuritySpec.scala">
<provider selected="true" editor-type-id="text-editor">
<state line="65" column="45" selection-start="2449" selection-end="2449" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/akka-actors/src/main/scala/dispatch/Reactor.scala"> <entry file="file://$PROJECT_DIR$/akka-actors/src/main/scala/dispatch/Reactor.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="28" column="6" selection-start="656" selection-end="656" vertical-scroll-proportion="0.0"> <state line="47" column="6" selection-start="1262" selection-end="1262" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/jboss/netty/netty/3.1.0.GA/netty-3.1.0.GA-sources.jar!/org/jboss/netty/handler/codec/protobuf/ProtobufDecoder.java"> <entry file="file://$PROJECT_DIR$/akka-actors/src/main/scala/dispatch/ThreadBasedDispatcher.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0"> <state line="26" column="43" selection-start="805" selection-end="805" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/akka-actors/src/main/scala/nio/RemoteClient.scala"> <entry file="file://$PROJECT_DIR$/akka-actors/src/main/scala/config/ActiveObjectGuiceConfigurator.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="75" column="32" selection-start="2858" selection-end="2858" vertical-scroll-proportion="0.0"> <state line="135" column="24" selection-start="6215" selection-end="6215" vertical-scroll-proportion="-25.307692">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="jar://$MAVEN_REPOSITORY$/org/jboss/netty/netty/3.1.0.GA/netty-3.1.0.GA-sources.jar!/org/jboss/netty/bootstrap/ClientBootstrap.java"> <entry file="file://$PROJECT_DIR$/akka-amqp/src/main/scala/AMQP.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="193" column="25" selection-start="7649" selection-end="7649" vertical-scroll-proportion="0.0"> <state line="403" column="33" selection-start="15312" selection-end="15312" vertical-scroll-proportion="-25.307692">
<folding /> <folding>
<marker date="1258661369000" expanded="true" signature="560:1397" placeholder="/**...*/" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/akka-actors/src/main/scala/actor/Actor.scala"> <entry file="file://$PROJECT_DIR$/akka-actors/src/main/scala/actor/Actor.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="2" column="28" selection-start="49" selection-end="49" vertical-scroll-proportion="0.0"> <state line="223" column="51" selection-start="8202" selection-end="8202" vertical-scroll-proportion="-17.538462">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/akka-util-java/src/main/java/se/scalablesolutions/akka/nio/protobuf/RemoteProtocol.proto"> <entry file="file://$PROJECT_DIR$/akka-actors/src/test/scala/RemoteSupervisorTest.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="9" column="81" selection-start="158" selection-end="237" vertical-scroll-proportion="0.0"> <state line="566" column="0" selection-start="14183" selection-end="14183" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/akka-util-java/src/main/java/se/scalablesolutions/akka/nio/protobuf/RemoteProtocol.java"> <entry file="file://$PROJECT_DIR$/akka-actors/src/test/scala/SupervisorTest.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="4" column="2" selection-start="112" selection-end="112" vertical-scroll-proportion="0.0"> <state line="23" column="33" selection-start="527" selection-end="527" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ProtobufProtocol.java"> <entry file="file://$PROJECT_DIR$/akka-security/src/main/scala/Security.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="14" column="49" selection-start="562" selection-end="580" vertical-scroll-proportion="0.0"> <state line="287" column="22" selection-start="10447" selection-end="10447" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/ProtobufProtocol.proto"> <entry file="file://$PROJECT_DIR$/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemNestedStateTest.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="9" column="74" selection-start="147" selection-end="219" vertical-scroll-proportion="0.0"> <state line="36" column="0" selection-start="1434" selection-end="1434" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/pom.xml"> <entry file="file://$PROJECT_DIR$/akka-fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="432" column="0" selection-start="13356" selection-end="13356" vertical-scroll-proportion="0.0"> <state line="22" column="17" selection-start="604" selection-end="604" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/akka-actors/pom.xml"> <entry file="file://$PROJECT_DIR$/akka-samples-scala/src/main/scala/SimpleService.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="88" column="31" selection-start="2735" selection-end="2748" vertical-scroll-proportion="0.0"> <state line="33" column="0" selection-start="989" selection-end="989" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/akka-kernel/pom.xml"> <entry file="file://$PROJECT_DIR$/akka-samples-lift/src/main/scala/akka/SimpleService.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="131" column="18" selection-start="4034" selection-end="4034" vertical-scroll-proportion="0.0"> <state line="19" column="6" selection-start="622" selection-end="622" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/akka-fun-test-java/pom.xml"> <entry file="file://$PROJECT_DIR$/akka-samples-lift/src/main/scala/bootstrap/liftweb/Boot.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="18" column="106" selection-start="590" selection-end="590" vertical-scroll-proportion="0.0"> <state line="38" column="35" selection-start="1081" selection-end="1112" vertical-scroll-proportion="0.0">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/akka-util-java/pom.xml"> <entry file="file://$PROJECT_DIR$/akka-actors/src/main/scala/actor/ActiveObject.scala">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="25" column="18" selection-start="838" selection-end="838" vertical-scroll-proportion="0.6445047"> <state line="128" column="9" selection-start="6068" selection-end="6068" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/akka-actors/src/main/scala/actor/Supervisor.scala">
<provider selected="true" editor-type-id="text-editor">
<state line="10" column="0" selection-start="319" selection-end="319" vertical-scroll-proportion="-5.8461537">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/akka-samples-security/src/main/scala/SimpleService.scala">
<provider selected="true" editor-type-id="text-editor">
<state line="33" column="0" selection-start="1036" selection-end="1036" vertical-scroll-proportion="-1.5">
<folding /> <folding />
</state> </state>
</provider> </provider>

View file

@ -127,11 +127,9 @@ object ActiveObject {
private[akka] def supervise(restartStrategy: RestartStrategy, components: List[Supervise]): Supervisor = { private[akka] def supervise(restartStrategy: RestartStrategy, components: List[Supervise]): Supervisor = {
object factory extends SupervisorFactory { val factory = SupervisorFactory(SupervisorConfig(restartStrategy, components))
override def getSupervisorConfig = SupervisorConfig(restartStrategy, components) val supervisor = factory.newInstance
} supervisor.start
val supervisor = factory.newSupervisor
supervisor ! StartSupervisor
supervisor supervisor
} }
} }
@ -325,7 +323,7 @@ private[akka] class Dispatcher(val callbacks: Option[RestartCallbacks]) extends
//if (initTxState.isDefined) initTxState.get.setAccessible(true) //if (initTxState.isDefined) initTxState.get.setAccessible(true)
} }
override def receive: PartialFunction[Any, Unit] = { def receive: PartialFunction[Any, Unit] = {
case Invocation(joinPoint, isOneWay, _) => case Invocation(joinPoint, isOneWay, _) =>
if (Actor.SERIALIZE_MESSAGES) serializeArguments(joinPoint) if (Actor.SERIALIZE_MESSAGES) serializeArguments(joinPoint)
if (isOneWay) joinPoint.proceed if (isOneWay) joinPoint.proceed

View file

@ -70,6 +70,13 @@ object Actor {
/** /**
* Actor base trait that should be extended by or mixed to create an Actor with the semantics of the 'Actor Model': * Actor base trait that should be extended by or mixed to create an Actor with the semantics of the 'Actor Model':
* <a href="http://en.wikipedia.org/wiki/Actor_model">http://en.wikipedia.org/wiki/Actor_model</a> * <a href="http://en.wikipedia.org/wiki/Actor_model">http://en.wikipedia.org/wiki/Actor_model</a>
* <p/>
* An actor has a well-defined (non-cyclic) life-cycle.
* <pre>
* => NEW (newly created actor) - can't receive messages (yet)
* => STARTED (when 'start' is invoked) - can receive messages
* => SHUT DOWN (when 'exit' is invoked) - can't do anything
* </pre>
* *
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a> * @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/ */
@ -81,6 +88,7 @@ trait Actor extends Logging with TransactionManagement {
// private fields // private fields
@volatile private var _isRunning: Boolean = false @volatile private var _isRunning: Boolean = false
@volatile private var _isShutDown: Boolean = false
private var _hotswap: Option[PartialFunction[Any, Unit]] = None private var _hotswap: Option[PartialFunction[Any, Unit]] = None
private var _config: Option[AnyRef] = None private var _config: Option[AnyRef] = None
private val _remoteFlagLock = new ReadWriteLock private val _remoteFlagLock = new ReadWriteLock
@ -144,7 +152,6 @@ trait Actor extends Logging with TransactionManagement {
protected[akka] var messageDispatcher: MessageDispatcher = { protected[akka] var messageDispatcher: MessageDispatcher = {
val dispatcher = Dispatchers.newEventBasedThreadPoolDispatcher(getClass.getName) val dispatcher = Dispatchers.newEventBasedThreadPoolDispatcher(getClass.getName)
_mailbox = dispatcher.messageQueue _mailbox = dispatcher.messageQueue
dispatcher.registerHandler(this, new ActorMessageInvoker(this))
dispatcher dispatcher
} }
@ -201,7 +208,7 @@ trait Actor extends Logging with TransactionManagement {
* <p/> * <p/>
* Example code: * Example code:
* <pre> * <pre>
* def receive: PartialFunction[Any, Unit] = { * def receive = {
* case Ping => * case Ping =>
* println("got a ping") * println("got a ping")
* reply("pong") * reply("pong")
@ -264,7 +271,9 @@ trait Actor extends Logging with TransactionManagement {
* Starts up the actor and its message queue. * Starts up the actor and its message queue.
*/ */
def start = synchronized { def start = synchronized {
if (_isShutDown) throw new IllegalStateException("Can't restart an actor that have been shut down with 'exit'")
if (!_isRunning) { if (!_isRunning) {
dispatcher.registerHandler(this, new ActorMessageInvoker(this))
messageDispatcher.start messageDispatcher.start
_isRunning = true _isRunning = true
//if (isTransactional) this !! TransactionalInit //if (isTransactional) this !! TransactionalInit
@ -273,14 +282,15 @@ trait Actor extends Logging with TransactionManagement {
} }
/** /**
* Stops the actor and its message queue. * Shuts down the actor its dispatcher and message queue.
*/ */
def stop = synchronized { def exit = synchronized {
if (_isRunning) { if (_isRunning) {
dispatcher.unregisterHandler(this) messageDispatcher.unregisterHandler(this)
if (dispatcher.isInstanceOf[ThreadBasedDispatcher]) dispatcher.shutdown if (messageDispatcher.isInstanceOf[ThreadBasedDispatcher]) messageDispatcher.shutdown
// FIXME: Need to do reference count to know if EventBasedThreadPoolDispatcher and EventBasedSingleThreadDispatcher can be shut down // FIXME: Need to do reference count to know if EventBasedThreadPoolDispatcher and EventBasedSingleThreadDispatcher can be shut down
_isRunning = false _isRunning = false
_isShutDown = true
shutdown shutdown
} }
} }
@ -356,7 +366,10 @@ trait Actor extends Logging with TransactionManagement {
case Some(future) => future.completeWithResult(message) case Some(future) => future.completeWithResult(message)
} }
def dispatcher = messageDispatcher /**
* Get the dispatcher for this actor.
*/
def dispatcher = synchronized { messageDispatcher }
/** /**
* Sets the dispatcher for this actor. Needs to be invoked before the actor is started. * Sets the dispatcher for this actor. Needs to be invoked before the actor is started.

View file

@ -30,11 +30,11 @@ case class SchedulerException(msg: String, e: Throwable) extends RuntimeExceptio
class ScheduleActor(val receiver: Actor, val future: ScheduledFuture[AnyRef]) extends Actor with Logging { class ScheduleActor(val receiver: Actor, val future: ScheduledFuture[AnyRef]) extends Actor with Logging {
lifeCycle = Some(LifeCycle(Permanent)) lifeCycle = Some(LifeCycle(Permanent))
def receive: PartialFunction[Any, Unit] = { def receive = {
case UnSchedule => case UnSchedule =>
Scheduler.stopSupervising(this) Scheduler.stopSupervising(this)
future.cancel(true) future.cancel(true)
stop exit
} }
} }
@ -69,7 +69,7 @@ object Scheduler extends Actor {
service.shutdown service.shutdown
} }
def receive: PartialFunction[Any, Unit] = { def receive = {
case _ => {} // ignore all messages case _ => {} // ignore all messages
} }
} }

View file

@ -8,12 +8,9 @@ import se.scalablesolutions.akka.config.ScalaConfig._
import se.scalablesolutions.akka.config.{ConfiguratorRepository, Configurator} import se.scalablesolutions.akka.config.{ConfiguratorRepository, Configurator}
import se.scalablesolutions.akka.util.Helpers._ import se.scalablesolutions.akka.util.Helpers._
import se.scalablesolutions.akka.util.Logging import se.scalablesolutions.akka.util.Logging
import se.scalablesolutions.akka.dispatch.Dispatchers
import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.ConcurrentHashMap
import scala.collection.mutable.HashMap
/** /**
* Messages that the supervisor responds to and returns. * Messages that the supervisor responds to and returns.
* *
@ -34,42 +31,32 @@ case class OneForOneStrategy(maxNrOfRetries: Int, withinTimeRange: Int) extends
* <p> * <p>
* Example usage: * Example usage:
* <pre> * <pre>
* class MySupervisorFactory extends SupervisorFactory { * val factory = SupervisorFactory(
* * SupervisorConfig(
* override protected def getSupervisorConfig: SupervisorConfig = { * RestartStrategy(OneForOne, 3, 10),
* SupervisorConfig( * Supervise(
* RestartStrategy(OneForOne, 3, 10), * myFirstActor,
* Supervise( * LifeCycle(Permanent)) ::
* myFirstActor, * Supervise(
* LifeCycle(Permanent)) * mySecondActor,
* :: * LifeCycle(Permanent)) ::
* Supervise( * Nil))
* mySecondActor,
* LifeCycle(Permanent))
* :: Nil)
* }
* }
* </pre>
*
* Then create a concrete factory in which we mix in support for the specific implementation of the Service we want to use.
*
* <pre>
* object factory extends MySupervisorFactory
* </pre> * </pre>
* *
* Then create a new Supervisor tree with the concrete Services we have defined. * Then create a new Supervisor tree with the concrete Services we have defined.
* *
* <pre> * <pre>
* val supervisor = factory.newSupervisor * val supervisor = factory.newInstance
* supervisor ! Start // start up all managed servers * supervisor.start // start up all managed servers
* </pre> * </pre>
* *
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a> * @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/ */
abstract class SupervisorFactory extends Logging { class SupervisorFactory(val config: SupervisorConfig) extends Logging {
def newSupervisor: Supervisor = newSupervisorFor(getSupervisorConfig)
def newSupervisorFor(config: SupervisorConfig): Supervisor = config match { def newInstance: Supervisor = newInstanceFor(config)
def newInstanceFor(config: SupervisorConfig): Supervisor = config match {
case SupervisorConfig(restartStrategy, _) => case SupervisorConfig(restartStrategy, _) =>
val supervisor = create(restartStrategy) val supervisor = create(restartStrategy)
supervisor.start supervisor.start
@ -77,12 +64,6 @@ abstract class SupervisorFactory extends Logging {
supervisor supervisor
} }
/**
* To be overridden by concrete factory.
* Should return the SupervisorConfig for the supervisor.
*/
protected def getSupervisorConfig: SupervisorConfig
protected def create(strategy: RestartStrategy): Supervisor = strategy match { protected def create(strategy: RestartStrategy): Supervisor = strategy match {
case RestartStrategy(scheme, maxNrOfRetries, timeRange) => case RestartStrategy(scheme, maxNrOfRetries, timeRange) =>
scheme match { scheme match {
@ -92,18 +73,24 @@ abstract class SupervisorFactory extends Logging {
} }
} }
object SupervisorFactory {
def apply(config: SupervisorConfig) = new SupervisorFactory(config)
}
/** /**
* <b>NOTE:</b> * <b>NOTE:</b>
* <p/> * <p/>
* The supervisor class is only used for the configuration system when configuring supervisor hierarchies declaratively. * The supervisor class is only used for the configuration system when configuring supervisor
* Should not be used in development. Instead wire the actors together using 'link', 'spawnLink' etc. and set the 'trapExit' * hierarchies declaratively. Should not be used as part of the regular programming API. Instead
* flag in the actors that should trap error signals and trigger restart. * wire the actors together using 'link', 'spawnLink' etc. and set the 'trapExit' flag in the
* actors that should trap error signals and trigger restart.
* <p/> * <p/>
* See the ScalaDoc for the SupervisorFactory for an example on how to declaratively wire up actors. * See the ScalaDoc for the SupervisorFactory for an example on how to declaratively wire up actors.
* *
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a> * @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/ */
class Supervisor private[akka] (handler: FaultHandlingStrategy) extends Actor with Logging with Configurator { sealed class Supervisor private[akka] (handler: FaultHandlingStrategy)
extends Actor with Logging with Configurator {
trapExit = List(classOf[Throwable]) trapExit = List(classOf[Throwable])
faultHandler = Some(handler) faultHandler = Some(handler)
//dispatcher = Dispatchers.newThreadBasedDispatcher(this) //dispatcher = Dispatchers.newThreadBasedDispatcher(this)
@ -116,23 +103,29 @@ class Supervisor private[akka] (handler: FaultHandlingStrategy) extends Actor wi
def isDefined(clazz: Class[_]): Boolean = actors.containsKey(clazz.getName) def isDefined(clazz: Class[_]): Boolean = actors.containsKey(clazz.getName)
def startSupervisor = { override def start = {
ConfiguratorRepository.registerConfigurator(this) ConfiguratorRepository.registerConfigurator(this)
actors.values.toArray.toList.foreach(println) actors.values.toArray.toList.foreach(println)
start super[Actor].start
this ! StartSupervisor this ! StartSupervisor
} }
def stopSupervisor = this ! StopSupervisor def stop = this !? StopSupervisor
protected def receive: PartialFunction[Any, Unit] = { protected def receive = {
case StartSupervisor => case StartSupervisor =>
_linkedActors.toArray.toList.asInstanceOf[List[Actor]].foreach { actor => actor.start; log.info("Starting actor: %s", actor) } _linkedActors.toArray.toList.asInstanceOf[List[Actor]].foreach { actor =>
actor.start
log.info("Starting actor: %s", actor)
}
case StopSupervisor => case StopSupervisor =>
_linkedActors.toArray.toList.asInstanceOf[List[Actor]].foreach { actor => actor.stop; log.info("Stopping actor: %s", actor) } _linkedActors.toArray.toList.asInstanceOf[List[Actor]].foreach { actor =>
actor.exit
log.info("Shutting actor down: %s", actor)
}
log.info("Stopping supervisor: %s", this) log.info("Stopping supervisor: %s", this)
stop exit
} }
def configure(config: SupervisorConfig, factory: SupervisorFactory) = config match { def configure(config: SupervisorConfig, factory: SupervisorFactory) = config match {
@ -145,7 +138,7 @@ class Supervisor private[akka] (handler: FaultHandlingStrategy) extends Actor wi
startLink(actor) startLink(actor)
case SupervisorConfig(_, _) => // recursive configuration case SupervisorConfig(_, _) => // recursive configuration
val supervisor = factory.newSupervisorFor(server.asInstanceOf[SupervisorConfig]) val supervisor = factory.newInstanceFor(server.asInstanceOf[SupervisorConfig])
supervisor ! StartSupervisor supervisor ! StartSupervisor
// FIXME what to do with recursively supervisors? // FIXME what to do with recursively supervisors?
}) })

View file

@ -133,7 +133,7 @@ private[akka] class ActiveObjectGuiceConfigurator extends ActiveObjectConfigurat
supervisor = Some(ActiveObject.supervise(restartStrategy, supervised)) supervisor = Some(ActiveObject.supervise(restartStrategy, supervised))
//camelContext.addComponent(AKKA_CAMEL_ROUTING_SCHEME, new ActiveObjectComponent(this)) //camelContext.addComponent(AKKA_CAMEL_ROUTING_SCHEME, new ActiveObjectComponent(this))
//camelContext.start //camelContext.start
supervisor.get.startSupervisor supervisor.get.start
ConfiguratorRepository.registerConfigurator(this) ConfiguratorRepository.registerConfigurator(this)
this this
} }

View file

@ -13,7 +13,7 @@ class EventBasedSingleThreadActorTest extends JUnitSuite {
class TestActor extends Actor { class TestActor extends Actor {
dispatcher = Dispatchers.newEventBasedSingleThreadDispatcher(uuid) dispatcher = Dispatchers.newEventBasedSingleThreadDispatcher(uuid)
def receive: PartialFunction[Any, Unit] = { def receive = {
case "Hello" => case "Hello" =>
reply("World") reply("World")
case "Failure" => case "Failure" =>
@ -25,7 +25,7 @@ class EventBasedSingleThreadActorTest extends JUnitSuite {
implicit val timeout = 5000L implicit val timeout = 5000L
var oneWay = "nada" var oneWay = "nada"
val actor = new Actor { val actor = new Actor {
def receive: PartialFunction[Any, Unit] = { def receive = {
case "OneWay" => oneWay = "received" case "OneWay" => oneWay = "received"
} }
} }
@ -33,7 +33,7 @@ class EventBasedSingleThreadActorTest extends JUnitSuite {
val result = actor ! "OneWay" val result = actor ! "OneWay"
Thread.sleep(100) Thread.sleep(100)
assert("received" === oneWay) assert("received" === oneWay)
actor.stop actor.exit
} }
@Test def shouldSendReplySync = { @Test def shouldSendReplySync = {
@ -42,7 +42,7 @@ class EventBasedSingleThreadActorTest extends JUnitSuite {
actor.start actor.start
val result: String = actor !? "Hello" val result: String = actor !? "Hello"
assert("World" === result) assert("World" === result)
actor.stop actor.exit
} }
@Test def shouldSendReplyAsync = { @Test def shouldSendReplyAsync = {
@ -51,7 +51,7 @@ class EventBasedSingleThreadActorTest extends JUnitSuite {
actor.start actor.start
val result = actor !! "Hello" val result = actor !! "Hello"
assert("World" === result.get.asInstanceOf[String]) assert("World" === result.get.asInstanceOf[String])
actor.stop actor.exit
} }
@Test def shouldSendReceiveException = { @Test def shouldSendReceiveException = {
@ -65,6 +65,6 @@ class EventBasedSingleThreadActorTest extends JUnitSuite {
case e => case e =>
assert("expected" === e.getMessage()) assert("expected" === e.getMessage())
} }
actor.stop actor.exit
} }
} }

View file

@ -50,9 +50,9 @@ class EventBasedSingleThreadDispatcherTest extends JUnitSuite {
internalTestMessagesDispatchedToHandlersAreExecutedInFIFOOrder internalTestMessagesDispatchedToHandlersAreExecutedInFIFOOrder
} }
val key1 = new Actor { def receive: PartialFunction[Any, Unit] = { case _ => {}} } val key1 = new Actor { def receive = { case _ => {}} }
val key2 = new Actor { def receive: PartialFunction[Any, Unit] = { case _ => {}} } val key2 = new Actor { def receive = { case _ => {}} }
val key3 = new Actor { def receive: PartialFunction[Any, Unit] = { case _ => {}} } val key3 = new Actor { def receive = { case _ => {}} }
private def internalTestMessagesDispatchedToTheSameHandlerAreExecutedSequentially: Unit = { private def internalTestMessagesDispatchedToTheSameHandlerAreExecutedSequentially: Unit = {
val guardLock = new ReentrantLock val guardLock = new ReentrantLock

View file

@ -9,7 +9,7 @@ class EventBasedThreadPoolActorTest extends JUnitSuite {
private val unit = TimeUnit.MILLISECONDS private val unit = TimeUnit.MILLISECONDS
class TestActor extends Actor { class TestActor extends Actor {
def receive: PartialFunction[Any, Unit] = { def receive = {
case "Hello" => case "Hello" =>
reply("World") reply("World")
case "Failure" => case "Failure" =>
@ -21,7 +21,7 @@ class EventBasedThreadPoolActorTest extends JUnitSuite {
implicit val timeout = 5000L implicit val timeout = 5000L
var oneWay = "nada" var oneWay = "nada"
val actor = new Actor { val actor = new Actor {
def receive: PartialFunction[Any, Unit] = { def receive = {
case "OneWay" => oneWay = "received" case "OneWay" => oneWay = "received"
} }
} }
@ -29,7 +29,7 @@ class EventBasedThreadPoolActorTest extends JUnitSuite {
val result = actor ! "OneWay" val result = actor ! "OneWay"
Thread.sleep(100) Thread.sleep(100)
assert("received" === oneWay) assert("received" === oneWay)
actor.stop actor.exit
} }
@Test def shouldSendReplySync = { @Test def shouldSendReplySync = {
@ -38,7 +38,7 @@ class EventBasedThreadPoolActorTest extends JUnitSuite {
actor.start actor.start
val result: String = actor !? "Hello" val result: String = actor !? "Hello"
assert("World" === result) assert("World" === result)
actor.stop actor.exit
} }
@Test def shouldSendReplyAsync = { @Test def shouldSendReplyAsync = {
@ -47,7 +47,7 @@ class EventBasedThreadPoolActorTest extends JUnitSuite {
actor.start actor.start
val result = actor !! "Hello" val result = actor !! "Hello"
assert("World" === result.get.asInstanceOf[String]) assert("World" === result.get.asInstanceOf[String])
actor.stop actor.exit
} }
@Test def shouldSendReceiveException = { @Test def shouldSendReceiveException = {
@ -61,6 +61,6 @@ class EventBasedThreadPoolActorTest extends JUnitSuite {
case e => case e =>
assert("expected" === e.getMessage()) assert("expected" === e.getMessage())
} }
actor.stop actor.exit
} }
} }

View file

@ -13,9 +13,9 @@ import se.scalablesolutions.akka.actor.Actor
class EventBasedThreadPoolDispatcherTest extends JUnitSuite { class EventBasedThreadPoolDispatcherTest extends JUnitSuite {
private var threadingIssueDetected: AtomicBoolean = null private var threadingIssueDetected: AtomicBoolean = null
val key1 = new Actor { def receive: PartialFunction[Any, Unit] = { case _ => {}} } val key1 = new Actor { def receive = { case _ => {}} }
val key2 = new Actor { def receive: PartialFunction[Any, Unit] = { case _ => {}} } val key2 = new Actor { def receive = { case _ => {}} }
val key3 = new Actor { def receive: PartialFunction[Any, Unit] = { case _ => {}} } val key3 = new Actor { def receive = { case _ => {}} }
@Before @Before
def setUp = { def setUp = {

View file

@ -30,7 +30,7 @@ class InMemStatefulActor extends Actor {
private lazy val vectorState = TransactionalState.newVector[String] private lazy val vectorState = TransactionalState.newVector[String]
private lazy val refState = TransactionalState.newRef[String] private lazy val refState = TransactionalState.newRef[String]
def receive: PartialFunction[Any, Unit] = { def receive = {
case GetMapState(key) => case GetMapState(key) =>
reply(mapState.get(key).get) reply(mapState.get(key).get)
case GetVectorSize => case GetVectorSize =>
@ -79,7 +79,7 @@ class InMemStatefulActor extends Actor {
@serializable @serializable
class InMemFailerActor extends Actor { class InMemFailerActor extends Actor {
makeTransactionRequired makeTransactionRequired
def receive: PartialFunction[Any, Unit] = { def receive = {
case "Failure" => case "Failure" =>
throw new RuntimeException("expected") throw new RuntimeException("expected")
} }

View file

@ -11,14 +11,14 @@ object Global {
var oneWay = "nada" var oneWay = "nada"
} }
class RemoteActorSpecActorUnidirectional extends Actor { class RemoteActorSpecActorUnidirectional extends Actor {
def receive: PartialFunction[Any, Unit] = { def receive = {
case "OneWay" => case "OneWay" =>
Global.oneWay = "received" Global.oneWay = "received"
} }
} }
class RemoteActorSpecActorBidirectional extends Actor { class RemoteActorSpecActorBidirectional extends Actor {
def receive: PartialFunction[Any, Unit] = { def receive = {
case "Hello" => case "Hello" =>
reply("World") reply("World")
case "Failure" => case "Failure" =>
@ -46,7 +46,7 @@ class RemoteActorTest extends JUnitSuite {
val result = actor ! "OneWay" val result = actor ! "OneWay"
Thread.sleep(100) Thread.sleep(100)
assert("received" === Global.oneWay) assert("received" === Global.oneWay)
actor.stop actor.exit
} }
@Test @Test
@ -57,7 +57,7 @@ class RemoteActorTest extends JUnitSuite {
actor.start actor.start
val result: String = actor !? "Hello" val result: String = actor !? "Hello"
assert("World" === result) assert("World" === result)
actor.stop actor.exit
} }
@Test @Test
@ -68,7 +68,7 @@ class RemoteActorTest extends JUnitSuite {
actor.start actor.start
val result = actor !! "Hello" val result = actor !! "Hello"
assert("World" === result.get.asInstanceOf[String]) assert("World" === result.get.asInstanceOf[String])
actor.stop actor.exit
} }
@Test @Test
@ -84,6 +84,6 @@ class RemoteActorTest extends JUnitSuite {
case e => case e =>
assert("expected" === e.getMessage()) assert("expected" === e.getMessage())
} }
actor.stop actor.exit
} }
} }

View file

@ -15,16 +15,16 @@ object Log {
var messageLog: String = "" var messageLog: String = ""
var oneWayLog: String = "" var oneWayLog: String = ""
} }
/** /**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a> * @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/ */
class RemoteSupervisorTest extends JUnitSuite { class RemoteSupervisorTest extends JUnitSuite {
akka.Config.config akka.Config.config
new Thread(new Runnable() { new Thread(new Runnable() {
def run = { def run = {
RemoteServer.start RemoteServer.start
} }
}).start }).start
Thread.sleep(1000) Thread.sleep(1000)
@ -279,164 +279,164 @@ class RemoteSupervisorTest extends JUnitSuite {
*/ */
/* /*
@Test def shouldOneWayKillSingleActorAllForOne = { @Test def shouldOneWayKillSingleActorAllForOne = {
Logg.messageLog = "" Logg.messageLog = ""
val sup = getSingleActorAllForOneSupervisor val sup = getSingleActorAllForOneSupervisor
sup ! StartSupervisor sup ! StartSupervisor
Thread.sleep(500) Thread.sleep(500)
intercept[RuntimeException] { intercept[RuntimeException] {
pingpong1 ! BinaryString("Die") pingpong1 ! BinaryString("Die")
} }
Thread.sleep(500) Thread.sleep(500)
expect("DIE") { expect("DIE") {
Logg.messageLog Logg.messageLog
} }
} }
@Test def shouldOneWayCallKillCallSingleActorAllForOne = { @Test def shouldOneWayCallKillCallSingleActorAllForOne = {
Logg.messageLog = "" Logg.messageLog = ""
val sup = getSingleActorAllForOneSupervisor val sup = getSingleActorAllForOneSupervisor
sup ! StartSupervisor sup ! StartSupervisor
Thread.sleep(500) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong1 ! BinaryString("Ping")).getOrElse("nil") (pingpong1 ! BinaryString("Ping")).getOrElse("nil")
} }
Thread.sleep(500) Thread.sleep(500)
expect("ping") { expect("ping") {
Logg.messageLog Logg.messageLog
} }
intercept[RuntimeException] { intercept[RuntimeException] {
pingpong1 ! BinaryString("Die") pingpong1 ! BinaryString("Die")
} }
Thread.sleep(500) Thread.sleep(500)
expect("pingDIE") { expect("pingDIE") {
Logg.messageLog Logg.messageLog
} }
expect("pong") { expect("pong") {
(pingpong1 ! BinaryString("Ping")).getOrElse("nil") (pingpong1 ! BinaryString("Ping")).getOrElse("nil")
} }
Thread.sleep(500) Thread.sleep(500)
expect("pingDIEping") { expect("pingDIEping") {
Logg.messageLog Logg.messageLog
} }
} }
@Test def shouldOneWayKillMultipleActorsOneForOne = { @Test def shouldOneWayKillMultipleActorsOneForOne = {
Logg.messageLog = "" Logg.messageLog = ""
val sup = getMultipleActorsOneForOneConf val sup = getMultipleActorsOneForOneConf
sup ! StartSupervisor sup ! StartSupervisor
Thread.sleep(500) Thread.sleep(500)
intercept[RuntimeException] { intercept[RuntimeException] {
pingpong3 ! BinaryString("Die") pingpong3 ! BinaryString("Die")
} }
Thread.sleep(500) Thread.sleep(500)
expect("DIE") { expect("DIE") {
Logg.messageLog Logg.messageLog
} }
} }
def tesOneWayCallKillCallMultipleActorsOneForOne = { def tesOneWayCallKillCallMultipleActorsOneForOne = {
Logg.messageLog = "" Logg.messageLog = ""
val sup = getMultipleActorsOneForOneConf val sup = getMultipleActorsOneForOneConf
sup ! StartSupervisor sup ! StartSupervisor
Thread.sleep(500) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong1 ! BinaryString("Ping")).getOrElse("nil") (pingpong1 ! BinaryString("Ping")).getOrElse("nil")
} }
Thread.sleep(500) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong2 ! BinaryString("Ping")).getOrElse("nil") (pingpong2 ! BinaryString("Ping")).getOrElse("nil")
} }
Thread.sleep(500) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong3 ! BinaryString("Ping")).getOrElse("nil") (pingpong3 ! BinaryString("Ping")).getOrElse("nil")
} }
Thread.sleep(500) Thread.sleep(500)
expect("pingpingping") { expect("pingpingping") {
Logg.messageLog Logg.messageLog
} }
intercept[RuntimeException] { intercept[RuntimeException] {
pingpong2 ! BinaryString("Die") pingpong2 ! BinaryString("Die")
} }
Thread.sleep(500) Thread.sleep(500)
expect("pingpingpingDIE") { expect("pingpingpingDIE") {
Logg.messageLog Logg.messageLog
} }
expect("pong") { expect("pong") {
(pingpong1 ! BinaryString("Ping")).getOrElse("nil") (pingpong1 ! BinaryString("Ping")).getOrElse("nil")
} }
Thread.sleep(500) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong2 ! BinaryString("Ping")).getOrElse("nil") (pingpong2 ! BinaryString("Ping")).getOrElse("nil")
} }
Thread.sleep(500) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong3 ! BinaryString("Ping")).getOrElse("nil") (pingpong3 ! BinaryString("Ping")).getOrElse("nil")
} }
Thread.sleep(500) Thread.sleep(500)
expect("pingpingpingDIEpingpingping") { expect("pingpingpingDIEpingpingping") {
Logg.messageLog Logg.messageLog
} }
} }
@Test def shouldOneWayKillMultipleActorsAllForOne = { @Test def shouldOneWayKillMultipleActorsAllForOne = {
Logg.messageLog = "" Logg.messageLog = ""
val sup = getMultipleActorsAllForOneConf val sup = getMultipleActorsAllForOneConf
sup ! StartSupervisor sup ! StartSupervisor
Thread.sleep(500) Thread.sleep(500)
intercept[RuntimeException] { intercept[RuntimeException] {
pingpong2 ! BinaryString("Die") pingpong2 ! BinaryString("Die")
} }
Thread.sleep(500) Thread.sleep(500)
expect("DIEDIEDIE") { expect("DIEDIEDIE") {
Logg.messageLog Logg.messageLog
} }
} }
def tesOneWayCallKillCallMultipleActorsAllForOne = { def tesOneWayCallKillCallMultipleActorsAllForOne = {
Logg.messageLog = "" Logg.messageLog = ""
val sup = getMultipleActorsAllForOneConf val sup = getMultipleActorsAllForOneConf
sup ! StartSupervisor sup ! StartSupervisor
Thread.sleep(500) Thread.sleep(500)
expect("pong") { expect("pong") {
pingpong1 ! BinaryString("Ping") pingpong1 ! BinaryString("Ping")
} }
Thread.sleep(500) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong2 ! BinaryString("Ping")).getOrElse("nil") (pingpong2 ! BinaryString("Ping")).getOrElse("nil")
} }
Thread.sleep(500) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong3 ! BinaryString("Ping")).getOrElse("nil") (pingpong3 ! BinaryString("Ping")).getOrElse("nil")
} }
Thread.sleep(500) Thread.sleep(500)
expect("pingpingping") { expect("pingpingping") {
Logg.messageLog Logg.messageLog
} }
intercept[RuntimeException] { intercept[RuntimeException] {
pingpong2 ! BinaryString("Die") pingpong2 ! BinaryString("Die")
} }
Thread.sleep(500) Thread.sleep(500)
expect("pingpingpingDIEDIEDIE") { expect("pingpingpingDIEDIEDIE") {
Logg.messageLog Logg.messageLog
} }
expect("pong") { expect("pong") {
(pingpong1 ! BinaryString("Ping")).getOrElse("nil") (pingpong1 ! BinaryString("Ping")).getOrElse("nil")
} }
Thread.sleep(500) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong2 ! BinaryString("Ping")).getOrElse("nil") (pingpong2 ! BinaryString("Ping")).getOrElse("nil")
} }
Thread.sleep(500) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong3 ! BinaryString("Ping")).getOrElse("nil") (pingpong3 ! BinaryString("Ping")).getOrElse("nil")
} }
Thread.sleep(500) Thread.sleep(500)
expect("pingpingpingDIEDIEDIEpingpingping") { expect("pingpingpingDIEDIEDIEpingpingping") {
Logg.messageLog Logg.messageLog
} }
} }
*/ */
/* /*
@Test def shouldNestedSupervisorsTerminateFirstLevelActorAllForOne = { @Test def shouldNestedSupervisorsTerminateFirstLevelActorAllForOne = {
@ -467,34 +467,29 @@ class RemoteSupervisorTest extends JUnitSuite {
pingpong1 = new RemotePingPong1Actor pingpong1 = new RemotePingPong1Actor
pingpong1.makeRemote(RemoteServer.HOSTNAME, RemoteServer.PORT) pingpong1.makeRemote(RemoteServer.HOSTNAME, RemoteServer.PORT)
object factory extends SupervisorFactory { val factory = SupervisorFactory(
override def getSupervisorConfig: SupervisorConfig = { SupervisorConfig(
SupervisorConfig( RestartStrategy(AllForOne, 3, 100),
RestartStrategy(AllForOne, 3, 100), Supervise(
Supervise( pingpong1,
pingpong1, LifeCycle(Permanent))
LifeCycle(Permanent)) :: Nil))
:: Nil)
} factory.newInstance
}
factory.newSupervisor
} }
def getSingleActorOneForOneSupervisor: Supervisor = { def getSingleActorOneForOneSupervisor: Supervisor = {
pingpong1 = new RemotePingPong1Actor pingpong1 = new RemotePingPong1Actor
pingpong1.makeRemote(RemoteServer.HOSTNAME, RemoteServer.PORT) pingpong1.makeRemote(RemoteServer.HOSTNAME, RemoteServer.PORT)
object factory extends SupervisorFactory { val factory = SupervisorFactory(
override def getSupervisorConfig: SupervisorConfig = { SupervisorConfig(
SupervisorConfig( RestartStrategy(OneForOne, 3, 100),
RestartStrategy(OneForOne, 3, 100), Supervise(
Supervise( pingpong1,
pingpong1, LifeCycle(Permanent))
LifeCycle(Permanent)) :: Nil))
:: Nil) factory.newInstance
}
}
factory.newSupervisor
} }
def getMultipleActorsAllForOneConf: Supervisor = { def getMultipleActorsAllForOneConf: Supervisor = {
@ -505,25 +500,22 @@ class RemoteSupervisorTest extends JUnitSuite {
pingpong3 = new RemotePingPong3Actor pingpong3 = new RemotePingPong3Actor
pingpong3.makeRemote(RemoteServer.HOSTNAME, RemoteServer.PORT) pingpong3.makeRemote(RemoteServer.HOSTNAME, RemoteServer.PORT)
object factory extends SupervisorFactory { val factory = SupervisorFactory(
override def getSupervisorConfig: SupervisorConfig = { SupervisorConfig(
SupervisorConfig( RestartStrategy(AllForOne, 3, 100),
RestartStrategy(AllForOne, 3, 100), Supervise(
Supervise( pingpong1,
pingpong1, LifeCycle(Permanent))
LifeCycle(Permanent)) ::
:: Supervise(
Supervise( pingpong2,
pingpong2, LifeCycle(Permanent))
LifeCycle(Permanent)) ::
:: Supervise(
Supervise( pingpong3,
pingpong3, LifeCycle(Permanent))
LifeCycle(Permanent)) :: Nil))
:: Nil) factory.newInstance
}
}
factory.newSupervisor
} }
def getMultipleActorsOneForOneConf: Supervisor = { def getMultipleActorsOneForOneConf: Supervisor = {
@ -534,25 +526,22 @@ class RemoteSupervisorTest extends JUnitSuite {
pingpong3 = new RemotePingPong3Actor pingpong3 = new RemotePingPong3Actor
pingpong3.makeRemote(RemoteServer.HOSTNAME, RemoteServer.PORT) pingpong3.makeRemote(RemoteServer.HOSTNAME, RemoteServer.PORT)
object factory extends SupervisorFactory { val factory = SupervisorFactory(
override def getSupervisorConfig: SupervisorConfig = { SupervisorConfig(
SupervisorConfig( RestartStrategy(OneForOne, 3, 100),
RestartStrategy(OneForOne, 3, 100), Supervise(
Supervise( pingpong1,
pingpong1, LifeCycle(Permanent))
LifeCycle(Permanent)) ::
:: Supervise(
Supervise( pingpong2,
pingpong2, LifeCycle(Permanent))
LifeCycle(Permanent)) ::
:: Supervise(
Supervise( pingpong3,
pingpong3, LifeCycle(Permanent))
LifeCycle(Permanent)) :: Nil))
:: Nil) factory.newInstance
}
}
factory.newSupervisor
} }
def getNestedSupervisorsAllForOneConf: Supervisor = { def getNestedSupervisorsAllForOneConf: Supervisor = {
@ -563,34 +552,30 @@ class RemoteSupervisorTest extends JUnitSuite {
pingpong3 = new RemotePingPong3Actor pingpong3 = new RemotePingPong3Actor
pingpong3.makeRemote(RemoteServer.HOSTNAME, RemoteServer.PORT) pingpong3.makeRemote(RemoteServer.HOSTNAME, RemoteServer.PORT)
object factory extends SupervisorFactory { val factory = SupervisorFactory(
override def getSupervisorConfig: SupervisorConfig = { SupervisorConfig(
SupervisorConfig( RestartStrategy(AllForOne, 3, 100),
RestartStrategy(AllForOne, 3, 100), Supervise(
Supervise( pingpong1,
pingpong1, LifeCycle(Permanent))
LifeCycle(Permanent))
::
SupervisorConfig(
RestartStrategy(AllForOne, 3, 100),
Supervise(
pingpong2,
LifeCycle(Permanent))
:: ::
Supervise( SupervisorConfig(
pingpong3, RestartStrategy(AllForOne, 3, 100),
LifeCycle(Permanent)) Supervise(
:: Nil) pingpong2,
:: Nil) LifeCycle(Permanent))
} ::
} Supervise(
factory.newSupervisor pingpong3,
} LifeCycle(Permanent))
:: Nil)
:: Nil))
factory.newInstance
}
} }
@serializable class RemotePingPong1Actor extends Actor { @serializable class RemotePingPong1Actor extends Actor {
override def receive: PartialFunction[Any, Unit] = { def receive = {
case BinaryString("Ping") => case BinaryString("Ping") =>
Log.messageLog += "ping" Log.messageLog += "ping"
reply("pong") reply("pong")
@ -601,26 +586,28 @@ class RemoteSupervisorTest extends JUnitSuite {
case BinaryString("Die") => case BinaryString("Die") =>
throw new RuntimeException("DIE") throw new RuntimeException("DIE")
} }
override protected def postRestart(reason: AnyRef, config: Option[AnyRef]) { override protected def postRestart(reason: AnyRef, config: Option[AnyRef]) {
Log.messageLog += reason.asInstanceOf[Exception].getMessage Log.messageLog += reason.asInstanceOf[Exception].getMessage
} }
} }
@serializable class RemotePingPong2Actor extends Actor { @serializable class RemotePingPong2Actor extends Actor {
override def receive: PartialFunction[Any, Unit] = { def receive = {
case BinaryString("Ping") => case BinaryString("Ping") =>
Log.messageLog += "ping" Log.messageLog += "ping"
reply("pong") reply("pong")
case BinaryString("Die") => case BinaryString("Die") =>
throw new RuntimeException("DIE") throw new RuntimeException("DIE")
} }
override protected def postRestart(reason: AnyRef, config: Option[AnyRef]) { override protected def postRestart(reason: AnyRef, config: Option[AnyRef]) {
Log.messageLog += reason.asInstanceOf[Exception].getMessage Log.messageLog += reason.asInstanceOf[Exception].getMessage
} }
} }
@serializable class RemotePingPong3Actor extends Actor { @serializable class RemotePingPong3Actor extends Actor {
override def receive: PartialFunction[Any, Unit] = { def receive = {
case BinaryString("Ping") => case BinaryString("Ping") =>
Log.messageLog += "ping" Log.messageLog += "ping"
reply("pong") reply("pong")

View file

@ -11,7 +11,7 @@ class SchedulerTest extends JUnitSuite {
var count = 0 var count = 0
case object Tick case object Tick
val actor = new Actor() { val actor = new Actor() {
def receive: PartialFunction[Any, Unit] = { def receive = {
case Tick => count += 1 case Tick => count += 1
}} }}
actor.start actor.start

View file

@ -4,7 +4,7 @@
package se.scalablesolutions.akka.actor package se.scalablesolutions.akka.actor
import config.ScalaConfig._ import se.scalablesolutions.akka.config.ScalaConfig._
import org.scalatest.junit.JUnitSuite import org.scalatest.junit.JUnitSuite
import org.junit.Test import org.junit.Test
@ -453,33 +453,27 @@ class SupervisorTest extends JUnitSuite {
pingpong1 = new PingPong1Actor pingpong1 = new PingPong1Actor
object factory extends SupervisorFactory { val factory = SupervisorFactory(
override def getSupervisorConfig: SupervisorConfig = {
SupervisorConfig( SupervisorConfig(
RestartStrategy(AllForOne, 3, 100), RestartStrategy(AllForOne, 3, 100),
Supervise( Supervise(
pingpong1, pingpong1,
LifeCycle(Permanent)) LifeCycle(Permanent))
:: Nil) :: Nil))
} factory.newInstance
}
factory.newSupervisor
} }
def getSingleActorOneForOneSupervisor: Supervisor = { def getSingleActorOneForOneSupervisor: Supervisor = {
pingpong1 = new PingPong1Actor pingpong1 = new PingPong1Actor
object factory extends SupervisorFactory { val factory = SupervisorFactory(
override def getSupervisorConfig: SupervisorConfig = {
SupervisorConfig( SupervisorConfig(
RestartStrategy(OneForOne, 3, 100), RestartStrategy(OneForOne, 3, 100),
Supervise( Supervise(
pingpong1, pingpong1,
LifeCycle(Permanent)) LifeCycle(Permanent))
:: Nil) :: Nil))
} factory.newInstance
}
factory.newSupervisor
} }
def getMultipleActorsAllForOneConf: Supervisor = { def getMultipleActorsAllForOneConf: Supervisor = {
@ -487,8 +481,7 @@ class SupervisorTest extends JUnitSuite {
pingpong2 = new PingPong2Actor pingpong2 = new PingPong2Actor
pingpong3 = new PingPong3Actor pingpong3 = new PingPong3Actor
object factory extends SupervisorFactory { val factory = SupervisorFactory(
override def getSupervisorConfig: SupervisorConfig = {
SupervisorConfig( SupervisorConfig(
RestartStrategy(AllForOne, 3, 100), RestartStrategy(AllForOne, 3, 100),
Supervise( Supervise(
@ -502,10 +495,8 @@ class SupervisorTest extends JUnitSuite {
Supervise( Supervise(
pingpong3, pingpong3,
LifeCycle(Permanent)) LifeCycle(Permanent))
:: Nil) :: Nil))
} factory.newInstance
}
factory.newSupervisor
} }
def getMultipleActorsOneForOneConf: Supervisor = { def getMultipleActorsOneForOneConf: Supervisor = {
@ -513,8 +504,7 @@ class SupervisorTest extends JUnitSuite {
pingpong2 = new PingPong2Actor pingpong2 = new PingPong2Actor
pingpong3 = new PingPong3Actor pingpong3 = new PingPong3Actor
object factory extends SupervisorFactory { val factory = SupervisorFactory(
override def getSupervisorConfig: SupervisorConfig = {
SupervisorConfig( SupervisorConfig(
RestartStrategy(OneForOne, 3, 100), RestartStrategy(OneForOne, 3, 100),
Supervise( Supervise(
@ -528,10 +518,8 @@ class SupervisorTest extends JUnitSuite {
Supervise( Supervise(
pingpong3, pingpong3,
LifeCycle(Permanent)) LifeCycle(Permanent))
:: Nil) :: Nil))
} factory.newInstance
}
factory.newSupervisor
} }
def getNestedSupervisorsAllForOneConf: Supervisor = { def getNestedSupervisorsAllForOneConf: Supervisor = {
@ -539,8 +527,7 @@ class SupervisorTest extends JUnitSuite {
pingpong2 = new PingPong2Actor pingpong2 = new PingPong2Actor
pingpong3 = new PingPong3Actor pingpong3 = new PingPong3Actor
object factory extends SupervisorFactory { val factory = SupervisorFactory(
override def getSupervisorConfig: SupervisorConfig = {
SupervisorConfig( SupervisorConfig(
RestartStrategy(AllForOne, 3, 100), RestartStrategy(AllForOne, 3, 100),
Supervise( Supervise(
@ -557,14 +544,12 @@ class SupervisorTest extends JUnitSuite {
pingpong3, pingpong3,
LifeCycle(Permanent)) LifeCycle(Permanent))
:: Nil) :: Nil)
:: Nil) :: Nil))
} factory.newInstance
}
factory.newSupervisor
} }
class PingPong1Actor extends Actor { class PingPong1Actor extends Actor {
override def receive: PartialFunction[Any, Unit] = { def receive = {
case Ping => case Ping =>
messageLog += "ping" messageLog += "ping"
reply("pong") reply("pong")
@ -581,7 +566,7 @@ class SupervisorTest extends JUnitSuite {
} }
class PingPong2Actor extends Actor { class PingPong2Actor extends Actor {
override def receive: PartialFunction[Any, Unit] = { def receive = {
case Ping => case Ping =>
messageLog += "ping" messageLog += "ping"
reply("pong") reply("pong")
@ -594,7 +579,7 @@ class SupervisorTest extends JUnitSuite {
} }
class PingPong3Actor extends Actor { class PingPong3Actor extends Actor {
override def receive: PartialFunction[Any, Unit] = { def receive = {
case Ping => case Ping =>
messageLog += "ping" messageLog += "ping"
reply("pong") reply("pong")

View file

@ -13,7 +13,7 @@ class ThreadBasedActorTest extends JUnitSuite {
class TestActor extends Actor { class TestActor extends Actor {
dispatcher = Dispatchers.newThreadBasedDispatcher(this) dispatcher = Dispatchers.newThreadBasedDispatcher(this)
def receive: PartialFunction[Any, Unit] = { def receive = {
case "Hello" => case "Hello" =>
reply("World") reply("World")
case "Failure" => case "Failure" =>
@ -25,7 +25,7 @@ class ThreadBasedActorTest extends JUnitSuite {
implicit val timeout = 5000L implicit val timeout = 5000L
var oneWay = "nada" var oneWay = "nada"
val actor = new Actor { val actor = new Actor {
def receive: PartialFunction[Any, Unit] = { def receive = {
case "OneWay" => oneWay = "received" case "OneWay" => oneWay = "received"
} }
} }
@ -33,7 +33,7 @@ class ThreadBasedActorTest extends JUnitSuite {
val result = actor ! "OneWay" val result = actor ! "OneWay"
Thread.sleep(100) Thread.sleep(100)
assert("received" === oneWay) assert("received" === oneWay)
actor.stop actor.exit
} }
@Test def shouldSendReplySync = { @Test def shouldSendReplySync = {
@ -42,7 +42,7 @@ class ThreadBasedActorTest extends JUnitSuite {
actor.start actor.start
val result: String = actor !? "Hello" val result: String = actor !? "Hello"
assert("World" === result) assert("World" === result)
actor.stop actor.exit
} }
@Test def shouldSendReplyAsync = { @Test def shouldSendReplyAsync = {
@ -51,7 +51,7 @@ class ThreadBasedActorTest extends JUnitSuite {
actor.start actor.start
val result = actor !! "Hello" val result = actor !! "Hello"
assert("World" === result.get.asInstanceOf[String]) assert("World" === result.get.asInstanceOf[String])
actor.stop actor.exit
} }
@Test def shouldSendReceiveException = { @Test def shouldSendReceiveException = {
@ -65,6 +65,6 @@ class ThreadBasedActorTest extends JUnitSuite {
case e => case e =>
assert("expected" === e.getMessage()) assert("expected" === e.getMessage())
} }
actor.stop actor.exit
} }
} }

View file

@ -13,9 +13,9 @@ import se.scalablesolutions.akka.actor.Actor
class ThreadBasedDispatcherTest extends JUnitSuite { class ThreadBasedDispatcherTest extends JUnitSuite {
private var threadingIssueDetected: AtomicBoolean = null private var threadingIssueDetected: AtomicBoolean = null
val key1 = new Actor { def receive: PartialFunction[Any, Unit] = { case _ => {}} } val key1 = new Actor { def receive = { case _ => {}} }
val key2 = new Actor { def receive: PartialFunction[Any, Unit] = { case _ => {}} } val key2 = new Actor { def receive = { case _ => {}} }
val key3 = new Actor { def receive: PartialFunction[Any, Unit] = { case _ => {}} } val key3 = new Actor { def receive = { case _ => {}} }
class TestMessageHandle(handleLatch: CountDownLatch) extends MessageInvoker { class TestMessageHandle(handleLatch: CountDownLatch) extends MessageInvoker {
val guardLock: Lock = new ReentrantLock val guardLock: Lock = new ReentrantLock

View file

@ -32,7 +32,7 @@ import java.io.IOException
* val consumer = AMQP.newConsumer(params, hostname, port, exchange, ExchangeType.Direct, Serializer.ScalaJSON, None, 100) * val consumer = AMQP.newConsumer(params, hostname, port, exchange, ExchangeType.Direct, Serializer.ScalaJSON, None, 100)
* *
* consumer ! MessageConsumerListener(queue, routingKey, new Actor() { * consumer ! MessageConsumerListener(queue, routingKey, new Actor() {
* def receive: PartialFunction[Any, Unit] = { * def receive = {
* case Message(payload, _, _, _, _) => log.debug("Received message: %s", payload) * case Message(payload, _, _, _, _) => log.debug("Received message: %s", payload)
* } * }
* }) * })
@ -208,7 +208,7 @@ object AMQP extends Actor {
override def shutdown = { override def shutdown = {
connections.values.asScala.foreach(_ ! Stop) connections.values.asScala.foreach(_ ! Stop)
stop exit
} }
/** /**
@ -236,7 +236,7 @@ object AMQP extends Actor {
channel.basicPublish(exchangeName, routingKey, mandatory, immediate, properties, payload.asInstanceOf[Array[Byte]]) channel.basicPublish(exchangeName, routingKey, mandatory, immediate, properties, payload.asInstanceOf[Array[Byte]])
case Stop => case Stop =>
disconnect disconnect
stop exit
} }
protected def setupChannel = { protected def setupChannel = {
@ -323,7 +323,7 @@ object AMQP extends Actor {
case Stop => case Stop =>
listeners.elements.toList.map(_._2).foreach(unregisterListener(_)) listeners.elements.toList.map(_._2).foreach(unregisterListener(_))
disconnect disconnect
stop exit
case message: Message => case message: Message =>
handleIllegalMessage("AMQP.Consumer [" + this + "] can't be used to send messages, ignoring message [" + message + "]") handleIllegalMessage("AMQP.Consumer [" + this + "] can't be used to send messages, ignoring message [" + message + "]")
@ -401,7 +401,7 @@ object AMQP extends Actor {
case Some(tag) => case Some(tag) =>
channel.basicCancel(tag) channel.basicCancel(tag)
unlink(listener.actor) unlink(listener.actor)
listener.actor.stop listener.actor.exit
log.debug("Message consumer is cancelled and shut down [%s]", listener) log.debug("Message consumer is cancelled and shut down [%s]", listener)
} }
} }

View file

@ -30,7 +30,7 @@ object ExampleSession {
def direct = { def direct = {
val consumer = AMQP.newConsumer(CONFIG, HOSTNAME, PORT, IM, ExchangeType.Direct, None, 100, false, false, Map[String, AnyRef]()) val consumer = AMQP.newConsumer(CONFIG, HOSTNAME, PORT, IM, ExchangeType.Direct, None, 100, false, false, Map[String, AnyRef]())
consumer ! MessageConsumerListener("@george_bush", "direct", new Actor() { consumer ! MessageConsumerListener("@george_bush", "direct", new Actor() {
def receive: PartialFunction[Any, Unit] = { def receive = {
case Message(payload, _, _, _, _) => log.info("@george_bush received message from: %s", new String(payload.asInstanceOf[Array[Byte]])) case Message(payload, _, _, _, _) => log.info("@george_bush received message from: %s", new String(payload.asInstanceOf[Array[Byte]]))
} }
}) })
@ -41,12 +41,12 @@ object ExampleSession {
def fanout = { def fanout = {
val consumer = AMQP.newConsumer(CONFIG, HOSTNAME, PORT, CHAT, ExchangeType.Fanout, None, 100, false, false, Map[String, AnyRef]()) val consumer = AMQP.newConsumer(CONFIG, HOSTNAME, PORT, CHAT, ExchangeType.Fanout, None, 100, false, false, Map[String, AnyRef]())
consumer ! MessageConsumerListener("@george_bush", "", new Actor() { consumer ! MessageConsumerListener("@george_bush", "", new Actor() {
def receive: PartialFunction[Any, Unit] = { def receive = {
case Message(payload, _, _, _, _) => log.info("@george_bush received message from: %s", new String(payload.asInstanceOf[Array[Byte]])) case Message(payload, _, _, _, _) => log.info("@george_bush received message from: %s", new String(payload.asInstanceOf[Array[Byte]]))
} }
}) })
consumer ! MessageConsumerListener("@barack_obama", "", new Actor() { consumer ! MessageConsumerListener("@barack_obama", "", new Actor() {
def receive: PartialFunction[Any, Unit] = { def receive = {
case Message(payload, _, _, _, _) => log.info("@barack_obama received message from: %s", new String(payload.asInstanceOf[Array[Byte]])) case Message(payload, _, _, _, _) => log.info("@barack_obama received message from: %s", new String(payload.asInstanceOf[Array[Byte]]))
} }
}) })

View file

@ -17,7 +17,7 @@ public class InMemNestedStateTest extends TestCase {
final private ActiveObjectConfigurator conf = new ActiveObjectConfigurator(); final private ActiveObjectConfigurator conf = new ActiveObjectConfigurator();
protected void setUp() { public InMemNestedStateTest() {
conf.configure( conf.configure(
new RestartStrategy(new AllForOne(), 3, 5000), new RestartStrategy(new AllForOne(), 3, 5000),
new Component[]{ new Component[]{
@ -26,7 +26,7 @@ public class InMemNestedStateTest extends TestCase {
new Component(InMemStatefulNested.class, new LifeCycle(new Permanent()), 10000000), new Component(InMemStatefulNested.class, new LifeCycle(new Permanent()), 10000000),
new Component(InMemFailer.class, new LifeCycle(new Permanent()), 1000) new Component(InMemFailer.class, new LifeCycle(new Permanent()), 1000)
//new Component("inmem-clasher", InMemClasher.class, InMemClasherImpl.class, new LifeCycle(new Permanent()), 100000) //new Component("inmem-clasher", InMemClasher.class, InMemClasherImpl.class, new LifeCycle(new Permanent()), 100000)
}).inject().supervise(); }).supervise();
Config.config(); Config.config();
InMemStateful stateful = conf.getInstance(InMemStateful.class); InMemStateful stateful = conf.getInstance(InMemStateful.class);
stateful.init(); stateful.init();
@ -34,10 +34,6 @@ public class InMemNestedStateTest extends TestCase {
nested.init(); nested.init();
} }
protected void tearDown() {
conf.stop();
}
public void testMapShouldNotRollbackStateForStatefulServerInCaseOfSuccess() throws Exception { public void testMapShouldNotRollbackStateForStatefulServerInCaseOfSuccess() throws Exception {
InMemStateful stateful = conf.getInstance(InMemStateful.class); InMemStateful stateful = conf.getInstance(InMemStateful.class);
stateful.setMapState("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "init"); // set init state stateful.setMapState("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "init"); // set init state

View file

@ -9,7 +9,9 @@ import junit.framework.TestCase;
import se.scalablesolutions.akka.Config; import se.scalablesolutions.akka.Config;
import se.scalablesolutions.akka.config.*; import se.scalablesolutions.akka.config.*;
import se.scalablesolutions.akka.config.ActiveObjectConfigurator; import se.scalablesolutions.akka.config.ActiveObjectConfigurator;
import static se.scalablesolutions.akka.config.JavaConfig.*; import static se.scalablesolutions.akka.config.JavaConfig.*;
import se.scalablesolutions.akka.actor.*; import se.scalablesolutions.akka.actor.*;
import se.scalablesolutions.akka.Kernel; import se.scalablesolutions.akka.Kernel;
@ -18,27 +20,23 @@ public class InMemoryStateTest extends TestCase {
final private ActiveObjectConfigurator conf = new ActiveObjectConfigurator(); final private ActiveObjectConfigurator conf = new ActiveObjectConfigurator();
protected void setUp() { public InMemoryStateTest() {
Config.config(); Config.config();
conf.configure( conf.configure(
new RestartStrategy(new AllForOne(), 3, 5000), new RestartStrategy(new AllForOne(), 3, 5000),
new Component[]{ new Component[]{
new Component(InMemStateful.class, new Component(InMemStateful.class,
new LifeCycle(new Permanent()), new LifeCycle(new Permanent()),
//new RestartCallbacks("preRestart", "postRestart")), //new RestartCallbacks("preRestart", "postRestart")),
10000), 10000),
new Component(InMemFailer.class, new Component(InMemFailer.class,
new LifeCycle(new Permanent()), new LifeCycle(new Permanent()),
10000) 10000)
}).inject().supervise(); }).supervise();
InMemStateful stateful = conf.getInstance(InMemStateful.class); InMemStateful stateful = conf.getInstance(InMemStateful.class);
stateful.init(); stateful.init();
} }
protected void tearDown() {
conf.stop();
}
public void testMapShouldNotRollbackStateForStatefulServerInCaseOfSuccess() { public void testMapShouldNotRollbackStateForStatefulServerInCaseOfSuccess() {
InMemStateful stateful = conf.getInstance(InMemStateful.class); InMemStateful stateful = conf.getInstance(InMemStateful.class);
stateful.setMapState("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "init"); // set init state stateful.setMapState("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "init"); // set init state

View file

@ -35,7 +35,7 @@ class CassandraPersistentActor extends Actor {
private lazy val vectorState: PersistentVector = PersistentState.newVector(CassandraStorageConfig()) private lazy val vectorState: PersistentVector = PersistentState.newVector(CassandraStorageConfig())
private lazy val refState: PersistentRef = PersistentState.newRef(CassandraStorageConfig()) private lazy val refState: PersistentRef = PersistentState.newRef(CassandraStorageConfig())
def receive: PartialFunction[Any, Unit] = { def receive = {
case GetMapState(key) => case GetMapState(key) =>
reply(mapState.get(key).get) reply(mapState.get(key).get)
case GetVectorSize => case GetVectorSize =>
@ -67,7 +67,7 @@ class CassandraPersistentActor extends Actor {
@serializable class PersistentFailerActor extends Actor { @serializable class PersistentFailerActor extends Actor {
makeTransactionRequired makeTransactionRequired
def receive: PartialFunction[Any, Unit] = { def receive = {
case "Failure" => case "Failure" =>
throw new RuntimeException("expected") throw new RuntimeException("expected")
} }

View file

@ -32,7 +32,7 @@ class BankAccountActor extends Actor {
private lazy val accountState: PersistentMap = PersistentState.newMap(MongoStorageConfig()) private lazy val accountState: PersistentMap = PersistentState.newMap(MongoStorageConfig())
private lazy val txnLog: PersistentVector = PersistentState.newVector(MongoStorageConfig()) private lazy val txnLog: PersistentVector = PersistentState.newVector(MongoStorageConfig())
def receive: PartialFunction[Any, Unit] = { def receive = {
// check balance // check balance
case Balance(accountNo) => case Balance(accountNo) =>
txnLog.add("Balance:" + accountNo) txnLog.add("Balance:" + accountNo)
@ -176,7 +176,7 @@ class BankAccountActor extends Actor {
txnLog = PersistentState.newVector(MongoStorageConfig()) txnLog = PersistentState.newVector(MongoStorageConfig())
} }
def receive: PartialFunction[Any, Unit] = { def receive = {
// check balance // check balance
case Balance(accountNo) => case Balance(accountNo) =>
txnLog.add("Balance:" + accountNo) txnLog.add("Balance:" + accountNo)

View file

@ -29,7 +29,7 @@ class SimpleService extends Actor {
@Produces(Array("text/html")) @Produces(Array("text/html"))
def count = (this !! Tick).getOrElse(<h1>Error in counter</h1>) def count = (this !! Tick).getOrElse(<h1>Error in counter</h1>)
override def receive: PartialFunction[Any, Unit] = { def receive = {
case Tick => if (hasStartedTicking) { case Tick => if (hasStartedTicking) {
val counter = storage.get(KEY).get.asInstanceOf[Integer].intValue val counter = storage.get(KEY).get.asInstanceOf[Integer].intValue
storage.put(KEY, new Integer(counter + 1)) storage.put(KEY, new Integer(counter + 1))
@ -62,7 +62,7 @@ class PersistentSimpleService extends Actor {
@Produces(Array("text/html")) @Produces(Array("text/html"))
def count = (this !! Tick).getOrElse(<h1>Error in counter</h1>) def count = (this !! Tick).getOrElse(<h1>Error in counter</h1>)
override def receive: PartialFunction[Any, Unit] = { def receive = {
case Tick => if (hasStartedTicking) { case Tick => if (hasStartedTicking) {
val counter = storage.get(KEY).get.asInstanceOf[Integer].intValue val counter = storage.get(KEY).get.asInstanceOf[Integer].intValue
storage.put(KEY, new Integer(counter + 1)) storage.put(KEY, new Integer(counter + 1))

View file

@ -4,7 +4,6 @@ import _root_.net.liftweb.util._
import _root_.net.liftweb.http._ import _root_.net.liftweb.http._
import _root_.net.liftweb.sitemap._ import _root_.net.liftweb.sitemap._
import _root_.net.liftweb.sitemap.Loc._ import _root_.net.liftweb.sitemap.Loc._
//import _root_.net.liftweb.common._
import _root_.net.liftweb.http.auth._ import _root_.net.liftweb.http.auth._
import Helpers._ import Helpers._
@ -15,9 +14,9 @@ import se.scalablesolutions.akka.util.Logging
import sample.lift.{PersistentSimpleService, SimpleService} import sample.lift.{PersistentSimpleService, SimpleService}
/** /**
* A class that's instantiated early and run. It allows the application * A class that's instantiated early and run. It allows the application
* to modify lift's environment * to modify lift's environment
*/ */
class Boot { class Boot {
def boot { def boot {
// where to search snippet // where to search snippet
@ -37,21 +36,17 @@ class Boot {
LiftRules.passNotFoundToChain = true LiftRules.passNotFoundToChain = true
object factory extends SupervisorFactory { val factory = SupervisorFactory(
override def getSupervisorConfig: SupervisorConfig = { SupervisorConfig(
SupervisorConfig( RestartStrategy(OneForOne, 3, 100),
RestartStrategy(OneForOne, 3, 100), Supervise(
Supervise( new SimpleService,
new SimpleService, LifeCycle(Permanent)) ::
LifeCycle(Permanent)) :: Supervise(
Supervise( new PersistentSimpleService,
new PersistentSimpleService, LifeCycle(Permanent)) ::
LifeCycle(Permanent)) :: Nil))
Nil) factory.newInstance.start
}
}
val supervisor = factory.newSupervisor
supervisor.startSupervisor
// Build SiteMap // Build SiteMap
// val entries = Menu(Loc("Home", List("index"), "Home")) :: Nil // val entries = Menu(Loc("Home", List("index"), "Home")) :: Nil

View file

@ -18,24 +18,20 @@ import org.atmosphere.util.XSSHtmlFilter
import org.atmosphere.cpr.BroadcastFilter import org.atmosphere.cpr.BroadcastFilter
class Boot { class Boot {
object factory extends SupervisorFactory { val factory = SupervisorFactory(
override def getSupervisorConfig: SupervisorConfig = { SupervisorConfig(
SupervisorConfig( RestartStrategy(OneForOne, 3, 100),
RestartStrategy(OneForOne, 3, 100), Supervise(
Supervise( new SimpleService,
new SimpleService, LifeCycle(Permanent)) ::
LifeCycle(Permanent)) :: Supervise(
Supervise( new Chat,
new Chat, LifeCycle(Permanent)) ::
LifeCycle(Permanent)) :: Supervise(
Supervise( new PersistentSimpleService,
new PersistentSimpleService, LifeCycle(Permanent))
LifeCycle(Permanent)) :: Nil))
:: Nil) factory.newInstance.start
}
}
val supervisor = factory.newSupervisor
supervisor.startSupervisor
} }
/** /**
@ -58,7 +54,7 @@ class SimpleService extends Actor {
@Produces(Array("text/html")) @Produces(Array("text/html"))
def count = (this !! Tick).getOrElse(<error>Error in counter</error>) def count = (this !! Tick).getOrElse(<error>Error in counter</error>)
override def receive: PartialFunction[Any, Unit] = { def receive = {
case Tick => if (hasStartedTicking) { case Tick => if (hasStartedTicking) {
val counter = storage.get(KEY).get.asInstanceOf[Integer].intValue val counter = storage.get(KEY).get.asInstanceOf[Integer].intValue
storage.put(KEY, new Integer(counter + 1)) storage.put(KEY, new Integer(counter + 1))
@ -91,7 +87,7 @@ class PersistentSimpleService extends Actor {
@Produces(Array("text/html")) @Produces(Array("text/html"))
def count = (this !! Tick).getOrElse(<error>Error in counter</error>) def count = (this !! Tick).getOrElse(<error>Error in counter</error>)
override def receive: PartialFunction[Any, Unit] = { def receive = {
case Tick => if (hasStartedTicking) { case Tick => if (hasStartedTicking) {
val counter = storage.get(KEY).get.asInstanceOf[Integer].intValue val counter = storage.get(KEY).get.asInstanceOf[Integer].intValue
storage.put(KEY, new Integer(counter + 1)) storage.put(KEY, new Integer(counter + 1))
@ -121,7 +117,7 @@ class Chat extends Actor with Logging {
s toString s toString
} }
override def receive: PartialFunction[Any, Unit] = { def receive = {
case Chat(who, what, msg) => { case Chat(who, what, msg) => {
what match { what match {
case "login" => reply("System Message__" + who + " has joined.") case "login" => reply("System Message__" + who + " has joined.")

View file

@ -11,75 +11,69 @@ import se.scalablesolutions.akka.security.{DigestAuthenticationActor, UserInfo}
import se.scalablesolutions.akka.state.TransactionalState import se.scalablesolutions.akka.state.TransactionalState
class Boot { class Boot {
val factory = SupervisorFactory(
SupervisorConfig(
RestartStrategy(OneForOne, 3, 100),
// Dummy implementations of all authentication actors
// see akka.conf to enable one of these for the AkkaSecurityFilterFactory
Supervise(
new BasicAuthenticationService,
LifeCycle(Permanent)) ::
/**
Supervise(
new DigestAuthenticationService,
LifeCycle(Permanent)) ::
Supervise(
new SpnegoAuthenticationService,
LifeCycle(Permanent)) ::
**/
Supervise(
new SecureTickActor,
LifeCycle(Permanent)):: Nil))
object factory extends SupervisorFactory {
override def getSupervisorConfig: SupervisorConfig = { val supervisor = factory.newInstance
SupervisorConfig( supervisor.start
RestartStrategy(OneForOne, 3, 100),
// Dummy implementations of all authentication actors
// see akka.conf to enable one of these for the AkkaSecurityFilterFactory
Supervise(
new BasicAuthenticationService,
LifeCycle(Permanent)) ::
/**
Supervise(
new DigestAuthenticationService,
LifeCycle(Permanent)) ::
Supervise(
new SpnegoAuthenticationService,
LifeCycle(Permanent)) ::
**/
Supervise(
new SecureTickActor,
LifeCycle(Permanent)):: Nil)
}
}
val supervisor = factory.newSupervisor
supervisor.startSupervisor
} }
/* /*
* In akka.conf you can set the FQN of any AuthenticationActor of your wish, under the property name: akka.rest.authenticator * In akka.conf you can set the FQN of any AuthenticationActor of your wish, under the property name: akka.rest.authenticator
*/ */
class DigestAuthenticationService extends DigestAuthenticationActor { class DigestAuthenticationService extends DigestAuthenticationActor {
//If you want to have a distributed nonce-map, you can use something like below, //If you want to have a distributed nonce-map, you can use something like below,
//don't forget to configure your standalone Cassandra instance //don't forget to configure your standalone Cassandra instance
// //
//makeTransactionRequired //makeTransactionRequired
//override def mkNonceMap = PersistentState.newMap(CassandraStorageConfig()).asInstanceOf[scala.collection.mutable.Map[String,Long]] //override def mkNonceMap = PersistentState.newMap(CassandraStorageConfig()).asInstanceOf[scala.collection.mutable.Map[String,Long]]
//Use an in-memory nonce-map as default //Use an in-memory nonce-map as default
override def mkNonceMap = new scala.collection.mutable.HashMap[String,Long] override def mkNonceMap = new scala.collection.mutable.HashMap[String, Long]
//Change this to whatever you want //Change this to whatever you want
override def realm = "test" override def realm = "test"
//Dummy method that allows you to log on with whatever username with the password "bar" //Dummy method that allows you to log on with whatever username with the password "bar"
override def userInfo(username : String) : Option[UserInfo] = Some(UserInfo(username,"bar","ninja" :: "chef" :: Nil)) override def userInfo(username: String): Option[UserInfo] = Some(UserInfo(username, "bar", "ninja" :: "chef" :: Nil))
} }
class BasicAuthenticationService extends BasicAuthenticationActor { class BasicAuthenticationService extends BasicAuthenticationActor {
//Change this to whatever you want //Change this to whatever you want
override def realm = "test" override def realm = "test"
//Dummy method that allows you to log on with whatever username //Dummy method that allows you to log on with whatever username
def verify(odc : Option[BasicCredentials]) : Option[UserInfo] = odc match { def verify(odc: Option[BasicCredentials]): Option[UserInfo] = odc match {
case Some(dc) => userInfo(dc.username) case Some(dc) => userInfo(dc.username)
case _ => None case _ => None
} }
//Dummy method that allows you to log on with whatever username with the password "bar" //Dummy method that allows you to log on with whatever username with the password "bar"
def userInfo(username : String) : Option[UserInfo] = Some(UserInfo(username,"bar","ninja" :: "chef" :: Nil)) def userInfo(username: String): Option[UserInfo] = Some(UserInfo(username, "bar", "ninja" :: "chef" :: Nil))
} }
class SpnegoAuthenticationService extends SpnegoAuthenticationActor { class SpnegoAuthenticationService extends SpnegoAuthenticationActor {
def rolesFor(user: String) = "ninja" :: "chef" :: Nil
def rolesFor(user: String) = "ninja" :: "chef" :: Nil
} }
@ -87,16 +81,16 @@ class SpnegoAuthenticationService extends SpnegoAuthenticationActor {
* a REST Actor with class level paranoia settings to deny all access * a REST Actor with class level paranoia settings to deny all access
* *
* The interesting part is * The interesting part is
* @RolesAllowed * @RolesAllowed
* @PermitAll * @PermitAll
* @DenyAll * @DenyAll
*/ */
import java.lang.Integer import java.lang.Integer
import javax.annotation.security.{RolesAllowed, DenyAll, PermitAll} import javax.annotation.security.{RolesAllowed, DenyAll, PermitAll}
import javax.ws.rs.{GET, Path, Produces} import javax.ws.rs.{GET, Path, Produces}
@Path("/secureticker") @Path("/secureticker")
class SecureTickActor extends Actor with Logging { class SecureTickActor extends Actor with Logging {
makeTransactionRequired makeTransactionRequired
case object Tick case object Tick
@ -131,11 +125,13 @@ class SecureTickActor extends Actor with Logging {
def paranoiaTick = tick def paranoiaTick = tick
def tick = (this !! Tick) match { def tick = (this !! Tick) match {
case(Some(counter)) => (<success>Tick: {counter}</success>) case (Some(counter)) => (<success>Tick:
{counter}
</success>)
case _ => (<error>Error in counter</error>) case _ => (<error>Error in counter</error>)
} }
override def receive: PartialFunction[Any, Unit] = { def receive = {
case Tick => if (hasStartedTicking) { case Tick => if (hasStartedTicking) {
val counter = storage.get(KEY).get.intValue val counter = storage.get(KEY).get.intValue
storage.put(KEY, counter + 1) storage.put(KEY, counter + 1)

View file

@ -264,17 +264,18 @@ trait DigestAuthenticationActor extends AuthenticationActor[DigestCredentials] {
override def receive = authenticate orElse invalidateNonces override def receive = authenticate orElse invalidateNonces
override def unauthorized: Response = { override def unauthorized: Response = {
val nonce = randomString(64); val nonce = randomString(64)
nonceMap.put(nonce, System.currentTimeMillis) nonceMap.put(nonce, System.currentTimeMillis)
unauthorized(nonce, "auth", randomString(64)) unauthorized(nonce, "auth", randomString(64))
} }
def unauthorized(nonce: String, qop: String, opaque: String): Response = { def unauthorized(nonce: String, qop: String, opaque: String): Response = {
Response.status(401).header("WWW-Authenticate", Response.status(401).header(
"WWW-Authenticate",
"Digest realm=\"" + realm + "\", " + "Digest realm=\"" + realm + "\", " +
"qop=\"" + qop + "\", " + "qop=\"" + qop + "\", " +
"nonce=\"" + nonce + "\", " + "nonce=\"" + nonce + "\", " +
"opaque=\"" + opaque + "\"").build "opaque=\"" + opaque + "\"").build
} }
//Tests wether the specified credentials are valid //Tests wether the specified credentials are valid
@ -284,9 +285,10 @@ trait DigestAuthenticationActor extends AuthenticationActor[DigestCredentials] {
val ha1 = h(auth.userName + ":" + auth.realm + ":" + user.password) val ha1 = h(auth.userName + ":" + auth.realm + ":" + user.password)
val ha2 = h(auth.method + ":" + auth.uri) val ha2 = h(auth.method + ":" + auth.uri)
val response = h(ha1 + ":" + auth.nonce + ":" + val response = h(
auth.nc + ":" + auth.cnonce + ":" + ha1 + ":" + auth.nonce + ":" +
auth.qop + ":" + ha2) auth.nc + ":" + auth.cnonce + ":" +
auth.qop + ":" + ha2)
(response == auth.response) && (nonceMap.getOrElse(auth.nonce, -1) != -1) (response == auth.response) && (nonceMap.getOrElse(auth.nonce, -1) != -1)
} }

View file

@ -135,7 +135,7 @@ object ActiveObject {
private[akka] def supervise(restartStrategy: RestartStrategy, components: List[Supervise]): Supervisor = { private[akka] def supervise(restartStrategy: RestartStrategy, components: List[Supervise]): Supervisor = {
object factory extends SupervisorFactory { val factory = SupervisorFactory {
override def getSupervisorConfig = SupervisorConfig(restartStrategy, components) override def getSupervisorConfig = SupervisorConfig(restartStrategy, components)
} }
val supervisor = factory.newSupervisor val supervisor = factory.newSupervisor
@ -333,7 +333,7 @@ private[akka] class Dispatcher(val callbacks: Option[RestartCallbacks]) extends
//if (initTxState.isDefined) initTxState.get.setAccessible(true) //if (initTxState.isDefined) initTxState.get.setAccessible(true)
} }
override def receive: PartialFunction[Any, Unit] = { def receive = {
case Invocation(joinPoint, isOneWay, _) => case Invocation(joinPoint, isOneWay, _) =>
if (Actor.SERIALIZE_MESSAGES) serializeArguments(joinPoint) if (Actor.SERIALIZE_MESSAGES) serializeArguments(joinPoint)
if (isOneWay) joinPoint.proceed if (isOneWay) joinPoint.proceed

View file

@ -158,7 +158,7 @@ trait Actor extends Logging with TransactionManagement {
* &lt;p/> * &lt;p/>
* Example code: * Example code:
* &lt;pre> * &lt;pre>
* def receive: PartialFunction[Any, Unit] = { * def receive = {
* case Ping => * case Ping =>
* println("got a ping") * println("got a ping")
* reply("pong") * reply("pong")
@ -171,7 +171,7 @@ trait Actor extends Logging with TransactionManagement {
* } * }
* &lt;/pre> * &lt;/pre>
*/ */
protected def receive: PartialFunction[Any, Unit] protected def receive
/** /**
* User overridable callback/setting. * User overridable callback/setting.

View file

@ -38,7 +38,7 @@ case class SchedulerException(msg: String, e: Throwable) extends RuntimeExceptio
class ScheduleActor(val receiver: Actor, val future: ScheduledFuture[AnyRef]) extends Actor with Logging { class ScheduleActor(val receiver: Actor, val future: ScheduledFuture[AnyRef]) extends Actor with Logging {
lifeCycleConfig = Some(LifeCycle(Permanent)) lifeCycleConfig = Some(LifeCycle(Permanent))
def receive: PartialFunction[Any, Unit] = { def receive = {
case UnSchedule => case UnSchedule =>
Scheduler.stopSupervising(this) Scheduler.stopSupervising(this)
future.cancel(true) future.cancel(true)
@ -77,7 +77,7 @@ object Scheduler extends Actor {
service.shutdown service.shutdown
} }
def receive: PartialFunction[Any, Unit] = { def receive = {
case _ => {} // ignore all messages case _ => {} // ignore all messages
} }
} }

View file

@ -133,7 +133,7 @@ class Supervisor private[akka] (handler: FaultHandlingStrategy) extends Actor wi
def stopSupervisor = this ! StopSupervisor def stopSupervisor = this ! StopSupervisor
protected def receive: PartialFunction[Any, Unit] = { protected def receive = {
case StartSupervisor => case StartSupervisor =>
linkedActors.toArray.toList.asInstanceOf[List[Actor]].foreach { actor => actor.start; log.info("Starting actor: %s", actor) } linkedActors.toArray.toList.asInstanceOf[List[Actor]].foreach { actor => actor.start; log.info("Starting actor: %s", actor) }

View file

@ -278,7 +278,7 @@
<p/> <p/>
Example code: Example code:
<pre> <pre>
def receive: PartialFunction[Any, Unit] = { def receive = {
case Ping => case Ping =>
println("got a ping") println("got a ping")
reply("pong") reply("pong")

View file

@ -287,7 +287,7 @@
<p/> <p/>
Example code: Example code:
<pre> <pre>
def receive: PartialFunction[Any, Unit] = { def receive = {
case Ping => case Ping =>
println("got a ping") println("got a ping")
reply("pong") reply("pong")

View file

@ -282,7 +282,7 @@
<p/> <p/>
Example code: Example code:
<pre> <pre>
def receive: PartialFunction[Any, Unit] = { def receive = {
case Ping => case Ping =>
println("got a ping") println("got a ping")
reply("pong") reply("pong")

View file

@ -311,7 +311,7 @@
<p/> <p/>
Example code: Example code:
<pre> <pre>
def receive: PartialFunction[Any, Unit] = { def receive = {
case Ping => case Ping =>
println("got a ping") println("got a ping")
reply("pong") reply("pong")

View file

@ -41,7 +41,7 @@ import java.io.IOException
* val consumer = AMQP.newConsumer(params, hostname, port, exchange, ExchangeType.Direct, Serializer.ScalaJSON, None, 100) * val consumer = AMQP.newConsumer(params, hostname, port, exchange, ExchangeType.Direct, Serializer.ScalaJSON, None, 100)
* *
* consumer ! MessageConsumerListener(queue, routingKey, new Actor() { * consumer ! MessageConsumerListener(queue, routingKey, new Actor() {
* def receive: PartialFunction[Any, Unit] = { * def receive = {
* case Message(payload, _, _, _, _) => log.debug("Received message: %s", payload) * case Message(payload, _, _, _, _) => log.debug("Received message: %s", payload)
* } * }
* }) * })
@ -209,7 +209,7 @@ object AMQP extends Actor {
log.info("AMQP.Producer [%s] is started", toString) log.info("AMQP.Producer [%s] is started", toString)
def receive: PartialFunction[Any, Unit] = { def receive = {
case message @ Message(payload, routingKey, mandatory, immediate, properties) => case message @ Message(payload, routingKey, mandatory, immediate, properties) =>
log.debug("Sending message [%s]", message) log.debug("Sending message [%s]", message)
channel.basicPublish(exchangeName, routingKey, mandatory, immediate, properties, serializer.out(payload)) channel.basicPublish(exchangeName, routingKey, mandatory, immediate, properties, serializer.out(payload))
@ -312,7 +312,7 @@ object AMQP extends Actor {
listener.tag = Some(listenerTag) listener.tag = Some(listenerTag)
} }
def receive: PartialFunction[Any, Unit] = { def receive = {
case listener: MessageConsumerListener => case listener: MessageConsumerListener =>
startLink(listener.actor) startLink(listener.actor)
listeners.put(listener, listener) listeners.put(listener, listener)
@ -425,7 +425,7 @@ object AMQP extends Actor {
override def postRestart(reason: AnyRef, config: Option[AnyRef]) = reconnect(initReconnectDelay) override def postRestart(reason: AnyRef, config: Option[AnyRef]) = reconnect(initReconnectDelay)
} }
def receive: PartialFunction[Any, Unit] = { def receive = {
case _ => {} // ignore all messages case _ => {} // ignore all messages
} }
} }

View file

@ -40,7 +40,7 @@ object ExampleSession {
def direct = { def direct = {
val consumer = AMQP.newConsumer(CONFIG, HOSTNAME, PORT, IM, ExchangeType.Direct, SERIALIZER, None, 100, false, false, Map[String, AnyRef]()) val consumer = AMQP.newConsumer(CONFIG, HOSTNAME, PORT, IM, ExchangeType.Direct, SERIALIZER, None, 100, false, false, Map[String, AnyRef]())
consumer ! MessageConsumerListener("@george_bush", "direct", new Actor() { consumer ! MessageConsumerListener("@george_bush", "direct", new Actor() {
def receive: PartialFunction[Any, Unit] = { def receive = {
case Message(payload, _, _, _, _) => log.info("@george_bush received message from: %s", payload) case Message(payload, _, _, _, _) => log.info("@george_bush received message from: %s", payload)
} }
}) })
@ -51,12 +51,12 @@ object ExampleSession {
def fanout = { def fanout = {
val consumer = AMQP.newConsumer(CONFIG, HOSTNAME, PORT, CHAT, ExchangeType.Fanout, SERIALIZER, None, 100, false, false, Map[String, AnyRef]()) val consumer = AMQP.newConsumer(CONFIG, HOSTNAME, PORT, CHAT, ExchangeType.Fanout, SERIALIZER, None, 100, false, false, Map[String, AnyRef]())
consumer ! MessageConsumerListener("@george_bush", "", new Actor() { consumer ! MessageConsumerListener("@george_bush", "", new Actor() {
def receive: PartialFunction[Any, Unit] = { def receive = {
case Message(payload, _, _, _, _) => log.info("@george_bush received message from: %s", payload) case Message(payload, _, _, _, _) => log.info("@george_bush received message from: %s", payload)
} }
}) })
consumer ! MessageConsumerListener("@barack_obama", "", new Actor() { consumer ! MessageConsumerListener("@barack_obama", "", new Actor() {
def receive: PartialFunction[Any, Unit] = { def receive = {
case Message(payload, _, _, _, _) => log.info("@barack_obama received message from: %s", payload) case Message(payload, _, _, _, _) => log.info("@barack_obama received message from: %s", payload)
} }
}) })

View file

@ -63,7 +63,7 @@
val consumer = AMQP.newConsumer(params, hostname, port, exchange, ExchangeType.Direct, Serializer.ScalaJSON, None, 100) val consumer = AMQP.newConsumer(params, hostname, port, exchange, ExchangeType.Direct, Serializer.ScalaJSON, None, 100)
consumer ! MessageConsumerListener(queue, routingKey, new Actor() { consumer ! MessageConsumerListener(queue, routingKey, new Actor() {
def receive: PartialFunction[Any, Unit] = { def receive = {
case Message(payload, _, _, _, _) => log.debug("Received message: %s", payload) case Message(payload, _, _, _, _) => log.debug("Received message: %s", payload)
} }
}) })

View file

@ -211,7 +211,7 @@ trait AuthenticationActor[C &lt;: Credentials] extends Actor with Logging
} }
} }
override def receive: PartialFunction[Any, Unit] = authenticate def receive = authenticate
//returns the string value of the "Authorization"-header of the request //returns the string value of the "Authorization"-header of the request
def auth(r : Req) = r.getHeaderValue("Authorization") def auth(r : Req) = r.getHeaderValue("Authorization")
@ -284,7 +284,7 @@ trait DigestAuthenticationActor extends AuthenticationActor[DigestCredentials]
Scheduler.schedule(this, InvalidateNonces, noncePurgeInterval, noncePurgeInterval, TimeUnit.MILLISECONDS ) Scheduler.schedule(this, InvalidateNonces, noncePurgeInterval, noncePurgeInterval, TimeUnit.MILLISECONDS )
//authenticate or invalidate nonces //authenticate or invalidate nonces
override def receive: PartialFunction[Any, Unit] = authenticate orElse invalidateNonces def receive = authenticate orElse invalidateNonces
override def unauthorized : Response = override def unauthorized : Response =
{ {

View file

@ -253,7 +253,7 @@
<b>receive</b>..<a name="receive"></a> <b>receive</b>..<a name="receive"></a>
</td> </td>
<td class="signature"> <td class="signature">
<code class="signature">override def receive</code> <code class="signature">def receive</code>
</td> </td>

View file

@ -251,7 +251,7 @@
<b>receive</b>..<a name="receive"></a> <b>receive</b>..<a name="receive"></a>
</td> </td>
<td class="signature"> <td class="signature">
<code class="signature">override def receive</code> <code class="signature">def receive</code>
</td> </td>

View file

@ -321,7 +321,7 @@
<b>receive</b>..<a name="receive"></a> <b>receive</b>..<a name="receive"></a>
</td> </td>
<td class="signature"> <td class="signature">
<code class="signature">override def receive</code> <code class="signature">def receive</code>
</td> </td>

View file

@ -276,7 +276,7 @@
<b>receive</b>..<a name="receive"></a> <b>receive</b>..<a name="receive"></a>
</td> </td>
<td class="signature"> <td class="signature">
<code class="signature">override def receive</code> <code class="signature">def receive</code>
</td> </td>