fixed bugs regarding oneway transaction managament

This commit is contained in:
Jonas Boner 2009-06-30 16:01:50 +02:00
parent 6359920fa4
commit 2cfeda0ce0
23 changed files with 1095 additions and 2694 deletions

2
.gitignore vendored
View file

@ -18,3 +18,5 @@ tm*.log
tm*.lck tm*.lck
tm.out tm.out
*.tm.epoch *.tm.epoch
_dump
WEB-INF

View file

@ -9,11 +9,11 @@
<output url="file://$MODULE_DIR$/target/classes" /> <output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" /> <output-test url="file://$MODULE_DIR$/target/test-classes" />
<exclude-output /> <exclude-output />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="akka-kernel" />
<orderEntry type="module" module-name="akka-util-java" />
</component> </component>
</module> </module>

471
akka.ipr
View file

@ -2,14 +2,6 @@
<project relativePaths="true" version="4"> <project relativePaths="true" version="4">
<component name="AntConfiguration"> <component name="AntConfiguration">
<defaultAnt bundledAnt="true" /> <defaultAnt bundledAnt="true" />
<buildFile url="file://$PROJECT_DIR$/kernel/build.xml">
<additionalClassPath />
<antReference projectDefault="true" />
<customJdkName value="" />
<maximumHeapSize value="128" />
<maximumStackSize value="32" />
<properties />
</buildFile>
</component> </component>
<component name="BuildJarProjectSettings"> <component name="BuildJarProjectSettings">
<option name="BUILD_JARS_ON_MAKE" value="false" /> <option name="BUILD_JARS_ON_MAKE" value="false" />
@ -17,58 +9,6 @@
<component name="CodeStyleSettingsManager"> <component name="CodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS"> <option name="PER_PROJECT_SETTINGS">
<value> <value>
<option name="USE_SAME_INDENTS" value="true" />
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
</value>
</option>
<option name="LINE_SEPARATOR" value="&#10;" />
<ScalaCodeStyleSettings>
<option name="CHECK_IMPLICITS" value="false" />
</ScalaCodeStyleSettings>
<ADDITIONAL_INDENT_OPTIONS fileType="">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="2" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="clj">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="2" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="groovy">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="gsp">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="java"> <ADDITIONAL_INDENT_OPTIONS fileType="java">
<option name="INDENT_SIZE" value="4" /> <option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" /> <option name="CONTINUATION_INDENT_SIZE" value="8" />
@ -78,24 +18,6 @@
<option name="LABEL_INDENT_SIZE" value="0" /> <option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" /> <option name="LABEL_INDENT_ABSOLUTE" value="false" />
</ADDITIONAL_INDENT_OPTIONS> </ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="js">
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="jsp">
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="scala"> <ADDITIONAL_INDENT_OPTIONS fileType="scala">
<option name="INDENT_SIZE" value="2" /> <option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" /> <option name="CONTINUATION_INDENT_SIZE" value="8" />
@ -105,15 +27,6 @@
<option name="LABEL_INDENT_SIZE" value="0" /> <option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" /> <option name="LABEL_INDENT_ABSOLUTE" value="false" />
</ADDITIONAL_INDENT_OPTIONS> </ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="sql">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="xml"> <ADDITIONAL_INDENT_OPTIONS fileType="xml">
<option name="INDENT_SIZE" value="4" /> <option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" /> <option name="CONTINUATION_INDENT_SIZE" value="8" />
@ -125,10 +38,10 @@
</ADDITIONAL_INDENT_OPTIONS> </ADDITIONAL_INDENT_OPTIONS>
</value> </value>
</option> </option>
<option name="USE_PER_PROJECT_SETTINGS" value="true" /> <option name="USE_PER_PROJECT_SETTINGS" value="false" />
</component> </component>
<component name="CompilerConfiguration"> <component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Eclipse" /> <option name="DEFAULT_COMPILER" value="Javac" />
<option name="DEPLOY_AFTER_MAKE" value="0" /> <option name="DEPLOY_AFTER_MAKE" value="0" />
<resourceExtensions> <resourceExtensions>
<entry name=".+\.(properties|xml|html|dtd|tld)" /> <entry name=".+\.(properties|xml|html|dtd|tld)" />
@ -150,6 +63,45 @@
<component name="CopyrightManager" default=""> <component name="CopyrightManager" default="">
<module2copyright /> <module2copyright />
</component> </component>
<component name="DaemonCodeAnalyzer">
<disable_hints />
</component>
<component name="DebuggerManager">
<breakpoint_any>
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="false" />
<option name="CLASS_FILTERS_ENABLED" value="false" />
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="false" />
<option name="CLASS_FILTERS_ENABLED" value="false" />
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
</breakpoint_any>
<breakpoint_rules />
<ui_properties />
</component>
<component name="DependencyValidationManager"> <component name="DependencyValidationManager">
<option name="SKIP_IMPORT_STATEMENTS" value="false" /> <option name="SKIP_IMPORT_STATEMENTS" value="false" />
</component> </component>
@ -160,42 +112,12 @@
<option name="ADDITIONAL_OPTIONS_STRING" value="" /> <option name="ADDITIONAL_OPTIONS_STRING" value="" />
<option name="MAXIMUM_HEAP_SIZE" value="128" /> <option name="MAXIMUM_HEAP_SIZE" value="128" />
</component> </component>
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false"> <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
<file url="file://$PROJECT_DIR$/fun-test-java/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java" charset="MacRoman" /> <component name="IdProvider" IDEtalkID="2862596AA5228405A3DA5AD8DF61584A" />
<file url="file://$PROJECT_DIR$/fun-test-java/src/test/java/se/scalablesolutions/akka/api/PersistentStateTest.java" charset="windows-1252" />
<file url="file://$PROJECT_DIR$/fun-test-java/src/test/java/se/scalablesolutions/akka/api/RemoteInMemoryStateTest.java" charset="MacRoman" />
<file url="file://$PROJECT_DIR$/fun-test-java/src/test/java/se/scalablesolutions/akka/api/RemotePersistentStateTest.java" charset="windows-1252" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/Kernel.scala" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/collection/HashTrie.scala" charset="windows-1252" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/collection/Vector.scala" charset="windows-1252" />
</component>
<component name="FacetAutodetectingManager">
<autodetection-disabled>
<facet-type id="web">
<modules>
<module name="akka-kernel" />
</modules>
</facet-type>
<facet-type id="Scala">
<modules>
<module name="akka">
<files>
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/camel/ActiveObjectComponent.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/camel/ActiveObjectConsumer.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/camel/ActiveObjectEndpoint.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/camel/ActiveObjectProducer.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/test/scala/CamelSpec.scala" />
</files>
</module>
</modules>
</facet-type>
</autodetection-disabled>
</component>
<component name="IdProvider" IDEtalkID="0E3A0445954D4D390C337AFB20B2746C" />
<component name="InspectionProjectProfileManager"> <component name="InspectionProjectProfileManager">
<option name="PROJECT_PROFILE" value="Project Default" /> <option name="PROJECT_PROFILE" value="Project Default" />
<option name="USE_PROJECT_LEVEL_SETTINGS" value="false" /> <option name="USE_PROJECT_PROFILE" value="true" />
<scopes /> <version value="1.0" />
<profiles> <profiles>
<profile version="1.0" is_locked="false"> <profile version="1.0" is_locked="false">
<option name="myName" value="Project Default" /> <option name="myName" value="Project Default" />
@ -203,9 +125,9 @@
</profile> </profile>
</profiles> </profiles>
<list size="4"> <list size="4">
<item index="0" class="java.lang.String" itemvalue="SERVER PROBLEM" /> <item index="0" class="java.lang.String" itemvalue="WARNING" />
<item index="1" class="java.lang.String" itemvalue="INFO" /> <item index="1" class="java.lang.String" itemvalue="SERVER PROBLEM" />
<item index="2" class="java.lang.String" itemvalue="WARNING" /> <item index="2" class="java.lang.String" itemvalue="INFO" />
<item index="3" class="java.lang.String" itemvalue="ERROR" /> <item index="3" class="java.lang.String" itemvalue="ERROR" />
</list> </list>
</component> </component>
@ -245,9 +167,15 @@
<option name="originalFiles"> <option name="originalFiles">
<list> <list>
<option value="$PROJECT_DIR$/pom.xml" /> <option value="$PROJECT_DIR$/pom.xml" />
<option value="$PROJECT_DIR$/pom.xml" />
<option value="$PROJECT_DIR$/fun-test-java/pom.xml" />
</list> </list>
</option> </option>
</component> </component>
<component name="ModuleEditorState">
<option name="LAST_EDITED_MODULE_NAME" />
<option name="LAST_EDITED_TAB_NAME" />
</component>
<component name="Palette2"> <component name="Palette2">
<group name="Swing"> <group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
@ -374,18 +302,31 @@
</component> </component>
<component name="ProjectFileVersion" converted="true" /> <component name="ProjectFileVersion" converted="true" />
<component name="ProjectKey"> <component name="ProjectKey">
<option name="state" value="project:///Users/jboner/src/scala/akka/akka.ipr" /> <option name="state" value="project://default" />
</component>
<component name="ProjectLevelVcsManager">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component> </component>
<component name="ProjectModuleManager"> <component name="ProjectModuleManager">
<modules> <modules>
<module fileurl="file://$PROJECT_DIR$/akka.iml" filepath="$PROJECT_DIR$/akka.iml" /> <module fileurl="file://$PROJECT_DIR$/akka.iml" filepath="$PROJECT_DIR$/akka.iml" />
<module fileurl="file://$PROJECT_DIR$/fun-test-java/akka-funtest-java.iml" filepath="$PROJECT_DIR$/fun-test-java/akka-funtest-java.iml" /> <module fileurl="file://$PROJECT_DIR$/fun-test-java/akka-fun-test-java.iml" filepath="$PROJECT_DIR$/fun-test-java/akka-fun-test-java.iml" />
<module fileurl="file://$PROJECT_DIR$/kernel/akka-kernel.iml" filepath="$PROJECT_DIR$/kernel/akka-kernel.iml" /> <module fileurl="file://$PROJECT_DIR$/kernel/akka-kernel.iml" filepath="$PROJECT_DIR$/kernel/akka-kernel.iml" />
<module fileurl="file://$PROJECT_DIR$/util-java/akka-util-java.iml" filepath="$PROJECT_DIR$/util-java/akka-util-java.iml" /> <module fileurl="file://$PROJECT_DIR$/util-java/akka-util-java.iml" filepath="$PROJECT_DIR$/util-java/akka-util-java.iml" />
</modules> </modules>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK"> <component name="ProjectReloadState">
<output url="file://$PROJECT_DIR$/build" /> <option name="STATE" value="0" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component> </component>
<component name="ResourceManagerContainer"> <component name="ResourceManagerContainer">
<option name="myResourceBundles"> <option name="myResourceBundles">
@ -401,100 +342,140 @@
<option name="GENERATE_IIOP_STUBS" value="false" /> <option name="GENERATE_IIOP_STUBS" value="false" />
<option name="ADDITIONAL_OPTIONS_STRING" value="" /> <option name="ADDITIONAL_OPTIONS_STRING" value="" />
</component> </component>
<component name="SvnBranchConfigurationManager"> <component name="RunManager">
<option name="myVersion" value="124" /> <configuration default="true" type="Remote" factoryName="Remote">
<option name="mySupportsUserInfoFilter" value="true" /> <option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method>
<option name="AntTarget" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<module name="" />
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<method>
<option name="AntTarget" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit" enabled="false" merge="false" runner="emma">
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="ADDITIONAL_CLASS_PATH" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<method>
<option name="AntTarget" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<configuration default="true" type="Application" factoryName="Application" enabled="false" merge="false" runner="emma">
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method>
<option name="AntTarget" enabled="false" />
<option name="Make" enabled="true" />
<option name="Maven.BeforeRunTask" enabled="false" />
</method>
</configuration>
<list size="0" />
<configuration name="&lt;template&gt;" type="WebApp" default="true" selected="false">
<Host>localhost</Host>
<Port>5050</Port>
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false" />
<component name="SvnConfiguration">
<option name="USER" value="" />
<option name="PASSWORD" value="" />
<option name="LAST_MERGED_REVISION" />
<option name="UPDATE_RUN_STATUS" value="false" />
<option name="MERGE_DRY_RUN" value="false" />
<option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />
<option name="IGNORE_SPACES_IN_MERGE" value="false" />
<option name="DETECT_NESTED_COPIES" value="false" />
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
</component> </component>
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" /> <mapping directory="" vcs="" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component> </component>
<component name="WebServicesPlugin" addRequiredLibraries="true" /> <component name="WebServicesPlugin" addRequiredLibraries="true" />
<component name="XPathView.XPathProjectComponent">
<history />
<find-history />
</component>
<component name="libraryTable"> <component name="libraryTable">
<library name="Maven: org.apache.cassandra:cassandra:0.3.0-dev"> <library name="Maven: org.guiceyfruit:guice-core:2.0-SNAPSHOT">
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/cassandra/cassandra/0.3.0-dev/cassandra-0.3.0-dev.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-core/2.0-SNAPSHOT/guice-core-2.0-SNAPSHOT.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-core/2.0-SNAPSHOT/guice-core-2.0-SNAPSHOT-javadoc.jar!/" />
</JAVADOC>
<SOURCES> <SOURCES>
<root url="file://$PROJECT_DIR$/../../java/cassandra/src/java" /> <root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-core/2.0-SNAPSHOT/guice-core-2.0-SNAPSHOT-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
<library name="Akka Runtime Libs"> <library name="Maven: org.guiceyfruit:guice-jsr250:2.0-SNAPSHOT">
<CLASSES> <CLASSES>
<root url="jar://$PROJECT_DIR$/lib/grizzly-http-1.8.6.3.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-jsr250/2.0-SNAPSHOT/guice-jsr250-2.0-SNAPSHOT.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/slf4j-api-1.4.3.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/velocity-1.5.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/grizzly-rcm-1.8.6.3.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/commons-dbcp-1.2.2.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/grizzly-portunif-1.8.6.3.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/grizzly-framework-1.8.6.3.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jdom-1.0.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jaxb-api-2.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/guice-jsr250-2.0-SNAPSHOT.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/zookeeper-3.1.0.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/scalatest-0.9.5.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/camel-core-2.0-SNAPSHOT.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jersey-server-1.0.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/asm-3.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/configgy-1.2.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/commons-cli-1.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/akka-util-java.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/rome-0.9.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/log4j-1.2.15.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jsr311-api-1.0.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/grizzly-http-servlet-1.8.6.3.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/commons-javaflow-1.0-SNAPSHOT.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/voldemort-0.4a.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/junit-4.5.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/commons-httpclient-3.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/stax-api-1.0-2.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/scala-library-2.7.3.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/grizzly-servlet-webserver-1.8.6.3.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/cglib-2.2.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jetty-6.1.6rc0.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/cassandra-0.3.0-dev.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jersey-json-1.0.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jersey-atom-1.0.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/grizzly-http-utils-1.8.6.3.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/voldemort-contrib-0.4a.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/commons-lang-2.4.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/xerces.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/libfb303.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/protobuf-java-2.0.3.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/colt-1.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/je-3.3.62.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/asm-all-2.2.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/catalina-ant.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/mina-core-2.0.0-M2-SNAPSHOT.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/slf4j-log4j12-1.4.3.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jersey-core-1.0.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/JSAP-2.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/activation-1.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/guice-core-2.0-SNAPSHOT.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/pcj.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/libthrift.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/commons-logging-1.0.4.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/commons-codec-1.3.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jaxb-impl-2.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/commons-collections-3.2.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jetty-util-6.1.6rc0.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/servlet-api-2.5.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/commons-pool-1.4.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/lucene-core-2.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jsr250-api-1.0.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/aopalliance-1.0.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/stringtemplate-3.0.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jettison-1.0.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/high-scale-lib.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/google-collect-snapshot-20090211.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/mina-integration-scala-2.0.0-M2-SNAPSHOT.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/junit4runner-1.0.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/commons-io-1.3.2.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/commons-math-1.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/antlr-3.1.3.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC>
<SOURCES /> <root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-jsr250/2.0-SNAPSHOT/guice-jsr250-2.0-SNAPSHOT-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-jsr250/2.0-SNAPSHOT/guice-jsr250-2.0-SNAPSHOT-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: javax.annotation:jsr250-api:1.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/javax/annotation/jsr250-api/1.0/jsr250-api-1.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/javax/annotation/jsr250-api/1.0/jsr250-api-1.0-sources.jar!/" />
</SOURCES>
</library> </library>
<library name="Maven: org.guiceyfruit:guice-core:2.0-beta-4"> <library name="Maven: org.guiceyfruit:guice-core:2.0-beta-4">
<CLASSES> <CLASSES>
@ -518,17 +499,6 @@
<root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-jsr250/2.0-beta-4/guice-jsr250-2.0-beta-4-sources.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-jsr250/2.0-beta-4/guice-jsr250-2.0-beta-4-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
<library name="Maven: javax.annotation:jsr250-api:1.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/javax/annotation/jsr250-api/1.0/jsr250-api-1.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/javax/annotation/jsr250-api/1.0/jsr250-api-1.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: org.scala-lang:scala-library:2.7.4"> <library name="Maven: org.scala-lang:scala-library:2.7.4">
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/scala-lang/scala-library/2.7.4/scala-library-2.7.4.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/org/scala-lang/scala-library/2.7.4/scala-library-2.7.4.jar!/" />
@ -771,6 +741,17 @@
<root url="jar://$MAVEN_REPOSITORY$/com/sun/xml/bind/jaxb-impl/2.1.10/jaxb-impl-2.1.10-sources.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/sun/xml/bind/jaxb-impl/2.1.10/jaxb-impl-2.1.10-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
<library name="Maven: org.jboss.netty:netty:3.1.0.CR1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/netty/netty/3.1.0.CR1/netty-3.1.0.CR1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/netty/netty/3.1.0.CR1/netty-3.1.0.CR1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/netty/netty/3.1.0.CR1/netty-3.1.0.CR1-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: com.sun.grizzly:grizzly-servlet-webserver:1.9.9"> <library name="Maven: com.sun.grizzly:grizzly-servlet-webserver:1.9.9">
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/sun/grizzly/grizzly-servlet-webserver/1.9.9/grizzly-servlet-webserver-1.9.9.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/sun/grizzly/grizzly-servlet-webserver/1.9.9/grizzly-servlet-webserver-1.9.9.jar!/" />
@ -1024,6 +1005,17 @@
<root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-servlet/2.0-beta-6/guice-servlet-2.0-beta-6-sources.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-servlet/2.0-beta-6/guice-servlet-2.0-beta-6-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
<library name="Maven: org.apache.cassandra:cassandra:0.3.0-dev">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/cassandra/cassandra/0.3.0-dev/cassandra-0.3.0-dev.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/cassandra/cassandra/0.3.0-dev/cassandra-0.3.0-dev-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/cassandra/cassandra/0.3.0-dev/cassandra-0.3.0-dev-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: com.facebook:thrift:1.0"> <library name="Maven: com.facebook:thrift:1.0">
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/facebook/thrift/1.0/thrift-1.0.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/facebook/thrift/1.0/thrift-1.0.jar!/" />
@ -1145,28 +1137,6 @@
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-library/1.1/hamcrest-library-1.1-sources.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-library/1.1/hamcrest-library-1.1-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
<library name="Maven: org.guiceyfruit:guice-core:2.0-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-core/2.0-SNAPSHOT/guice-core-2.0-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-core/2.0-SNAPSHOT/guice-core-2.0-SNAPSHOT-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-core/2.0-SNAPSHOT/guice-core-2.0-SNAPSHOT-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: org.guiceyfruit:guice-jsr250:2.0-SNAPSHOT">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-jsr250/2.0-SNAPSHOT/guice-jsr250-2.0-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-jsr250/2.0-SNAPSHOT/guice-jsr250-2.0-SNAPSHOT-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-jsr250/2.0-SNAPSHOT/guice-jsr250-2.0-SNAPSHOT-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: com.sun.xml.bind:jaxb-impl:2.1.6"> <library name="Maven: com.sun.xml.bind:jaxb-impl:2.1.6">
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/sun/xml/bind/jaxb-impl/2.1.6/jaxb-impl-2.1.6.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/sun/xml/bind/jaxb-impl/2.1.6/jaxb-impl-2.1.6.jar!/" />
@ -1200,17 +1170,6 @@
<root url="jar://$MAVEN_REPOSITORY$/com/jteigen/scalatest/junit4runner/1.0/junit4runner-1.0-sources.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/com/jteigen/scalatest/junit4runner/1.0/junit4runner-1.0-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
<library name="Maven: org.jboss.netty:netty:3.1.0.CR1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/netty/netty/3.1.0.CR1/netty-3.1.0.CR1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/netty/netty/3.1.0.CR1/netty-3.1.0.CR1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/netty/netty/3.1.0.CR1/netty-3.1.0.CR1-sources.jar!/" />
</SOURCES>
</library>
</component> </component>
<UsedPathMacros> <UsedPathMacros>
<macro name="MAVEN_REPOSITORY" description="Maven Local Repostiry" /> <macro name="MAVEN_REPOSITORY" description="Maven Local Repostiry" />

2555
akka.iws

File diff suppressed because it is too large Load diff

View file

@ -9,17 +9,6 @@
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="file://$MODULE_DIR$/../config" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guiceyfruit-core:2.0-beta-7" level="project" />
<orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guice-all:2.0-beta-7" level="project" />
<orderEntry type="module" module-name="akka-kernel" exported="" /> <orderEntry type="module" module-name="akka-kernel" exported="" />
<orderEntry type="module" module-name="akka-util-java" exported="" /> <orderEntry type="module" module-name="akka-util-java" exported="" />
<orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guice-core:2.0-beta-4" level="project" /> <orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guice-core:2.0-beta-4" level="project" />
@ -31,7 +20,7 @@
<orderEntry type="library" exported="" name="Maven: org.scala-lang:scala-compiler:2.7.4" level="project" /> <orderEntry type="library" exported="" name="Maven: org.scala-lang:scala-compiler:2.7.4" level="project" />
<orderEntry type="library" exported="" name="Maven: org.scala-tools:vscaladoc:1.1-md-3" level="project" /> <orderEntry type="library" exported="" name="Maven: org.scala-tools:vscaladoc:1.1-md-3" level="project" />
<orderEntry type="library" exported="" name="Maven: markdownj:markdownj:1.0.2b4-0.3.0" level="project" /> <orderEntry type="library" exported="" name="Maven: markdownj:markdownj:1.0.2b4-0.3.0" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.5" level="project" /> <orderEntry type="library" exported="" name="Maven: junit:junit:4.5" level="project" />
<orderEntry type="library" exported="" name="Maven: org.scala-tools.testing:specs:1.4.4" level="project" /> <orderEntry type="library" exported="" name="Maven: org.scala-tools.testing:specs:1.4.4" level="project" />
<orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guiceyfruit-core:2.0" level="project" /> <orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guiceyfruit-core:2.0" level="project" />
<orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guice-all:2.0" level="project" /> <orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guice-all:2.0" level="project" />

View file

@ -8,7 +8,6 @@ import org.junit.*;
import static org.junit.Assert.*; import static org.junit.Assert.*;
import junit.framework.TestSuite; import junit.framework.TestSuite;
import se.scalablesolutions.akka.kernel.nio.ProxyServer;
public class NioTest extends TestSuite { public class NioTest extends TestSuite {
@ -22,9 +21,6 @@ public class NioTest extends TestSuite {
@Test @Test
public void simpleRequestReply() { public void simpleRequestReply() {
ProxyServer server = new ProxyServer();
server.start();
} }

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/scala"/> <classpathentry including="**/*.scala" kind="src" output="target/test-classes" path="src/test/scala"/>
<classpathentry including="**/*.java" kind="src" path="src/main/scala"/> <classpathentry including="**/*.scala" kind="src" path="src/main/scala"/>
<classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/> <classpathentry excluding="**/*.scala" kind="src" path="src/main/resources"/>
<classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar" sourcepath="M2_REPO/javax/activation/activation/1.1/activation-1.1-sources.jar"/> <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar" sourcepath="M2_REPO/javax/activation/activation/1.1/activation-1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar" sourcepath="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1-sources.jar"/> <classpathentry kind="var" path="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar" sourcepath="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar" sourcepath="M2_REPO/javax/annotation/jsr250-api/1.0/jsr250-api-1.0-sources.jar"/> <classpathentry kind="var" path="M2_REPO/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar" sourcepath="M2_REPO/javax/annotation/jsr250-api/1.0/jsr250-api-1.0-sources.jar"/>
@ -41,14 +41,13 @@
<classpathentry kind="var" path="M2_REPO/com/assembla/scala/mina/mina-integration-scala/2.0.0-M2-SNAPSHOT/mina-integration-scala-2.0.0-M2-SNAPSHOT.jar" sourcepath="M2_REPO/com/assembla/scala/mina/mina-integration-scala/2.0.0-M2-SNAPSHOT/mina-integration-scala-2.0.0-M2-SNAPSHOT-sources.jar"/> <classpathentry kind="var" path="M2_REPO/com/assembla/scala/mina/mina-integration-scala/2.0.0-M2-SNAPSHOT/mina-integration-scala-2.0.0-M2-SNAPSHOT.jar" sourcepath="M2_REPO/com/assembla/scala/mina/mina-integration-scala/2.0.0-M2-SNAPSHOT/mina-integration-scala-2.0.0-M2-SNAPSHOT-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/netty/netty/3.1.0.BETA2/netty-3.1.0.BETA2.jar" sourcepath="M2_REPO/org/jboss/netty/netty/3.1.0.BETA2/netty-3.1.0.BETA2-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/jboss/netty/netty/3.1.0.BETA2/netty-3.1.0.BETA2.jar" sourcepath="M2_REPO/org/jboss/netty/netty/3.1.0.BETA2/netty-3.1.0.BETA2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/rome/rome/0.9/rome-0.9.jar" sourcepath="M2_REPO/rome/rome/0.9/rome-0.9-sources.jar"/> <classpathentry kind="var" path="M2_REPO/rome/rome/0.9/rome-0.9.jar" sourcepath="M2_REPO/rome/rome/0.9/rome-0.9-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/scala-lang/scala-library/2.7.3/scala-library-2.7.3.jar" sourcepath="M2_REPO/org/scala-lang/scala-library/2.7.3/scala-library-2.7.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/scala-tools/testing/scalatest/0.9.5/scalatest-0.9.5.jar"/> <classpathentry kind="var" path="M2_REPO/org/scala-tools/testing/scalatest/0.9.5/scalatest-0.9.5.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.4.3/slf4j-api-1.4.3.jar" sourcepath="M2_REPO/org/slf4j/slf4j-api/1.4.3/slf4j-api-1.4.3-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.4.3/slf4j-api-1.4.3.jar" sourcepath="M2_REPO/org/slf4j/slf4j-api/1.4.3/slf4j-api-1.4.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.4.3/slf4j-log4j12-1.4.3.jar" sourcepath="M2_REPO/org/slf4j/slf4j-log4j12/1.4.3/slf4j-log4j12-1.4.3-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.4.3/slf4j-log4j12-1.4.3.jar" sourcepath="M2_REPO/org/slf4j/slf4j-log4j12/1.4.3/slf4j-log4j12-1.4.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0.1/stax-api-1.0.1.jar"/> <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0.1/stax-api-1.0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/com/facebook/thrift/1.0/thrift-1.0.jar"/> <classpathentry kind="var" path="M2_REPO/com/facebook/thrift/1.0/thrift-1.0.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="ch.epfl.lamp.sdt.launching.SCALA_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/akka-util-java"/> <classpathentry combineaccessrules="false" kind="src" path="/akka-util-java"/>
<classpathentry kind="con" path="ch.epfl.lamp.sdt.launching.SCALA_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

View file

@ -1,16 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>akka-kernel</name> <name>akka-kernel</name>
<comment/> <comment></comment>
<projects> <projects>
<project>akka-util-java</project> <project>akka-util-java</project>
</projects> </projects>
<buildSpec> <buildSpec>
<buildCommand> <buildCommand>
<name>ch.epfl.lamp.sdt.core.scalabuilder</name> <name>ch.epfl.lamp.sdt.core.scalabuilder</name>
<arguments>
</arguments>
</buildCommand> </buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>ch.epfl.lamp.sdt.core.scalanature</nature> <nature>ch.epfl.lamp.sdt.core.scalanature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures> </natures>
</projectDescription> </projectDescription>

View file

@ -1,29 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module relativePaths="true" MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> <module relativePaths="true" MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager"> <component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/web.xml" optional="false" version="2.5" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/src/main/resources" relative="/" />
</webroots>
<building>
<setting name="EXPLODED_URL" value="file://" />
<setting name="EXPLODED_ENABLED" value="false" />
<setting name="JAR_URL" value="file://" />
<setting name="JAR_ENABLED" value="false" />
<setting name="EXCLUDE_EXPLODED_DIRECTORY" value="true" />
</building>
<packaging>
<containerElement type="module" name="akka-kernel">
<attribute name="method" value="1" />
<attribute name="URI" value="/WEB-INF/classes" />
</containerElement>
</packaging>
</configuration>
</facet>
<facet type="Scala" name="Scala"> <facet type="Scala" name="Scala">
<configuration /> <configuration />
</facet> </facet>
@ -35,61 +12,9 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/scala" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/scala" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/scala" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/scala" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="Scala 2.7.3">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../bin/scala-2.7.3.final/lib/scala-compiler.jar!/" />
<root url="jar://$MODULE_DIR$/../../../../bin/scala-2.7.3.final/lib/scala-library.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/../../../../bin/scala-2.7.3.final/src/scala-compiler-src.jar!/" />
<root url="jar://$MODULE_DIR$/../../../../bin/scala-2.7.3.final/src/scala-library-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../lib/junit4runner-1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../lib/junit-4.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$APPLICATION_HOME_DIR$/lib/javaee.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="aspectwerkz 2.1">
<CLASSES>
<root url="jar://$MODULE_DIR$/../lib/aspectwerkz-nodeps-jdk5-2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$MODULE_DIR$/../../../java/aspectwerkz4/src/main" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module" module-name="akka-util-java" exported="" /> <orderEntry type="module" module-name="akka-util-java" exported="" />
<orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guice-core:2.0-beta-4" level="project" /> <orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guice-core:2.0-beta-4" level="project" />
<orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guice-jsr250:2.0-beta-4" level="project" /> <orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guice-jsr250:2.0-beta-4" level="project" />
@ -100,7 +25,7 @@
<orderEntry type="library" exported="" name="Maven: org.scala-lang:scala-compiler:2.7.4" level="project" /> <orderEntry type="library" exported="" name="Maven: org.scala-lang:scala-compiler:2.7.4" level="project" />
<orderEntry type="library" exported="" name="Maven: org.scala-tools:vscaladoc:1.1-md-3" level="project" /> <orderEntry type="library" exported="" name="Maven: org.scala-tools:vscaladoc:1.1-md-3" level="project" />
<orderEntry type="library" exported="" name="Maven: markdownj:markdownj:1.0.2b4-0.3.0" level="project" /> <orderEntry type="library" exported="" name="Maven: markdownj:markdownj:1.0.2b4-0.3.0" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.5" level="project" /> <orderEntry type="library" exported="" name="Maven: junit:junit:4.5" level="project" />
<orderEntry type="library" exported="" name="Maven: org.scala-tools.testing:specs:1.4.4" level="project" /> <orderEntry type="library" exported="" name="Maven: org.scala-tools.testing:specs:1.4.4" level="project" />
<orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guiceyfruit-core:2.0" level="project" /> <orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guiceyfruit-core:2.0" level="project" />
<orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guice-all:2.0" level="project" /> <orderEntry type="library" exported="" name="Maven: org.guiceyfruit:guice-all:2.0" level="project" />
@ -151,6 +76,15 @@
<orderEntry type="library" exported="" name="Maven: log4j:log4j:1.2.13" level="project" /> <orderEntry type="library" exported="" name="Maven: log4j:log4j:1.2.13" level="project" />
<orderEntry type="library" name="Maven: org.scala-tools.testing:scalatest:0.9.5" level="project" /> <orderEntry type="library" name="Maven: org.scala-tools.testing:scalatest:0.9.5" level="project" />
<orderEntry type="library" name="Maven: com.jteigen.scalatest:junit4runner:1.0" level="project" /> <orderEntry type="library" name="Maven: com.jteigen.scalatest:junit4runner:1.0" level="project" />
<orderEntry type="module-library">
<library name="$MODULE_DIR$/../util-java/target">
<CLASSES>
<root url="jar://$MODULE_DIR$/../util-java/target/akka-util-java-0.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component> </component>
</module> </module>

View file

@ -145,7 +145,7 @@ object ActiveObject {
private def localDispatch(joinpoint: JoinPoint): AnyRef = { private def localDispatch(joinpoint: JoinPoint): AnyRef = {
val rtti = joinpoint.getRtti.asInstanceOf[MethodRtti] val rtti = joinpoint.getRtti.asInstanceOf[MethodRtti]
if (isOneWay(rtti)) actor !! Invocation(joinpoint) // FIXME investigate why ! causes TX to race if (isOneWay(rtti)) actor ! Invocation(joinpoint)
else { else {
val result = actor !! Invocation(joinpoint) val result = actor !! Invocation(joinpoint)
if (result.isDefined) result.get if (result.isDefined) result.get
@ -160,10 +160,12 @@ object ActiveObject {
new RemoteRequest(false, rtti.getParameterValues, rtti.getMethod.getName, target.getName, None, oneWay, false)) new RemoteRequest(false, rtti.getParameterValues, rtti.getMethod.getName, target.getName, None, oneWay, false))
if (oneWay) null // for void methods if (oneWay) null // for void methods
else { else {
future.await if (future.isDefined) {
val result = getResultOrThrowException(future) future.get.await
val result = getResultOrThrowException(future.get)
if (result.isDefined) result.get if (result.isDefined) result.get
else throw new IllegalStateException("No result defined for invocation [" + joinpoint + "]") else throw new IllegalStateException("No result returned from call to [" + joinpoint + "]")
} else throw new IllegalStateException("No future returned from call to [" + joinpoint + "]")
} }
} }
@ -173,7 +175,9 @@ object ActiveObject {
throw cause throw cause
} else future.result.asInstanceOf[Option[T]] } else future.result.asInstanceOf[Option[T]]
private def isOneWay(rtti: MethodRtti) = rtti.getMethod.getReturnType == java.lang.Void.TYPE private def isOneWay(rtti: MethodRtti) =
rtti.getMethod.isAnnotationPresent(Annotations.oneway) // FIXME investigate why @oneway causes TX to race
//rtti.getMethod.getReturnType == java.lang.Void.TYPE
} }
/** /**

View file

@ -125,9 +125,9 @@ trait Actor extends Logging with TransactionManagement {
/** /**
* TODO: document * TODO: document
*/ */
def !(message: AnyRef) = if (isRunning) { def !(message: AnyRef): Unit = if (isRunning) {
if (isRemote) NettyClient.send(new RemoteRequest(true, message, null, this.getClass.getName, null, true, false)) if (TransactionManagement.isTransactionalityEnabled) transactionalDispatch(message, timeout, false, true)
else mailbox.append(new MessageHandle(this, message, new NullFutureResult, activeTx)) else postMessageToMailbox(message)
} else throw new IllegalStateException("Actor has not been started, you need to invoke 'actor.start' before using it") } else throw new IllegalStateException("Actor has not been started, you need to invoke 'actor.start' before using it")
/** /**
@ -135,7 +135,7 @@ trait Actor extends Logging with TransactionManagement {
*/ */
def !![T](message: AnyRef, timeout: Long): Option[T] = if (isRunning) { def !![T](message: AnyRef, timeout: Long): Option[T] = if (isRunning) {
if (TransactionManagement.isTransactionalityEnabled) { if (TransactionManagement.isTransactionalityEnabled) {
transactionalDispatch(message, timeout, false) transactionalDispatch(message, timeout, false, false)
} else { } else {
val future = postMessageToMailboxAndCreateFutureResultWithTimeout(message, timeout) val future = postMessageToMailboxAndCreateFutureResultWithTimeout(message, timeout)
future.await future.await
@ -153,7 +153,7 @@ trait Actor extends Logging with TransactionManagement {
*/ */
def !?[T](message: AnyRef): T = if (isRunning) { def !?[T](message: AnyRef): T = if (isRunning) {
if (TransactionManagement.isTransactionalityEnabled) { if (TransactionManagement.isTransactionalityEnabled) {
transactionalDispatch(message, 0, true).get transactionalDispatch(message, 0, true, false).get
} else { } else {
val future = postMessageToMailboxAndCreateFutureResultWithTimeout(message, 0) val future = postMessageToMailboxAndCreateFutureResultWithTimeout(message, 0)
future.awaitBlocking future.awaitBlocking
@ -165,7 +165,7 @@ trait Actor extends Logging with TransactionManagement {
* TODO: document * TODO: document
*/ */
protected[this] def reply(message: AnyRef) = senderFuture match { protected[this] def reply(message: AnyRef) = senderFuture match {
case None => throw new IllegalStateException("No sender future in scope, can't reply. Have you used '!' (async, fire-and-forget)? If so, switch to '!!' which will return a future to wait on." ) case None => throw new IllegalStateException("No sender in scope, can't reply. Have you used '!' (async, fire-and-forget)? If so, switch to '!!' which will return a future to wait on." )
case Some(future) => future.completeWithResult(message) case Some(future) => future.completeWithResult(message)
} }
@ -293,34 +293,50 @@ trait Actor extends Logging with TransactionManagement {
try { try {
if (messageHandle.tx.isDefined) if (messageHandle.tx.isDefined)
TransactionManagement.threadBoundTx.set(messageHandle.tx) TransactionManagement.threadBoundTx.set(messageHandle.tx)
senderFuture = Some(future) senderFuture = future
if (base.isDefinedAt(message)) base(message) // invoke user actor's receive partial function if (base.isDefinedAt(message)) base(message) // invoke user actor's receive partial function
else throw new IllegalArgumentException("No handler matching message [" + message + "] in actor [" + this.getClass.getName + "]") else throw new IllegalArgumentException("No handler matching message [" + message + "] in " + toString)
} catch { } catch {
case e => case e =>
if (supervisor.isDefined) supervisor.get ! Exit(this, e) if (supervisor.isDefined) supervisor.get ! Exit(this, e)
future.completeWithException(this, e) if (future.isDefined) future.get.completeWithException(this, e)
else e.printStackTrace
} finally {
TransactionManagement.threadBoundTx.set(None)
} }
} }
private def postMessageToMailbox(message: AnyRef): Unit =
if (isRemote) NettyClient.send(new RemoteRequest(true, message, null, this.getClass.getName, null, true, false))
else mailbox.append(new MessageHandle(this, message, None, activeTx))
private def postMessageToMailboxAndCreateFutureResultWithTimeout(message: AnyRef, timeout: Long): CompletableFutureResult = private def postMessageToMailboxAndCreateFutureResultWithTimeout(message: AnyRef, timeout: Long): CompletableFutureResult =
if (isRemote) NettyClient.send(new RemoteRequest(true, message, null, this.getClass.getName, null, false, false)) if (isRemote) {
val future = NettyClient.send(new RemoteRequest(true, message, null, this.getClass.getName, null, false, false))
if (future.isDefined) future.get
else throw new IllegalStateException("Expected a future from remote call to actor " + toString)
}
else { else {
val future = new DefaultCompletableFutureResult(timeout) val future = new DefaultCompletableFutureResult(timeout)
mailbox.append(new MessageHandle(this, message, future, TransactionManagement.threadBoundTx.get)) mailbox.append(new MessageHandle(this, message, Some(future), TransactionManagement.threadBoundTx.get))
future future
} }
private def transactionalDispatch[T](message: AnyRef, timeout: Long, blocking: Boolean): Option[T] = { private def transactionalDispatch[T](message: AnyRef, timeout: Long, blocking: Boolean, oneWay: Boolean): Option[T] = {
tryToCommitTransaction tryToCommitTransaction
if (isInExistingTransaction) joinExistingTransaction if (isInExistingTransaction) joinExistingTransaction
else if (isTransactional) startNewTransaction else if (isTransactional) startNewTransaction
incrementTransaction incrementTransaction
try { try {
if (oneWay) {
postMessageToMailbox(message)
None
} else {
val future = postMessageToMailboxAndCreateFutureResultWithTimeout(message, timeout) val future = postMessageToMailboxAndCreateFutureResultWithTimeout(message, timeout)
if (blocking) future.awaitBlocking if (blocking) future.awaitBlocking
else future.await else future.await
getResultOrThrowException(future) getResultOrThrowException(future)
}
} catch { } catch {
case e: TransactionAwareWrapperException => case e: TransactionAwareWrapperException =>
e.cause.printStackTrace e.cause.printStackTrace

View file

@ -5,11 +5,10 @@
package se.scalablesolutions.akka.kernel.nio package se.scalablesolutions.akka.kernel.nio
import java.net.InetSocketAddress import java.net.InetSocketAddress
import java.util.concurrent.atomic.AtomicLong
import java.util.concurrent.{Executors, ConcurrentMap, ConcurrentHashMap} import java.util.concurrent.{Executors, ConcurrentMap, ConcurrentHashMap}
import kernel.reactor.{NullFutureResult, DefaultCompletableFutureResult, CompletableFutureResult} import kernel.reactor.{DefaultCompletableFutureResult, CompletableFutureResult}
import kernel.util.{HashCode, Logging}; import kernel.util.Logging
import org.jboss.netty.handler.codec.serialization.{ObjectEncoder, ObjectDecoder} import org.jboss.netty.handler.codec.serialization.{ObjectEncoder, ObjectDecoder}
import org.jboss.netty.bootstrap.ClientBootstrap import org.jboss.netty.bootstrap.ClientBootstrap
@ -58,17 +57,17 @@ object NettyClient extends Logging {
} }
} }
def send(request: RemoteRequest): CompletableFutureResult = if (isRunning) { def send(request: RemoteRequest): Option[CompletableFutureResult] = if (isRunning) {
val escapedRequest = escapeRequest(request) val escapedRequest = escapeRequest(request)
if (escapedRequest.isOneWay) { if (escapedRequest.isOneWay) {
connection.getChannel.write(escapedRequest) connection.getChannel.write(escapedRequest)
new NullFutureResult None
} else { } else {
futures.synchronized { futures.synchronized {
val futureResult = new DefaultCompletableFutureResult(100000) val futureResult = new DefaultCompletableFutureResult(100000)
futures.put(request.id, futureResult) futures.put(request.id, futureResult)
connection.getChannel.write(escapedRequest) connection.getChannel.write(escapedRequest)
futureResult Some(futureResult)
} }
} }
} else throw new IllegalStateException("Netty client is not running, make sure you have invoked 'connect' before using the client") } else throw new IllegalStateException("Netty client is not running, make sure you have invoked 'connect' before using the client")
@ -121,6 +120,7 @@ class ObjectClientHandler(val futures: ConcurrentMap[Long, CompletableFutureResu
//if (reply.successful) future.completeWithResult((reply.message, tx)) //if (reply.successful) future.completeWithResult((reply.message, tx))
if (reply.successful) future.completeWithResult(reply.message) if (reply.successful) future.completeWithResult(reply.message)
else future.completeWithException(null, reply.exception) else future.completeWithException(null, reply.exception)
futures.remove(reply.id)
} else throw new IllegalArgumentException("Unknown message received in NIO client handler: " + result) } else throw new IllegalArgumentException("Unknown message received in NIO client handler: " + result)
} catch { } catch {
case e: Exception => log.error("Unexpected exception in NIO client handler: %s", e); throw e case e: Exception => log.error("Unexpected exception in NIO client handler: %s", e); throw e

View file

@ -60,7 +60,7 @@ object NettyServer extends Logging {
} }
} }
@ChannelPipelineCoverage {val value = "all"} @ChannelPipelineCoverage { val value = "all" }
class ObjectServerHandler extends SimpleChannelUpstreamHandler with Logging { class ObjectServerHandler extends SimpleChannelUpstreamHandler with Logging {
private val activeObjectFactory = new ActiveObjectFactory private val activeObjectFactory = new ActiveObjectFactory
private val activeObjects = new ConcurrentHashMap[String, AnyRef] private val activeObjects = new ConcurrentHashMap[String, AnyRef]

View file

@ -117,15 +117,3 @@ class DefaultCompletableFutureResult(timeout: Long) extends CompletableFutureRes
private def currentTimeInNanos: Long = TIME_UNIT.toNanos(System.currentTimeMillis) private def currentTimeInNanos: Long = TIME_UNIT.toNanos(System.currentTimeMillis)
} }
class NullFutureResult extends CompletableFutureResult {
def completeWithResult(result: AnyRef) = {}
def completeWithException(toBlame: AnyRef, exception: Throwable) = {}
def await = throw new UnsupportedOperationException("Not implemented for NullFutureResult")
def awaitBlocking = throw new UnsupportedOperationException("Not implemented for NullFutureResult")
def isCompleted: Boolean = throw new UnsupportedOperationException("Not implemented for NullFutureResult")
def isExpired: Boolean = throw new UnsupportedOperationException("Not implemented for NullFutureResult")
def timeoutInNanos: Long = throw new UnsupportedOperationException("Not implemented for NullFutureResult")
def result: Option[AnyRef] = None
def exception: Option[Tuple2[AnyRef, Throwable]] = None
}

View file

@ -33,18 +33,20 @@ class ProxyMessageDispatcher extends MessageDispatcherBase {
guard.synchronized { /* empty */ } // prevents risk for deadlock as described in [http://developers.sun.com/learning/javaoneonline/2006/coreplatform/TS-1315.pdf] guard.synchronized { /* empty */ } // prevents risk for deadlock as described in [http://developers.sun.com/learning/javaoneonline/2006/coreplatform/TS-1315.pdf]
try { try {
messageDemultiplexer.select messageDemultiplexer.select
} catch {case e: InterruptedException => active = false} } catch { case e: InterruptedException => active = false }
val queue = messageDemultiplexer.acquireSelectedQueue val queue = messageDemultiplexer.acquireSelectedQueue
for (index <- 0 until queue.size) { for (index <- 0 until queue.size) {
val handle = queue.remove val handle = queue.remove
handlerExecutor.execute(new Runnable { handlerExecutor.execute(new Runnable {
val invocation = handle.message.asInstanceOf[Invocation] val invocation = handle.message.asInstanceOf[Invocation]
override def run = { override def run = {
val future = handle.future
try { try {
val result = invocation.joinpoint.proceed val result = invocation.joinpoint.proceed
handle.future.completeWithResult(result) if (future.isDefined) future.get.completeWithResult(result)
} catch { } catch {
case e: Exception => handle.future.completeWithException(invocation.joinpoint.getTarget, e) case e: Exception =>
if (future.isDefined) future.get.completeWithException(invocation.joinpoint.getTarget, e)
} }
messageDemultiplexer.wakeUp messageDemultiplexer.wakeUp
} }

View file

@ -36,14 +36,14 @@ trait MessageDemultiplexer {
class MessageHandle(val sender: AnyRef, class MessageHandle(val sender: AnyRef,
val message: AnyRef, val message: AnyRef,
val future: CompletableFutureResult, val future: Option[CompletableFutureResult],
val tx: Option[Transaction]) { val tx: Option[Transaction]) {
override def hashCode(): Int = { override def hashCode(): Int = {
var result = HashCode.SEED var result = HashCode.SEED
result = HashCode.hash(result, sender) result = HashCode.hash(result, sender)
result = HashCode.hash(result, message) result = HashCode.hash(result, message)
result = HashCode.hash(result, future) result = if (future.isDefined) HashCode.hash(result, future.get) else result
result = if (tx.isDefined) HashCode.hash(result, tx.get.id) else result result = if (tx.isDefined) HashCode.hash(result, tx.get.id) else result
result result
} }
@ -53,7 +53,8 @@ class MessageHandle(val sender: AnyRef,
that.isInstanceOf[MessageHandle] && that.isInstanceOf[MessageHandle] &&
that.asInstanceOf[MessageHandle].sender == sender && that.asInstanceOf[MessageHandle].sender == sender &&
that.asInstanceOf[MessageHandle].message == message && that.asInstanceOf[MessageHandle].message == message &&
that.asInstanceOf[MessageHandle].future == future && that.asInstanceOf[MessageHandle].future.isDefined == future.isDefined &&
that.asInstanceOf[MessageHandle].future.get == future.get &&
that.asInstanceOf[MessageHandle].tx.isDefined == tx.isDefined && that.asInstanceOf[MessageHandle].tx.isDefined == tx.isDefined &&
that.asInstanceOf[MessageHandle].tx.get.id == tx.get.id that.asInstanceOf[MessageHandle].tx.get.id == tx.get.id
} }

View file

@ -59,7 +59,7 @@ object TransactionIdFactory {
def begin(participant: String) = synchronized { def begin(participant: String) = synchronized {
ensureIsActiveOrNew ensureIsActiveOrNew
if (status == TransactionStatus.New) log.debug("TX BEGIN - Server [%s] is starting NEW transaction [%s]", participant, this) if (status == TransactionStatus.New) log.debug("TX BEGIN - Server [%s] is starting NEW transaction [%s]", participant, toString)
else log.debug("Server [%s] is participating in transaction", participant) else log.debug("Server [%s] is participating in transaction", participant)
participants ::= participant participants ::= participant
status = TransactionStatus.Active status = TransactionStatus.Active
@ -67,14 +67,14 @@ object TransactionIdFactory {
def precommit(participant: String) = synchronized { def precommit(participant: String) = synchronized {
if (status == TransactionStatus.Active) { if (status == TransactionStatus.Active) {
log.debug("TX PRECOMMIT - Pre-committing transaction [%s] for server [%s]", this, participant) log.debug("TX PRECOMMIT - Pre-committing transaction [%s] for server [%s]", toString, participant)
precommitted ::= participant precommitted ::= participant
} }
} }
def commit(participant: String) = synchronized { def commit(participant: String) = synchronized {
if (status == TransactionStatus.Active) { if (status == TransactionStatus.Active) {
log.debug("TX COMMIT - Committing transaction [%s] for server [%s]", this, participant) log.debug("TX COMMIT - Committing transaction [%s] for server [%s]", toString, participant)
val haveAllPreCommitted = val haveAllPreCommitted =
if (participants.size == precommitted.size) {{ if (participants.size == precommitted.size) {{
for (part <- participants) yield { for (part <- participants) yield {
@ -92,7 +92,7 @@ object TransactionIdFactory {
def rollback(participant: String) = synchronized { def rollback(participant: String) = synchronized {
ensureIsActiveOrAborted ensureIsActiveOrAborted
log.debug("TX ROLLBACK - Server [%s] has initiated transaction rollback for [%s]", participant, this) log.debug("TX ROLLBACK - Server [%s] has initiated transaction rollback for [%s]", participant, toString)
transactionals.items.foreach(_.rollback) transactionals.items.foreach(_.rollback)
status = TransactionStatus.Aborted status = TransactionStatus.Aborted
reset reset
@ -100,7 +100,7 @@ object TransactionIdFactory {
def join(participant: String) = synchronized { def join(participant: String) = synchronized {
ensureIsActive ensureIsActive
log.debug("TX JOIN - Server [%s] is joining transaction [%s]" , participant, this) log.debug("TX JOIN - Server [%s] is joining transaction [%s]" , participant, toString)
participants ::= participant participants ::= participant
} }
@ -116,13 +116,13 @@ object TransactionIdFactory {
} }
private def ensureIsActive = if (status != TransactionStatus.Active) private def ensureIsActive = if (status != TransactionStatus.Active)
throw new IllegalStateException("Expected ACTIVE transaction - current status [" + status + "]") throw new IllegalStateException("Expected ACTIVE transaction - current status [" + status + "]: " + toString)
private def ensureIsActiveOrAborted = if (!(status == TransactionStatus.Active || status == TransactionStatus.Aborted)) private def ensureIsActiveOrAborted = if (!(status == TransactionStatus.Active || status == TransactionStatus.Aborted))
throw new IllegalStateException("Expected ACTIVE or ABORTED transaction - current status [" + status + "]") throw new IllegalStateException("Expected ACTIVE or ABORTED transaction - current status [" + status + "]: " + toString)
private def ensureIsActiveOrNew = if (!(status == TransactionStatus.Active || status == TransactionStatus.New)) private def ensureIsActiveOrNew = if (!(status == TransactionStatus.Active || status == TransactionStatus.New))
throw new IllegalStateException("Expected ACTIVE or NEW transaction - current status [" + status + "]") throw new IllegalStateException("Expected ACTIVE or NEW transaction - current status [" + status + "]: " + toString)
// For reinitialize transaction after sending it over the wire // For reinitialize transaction after sending it over the wire
private[kernel] def reinit = { private[kernel] def reinit = {

View file

@ -1,9 +1,7 @@
package se.scalablesolutions.akka.kernel.reactor package se.scalablesolutions.akka.kernel.reactor
import java.util.concurrent.BrokenBarrierException
import java.util.concurrent.CountDownLatch import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeoutException
import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.locks.Lock import java.util.concurrent.locks.Lock
import java.util.concurrent.locks.ReentrantLock import java.util.concurrent.locks.ReentrantLock
@ -60,7 +58,7 @@ class EventBasedDispatcherTest {
dispatcher.registerHandler(key, new TestMessageHandle(handleLatch)) dispatcher.registerHandler(key, new TestMessageHandle(handleLatch))
dispatcher.start dispatcher.start
for (i <- 0 until 100) { for (i <- 0 until 100) {
dispatcher.messageQueue.append(new MessageHandle(key, new Object, new NullFutureResult, None)) dispatcher.messageQueue.append(new MessageHandle(key, new Object, None, None))
} }
assertTrue(handleLatch.await(5, TimeUnit.SECONDS)) assertTrue(handleLatch.await(5, TimeUnit.SECONDS))
assertFalse(threadingIssueDetected.get) assertFalse(threadingIssueDetected.get)
@ -74,8 +72,8 @@ class EventBasedDispatcherTest {
dispatcher.registerHandler(key1, new TestMessageHandle(handleLatch)) dispatcher.registerHandler(key1, new TestMessageHandle(handleLatch))
dispatcher.registerHandler(key2, new TestMessageHandle(handleLatch)) dispatcher.registerHandler(key2, new TestMessageHandle(handleLatch))
dispatcher.start dispatcher.start
dispatcher.messageQueue.append(new MessageHandle(key1, new Object, new NullFutureResult, None)) dispatcher.messageQueue.append(new MessageHandle(key1, new Object, None, None))
dispatcher.messageQueue.append(new MessageHandle(key2, new Object, new NullFutureResult, None)) dispatcher.messageQueue.append(new MessageHandle(key2, new Object, None, None))
assertTrue(handleLatch.await(5, TimeUnit.SECONDS)) assertTrue(handleLatch.await(5, TimeUnit.SECONDS))
assertFalse(threadingIssueDetected.get) assertFalse(threadingIssueDetected.get)
} }
@ -109,8 +107,8 @@ class EventBasedDispatcherTest {
}) })
dispatcher.start dispatcher.start
for (i <- 0 until 100) { for (i <- 0 until 100) {
dispatcher.messageQueue.append(new MessageHandle(key1, new Integer(i), new NullFutureResult, None)) dispatcher.messageQueue.append(new MessageHandle(key1, new Integer(i), None, None))
dispatcher.messageQueue.append(new MessageHandle(key2, new Integer(i), new NullFutureResult, None)) dispatcher.messageQueue.append(new MessageHandle(key2, new Integer(i), None, None))
} }
assertTrue(handleLatch.await(5, TimeUnit.SECONDS)) assertTrue(handleLatch.await(5, TimeUnit.SECONDS))
assertFalse(threadingIssueDetected.get) assertFalse(threadingIssueDetected.get)

View file

@ -1,24 +1,29 @@
package se.scalablesolutions.akka.kernel.actor package se.scalablesolutions.akka.kernel.actor
import java.util.concurrent.locks.ReentrantLock import junit.framework.TestCase
import java.util.concurrent.TimeUnit
import kernel.state.TransactionalState import kernel.state.TransactionalState
import kernel.reactor._
import org.junit.{Test, Before} import org.junit.{Test, Before}
import org.junit.Assert._ import org.junit.Assert._
case class SetMapState(key: String, value: String)
case class SetVectorState(key: String)
case class SetRefState(key: String)
case class GetMapState(key: String) case class GetMapState(key: String)
case object GetVectorState case object GetVectorState
case object GetRefState case object GetRefState
case class SetMapState(key: String, value: String)
case class SetVectorState(key: String)
case class SetRefState(key: String)
case class Success(key: String, value: String) case class Success(key: String, value: String)
case class Failure(key: String, value: String, failer: Actor) case class Failure(key: String, value: String, failer: Actor)
case class SetMapStateOneWay(key: String, value: String)
case class SetVectorStateOneWay(key: String)
case class SetRefStateOneWay(key: String)
case class SuccessOneWay(key: String, value: String)
case class FailureOneWay(key: String, value: String, failer: Actor)
class InMemStatefulActor extends Actor { class InMemStatefulActor extends Actor {
timeout = 100000
makeTransactional makeTransactional
private val mapState = TransactionalState.newInMemoryMap[String, String] private val mapState = TransactionalState.newInMemoryMap[String, String]
private val vectorState = TransactionalState.newInMemoryVector[String] private val vectorState = TransactionalState.newInMemoryVector[String]
@ -51,6 +56,22 @@ class InMemStatefulActor extends Actor {
refState.swap(msg) refState.swap(msg)
failer !! "Failure" failer !! "Failure"
reply(msg) reply(msg)
case SetMapStateOneWay(key, msg) =>
mapState.put(key, msg)
case SetVectorStateOneWay(msg) =>
vectorState.add(msg)
case SetRefStateOneWay(msg) =>
refState.swap(msg)
case SuccessOneWay(key, msg) =>
mapState.put(key, msg)
vectorState.add(msg)
refState.swap(msg)
case FailureOneWay(key, msg, failer) =>
mapState.put(key, msg)
vectorState.add(msg)
refState.swap(msg)
failer ! "Failure"
} }
} }
@ -62,7 +83,18 @@ class InMemFailerActor extends Actor {
} }
} }
class InMemoryActorSpec { class InMemoryActorSpec extends TestCase {
@Test
def testOneWayMapShouldNotRollbackStateForStatefulServerInCaseOfSuccess = {
val stateful = new InMemStatefulActor
stateful.start
stateful ! SetMapStateOneWay("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "init") // set init state
Thread.sleep(100)
stateful ! SuccessOneWay("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state") // transactional
Thread.sleep(100)
assertEquals("new state", (stateful !! GetMapState("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess")).get)
}
@Test @Test
def testMapShouldNotRollbackStateForStatefulServerInCaseOfSuccess = { def testMapShouldNotRollbackStateForStatefulServerInCaseOfSuccess = {
val stateful = new InMemStatefulActor val stateful = new InMemStatefulActor
@ -72,6 +104,19 @@ class InMemoryActorSpec {
assertEquals("new state", (stateful !! GetMapState("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess")).get) assertEquals("new state", (stateful !! GetMapState("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess")).get)
} }
@Test
def testOneWayMapShouldRollbackStateForStatefulServerInCaseOfFailure = {
val stateful = new InMemStatefulActor
stateful.start
val failer = new InMemFailerActor
failer.start
stateful ! SetMapStateOneWay("testShouldRollbackStateForStatefulServerInCaseOfFailure", "init") // set init state
Thread.sleep(100)
stateful ! FailureOneWay("testShouldRollbackStateForStatefulServerInCaseOfFailure", "new state", failer) // call failing transactional method
Thread.sleep(100)
assertEquals("init", (stateful !! GetMapState("testShouldRollbackStateForStatefulServerInCaseOfFailure")).get) // check that state is == init state
}
@Test @Test
def testMapShouldRollbackStateForStatefulServerInCaseOfFailure = { def testMapShouldRollbackStateForStatefulServerInCaseOfFailure = {
val stateful = new InMemStatefulActor val stateful = new InMemStatefulActor
@ -86,16 +131,39 @@ class InMemoryActorSpec {
assertEquals("init", (stateful !! GetMapState("testShouldRollbackStateForStatefulServerInCaseOfFailure")).get) // check that state is == init state assertEquals("init", (stateful !! GetMapState("testShouldRollbackStateForStatefulServerInCaseOfFailure")).get) // check that state is == init state
} }
@Test
def testOneWayVectorShouldNotRollbackStateForStatefulServerInCaseOfSuccess = {
val stateful = new InMemStatefulActor
stateful.start
stateful ! SetVectorStateOneWay("init") // set init state
Thread.sleep(100)
stateful ! SuccessOneWay("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state") // transactional
Thread.sleep(100)
assertEquals("new state", (stateful !! GetVectorState).get)
}
@Test @Test
def testVectorShouldNotRollbackStateForStatefulServerInCaseOfSuccess = { def testVectorShouldNotRollbackStateForStatefulServerInCaseOfSuccess = {
val stateful = new InMemStatefulActor val stateful = new InMemStatefulActor
stateful.start stateful.start
stateful !! SetVectorState("init") // set init state stateful !! SetVectorState("init") // set init state
stateful !! Success("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state") // transactional stateful !! Success("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state") // transactional
stateful !! Success("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state") // to trigger commit
assertEquals("new state", (stateful !! GetVectorState).get) assertEquals("new state", (stateful !! GetVectorState).get)
} }
@Test
def testOneWayVectorShouldRollbackStateForStatefulServerInCaseOfFailure = {
val stateful = new InMemStatefulActor
stateful.start
stateful ! SetVectorStateOneWay("init") // set init state
Thread.sleep(100)
val failer = new InMemFailerActor
failer.start
stateful ! FailureOneWay("testShouldRollbackStateForStatefulServerInCaseOfFailure", "new state", failer) // call failing transactional method
Thread.sleep(100)
assertEquals("init", (stateful !! GetVectorState).get) // check that state is == init state
}
@Test @Test
def testVectorShouldRollbackStateForStatefulServerInCaseOfFailure = { def testVectorShouldRollbackStateForStatefulServerInCaseOfFailure = {
val stateful = new InMemStatefulActor val stateful = new InMemStatefulActor
@ -110,16 +178,39 @@ class InMemoryActorSpec {
assertEquals("init", (stateful !! GetVectorState).get) // check that state is == init state assertEquals("init", (stateful !! GetVectorState).get) // check that state is == init state
} }
@Test
def testOneWayRefShouldNotRollbackStateForStatefulServerInCaseOfSuccess = {
val stateful = new InMemStatefulActor
stateful.start
stateful ! SetRefStateOneWay("init") // set init state
Thread.sleep(100)
stateful ! SuccessOneWay("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state") // transactional
Thread.sleep(100)
assertEquals("new state", (stateful !! GetRefState).get)
}
@Test @Test
def testRefShouldNotRollbackStateForStatefulServerInCaseOfSuccess = { def testRefShouldNotRollbackStateForStatefulServerInCaseOfSuccess = {
val stateful = new InMemStatefulActor val stateful = new InMemStatefulActor
stateful.start stateful.start
stateful !! SetRefState("init") // set init state stateful !! SetRefState("init") // set init state
stateful !! Success("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state") // transactional stateful !! Success("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state") // transactional
stateful !! Success("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state") // to trigger commit
assertEquals("new state", (stateful !! GetRefState).get) assertEquals("new state", (stateful !! GetRefState).get)
} }
@Test
def testOneWayRefShouldRollbackStateForStatefulServerInCaseOfFailure = {
val stateful = new InMemStatefulActor
stateful.start
stateful ! SetRefStateOneWay("init") // set init state
Thread.sleep(100)
val failer = new InMemFailerActor
failer.start
stateful ! FailureOneWay("testShouldRollbackStateForStatefulServerInCaseOfFailure", "new state", failer) // call failing transactional method
Thread.sleep(100)
assertEquals("init", (stateful !! GetRefState).get) // check that state is == init state
}
@Test @Test
def testRefShouldRollbackStateForStatefulServerInCaseOfFailure = { def testRefShouldRollbackStateForStatefulServerInCaseOfFailure = {
val stateful = new InMemStatefulActor val stateful = new InMemStatefulActor

View file

@ -3,6 +3,9 @@ package se.scalablesolutions.akka.kernel.actor
import java.util.concurrent.locks.ReentrantLock import java.util.concurrent.locks.ReentrantLock
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import junit.framework.TestCase
import kernel.Kernel
import kernel.reactor._ import kernel.reactor._
import kernel.state.{CassandraStorageConfig, TransactionalState} import kernel.state.{CassandraStorageConfig, TransactionalState}
@ -61,7 +64,7 @@ object PersistenceManager {
isRunning = true isRunning = true
} }
} }
class PersistentActorSpec { class PersistentActorSpec extends TestCase {
PersistenceManager.init PersistenceManager.init
@Test @Test

View file

@ -3,6 +3,7 @@ package se.scalablesolutions.akka.kernel.actor
import concurrent.Lock import concurrent.Lock
import java.util.concurrent.locks.ReentrantLock import java.util.concurrent.locks.ReentrantLock
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import junit.framework.TestCase
import kernel.nio.{NettyClient, NettyServer} import kernel.nio.{NettyClient, NettyServer}
import reactor._ import reactor._
@ -28,7 +29,7 @@ class RemoteActorSpecActorBidirectional extends Actor {
} }
} }
class RemoteActorSpec { class RemoteActorSpec extends TestCase {
new Thread(new Runnable() { new Thread(new Runnable() {
def run = { def run = {
@ -42,7 +43,7 @@ class RemoteActorSpec {
private val unit = TimeUnit.MILLISECONDS private val unit = TimeUnit.MILLISECONDS
@Test @Test
def sendOneWay = { def testSendOneWay = {
implicit val timeout = 5000L implicit val timeout = 5000L
val actor = new RemoteActorSpecActorUnidirectional val actor = new RemoteActorSpecActorUnidirectional
actor.makeRemote actor.makeRemote
@ -54,7 +55,7 @@ class RemoteActorSpec {
} }
@Test @Test
def sendReplySync = { def testSendReplySync = {
implicit val timeout = 5000L implicit val timeout = 5000L
val actor = new RemoteActorSpecActorBidirectional val actor = new RemoteActorSpecActorBidirectional
actor.makeRemote actor.makeRemote
@ -65,7 +66,7 @@ class RemoteActorSpec {
} }
@Test @Test
def sendReplyAsync = { def testSendReplyAsync = {
implicit val timeout = 5000L implicit val timeout = 5000L
val actor = new RemoteActorSpecActorBidirectional val actor = new RemoteActorSpecActorBidirectional
actor.makeRemote actor.makeRemote
@ -76,7 +77,7 @@ class RemoteActorSpec {
} }
@Test @Test
def sendReceiveException = { def testSendReceiveException = {
implicit val timeout = 5000L implicit val timeout = 5000L
val actor = new RemoteActorSpecActorBidirectional val actor = new RemoteActorSpecActorBidirectional
actor.makeRemote actor.makeRemote

View file

@ -7,9 +7,6 @@ package se.scalablesolutions.akka.kernel
import kernel.actor.{Supervisor, SupervisorFactory, Actor, StartSupervisor} import kernel.actor.{Supervisor, SupervisorFactory, Actor, StartSupervisor}
import kernel.config.ScalaConfig._ import kernel.config.ScalaConfig._
import scala.collection.Map
import scala.collection.mutable.HashMap
import com.jteigen.scalatest.JUnit4Runner import com.jteigen.scalatest.JUnit4Runner
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.scalatest._ import org.scalatest._
@ -21,6 +18,8 @@ import org.scalatest._
class SupervisorSpec extends Suite { class SupervisorSpec extends Suite {
var messageLog: String = "" var messageLog: String = ""
var oneWayLog: String = ""
var pingpong1: PingPong1Actor = _ var pingpong1: PingPong1Actor = _
var pingpong2: PingPong2Actor = _ var pingpong2: PingPong2Actor = _
var pingpong3: PingPong3Actor = _ var pingpong3: PingPong3Actor = _
@ -39,11 +38,11 @@ class SupervisorSpec extends Suite {
messageLog = "" messageLog = ""
val sup = getSingleActorOneForOneSupervisor val sup = getSingleActorOneForOneSupervisor
sup ! StartSupervisor sup ! StartSupervisor
Thread.sleep(500)
intercept(classOf[RuntimeException]) { intercept(classOf[RuntimeException]) {
pingpong1 !! Die pingpong1 !! Die
} }
Thread.sleep(100) Thread.sleep(500)
expect("DIE") { expect("DIE") {
messageLog messageLog
} }
@ -53,49 +52,7 @@ class SupervisorSpec extends Suite {
messageLog = "" messageLog = ""
val sup = getSingleActorOneForOneSupervisor val sup = getSingleActorOneForOneSupervisor
sup ! StartSupervisor sup ! StartSupervisor
Thread.sleep(500)
expect("pong") {
(pingpong1 !! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("ping") {
messageLog
}
intercept(classOf[RuntimeException]) {
pingpong1 !! Die
}
Thread.sleep(100)
expect("pingDIE") {
messageLog
}
expect("pong") {
(pingpong1 !! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("pingDIEping") {
messageLog
}
}
def testKillSingleActorAllForOne = {
messageLog = ""
val sup = getSingleActorAllForOneSupervisor
sup ! StartSupervisor
intercept(classOf[RuntimeException]) {
pingpong1 !! Die
}
Thread.sleep(100)
expect("DIE") {
messageLog
}
}
def testCallKillCallSingleActorAllForOne = {
messageLog = ""
val sup = getSingleActorAllForOneSupervisor
pingpong1.timeout = 10000000
sup.timeout = 10000000
sup ! StartSupervisor
expect("pong") { expect("pong") {
(pingpong1 !! Ping).getOrElse("nil") (pingpong1 !! Ping).getOrElse("nil")
} }
@ -106,7 +63,49 @@ class SupervisorSpec extends Suite {
intercept(classOf[RuntimeException]) { intercept(classOf[RuntimeException]) {
pingpong1 !! Die pingpong1 !! Die
} }
Thread.sleep(1100) Thread.sleep(500)
expect("pingDIE") {
messageLog
}
expect("pong") {
(pingpong1 !! Ping).getOrElse("nil")
}
Thread.sleep(500)
expect("pingDIEping") {
messageLog
}
}
def testKillSingleActorAllForOne = {
messageLog = ""
val sup = getSingleActorAllForOneSupervisor
sup ! StartSupervisor
Thread.sleep(500)
intercept(classOf[RuntimeException]) {
pingpong1 !! Die
}
Thread.sleep(500)
expect("DIE") {
messageLog
}
}
def testCallKillCallSingleActorAllForOne = {
messageLog = ""
val sup = getSingleActorAllForOneSupervisor
sup ! StartSupervisor
Thread.sleep(500)
expect("pong") {
(pingpong1 !! Ping).getOrElse("nil")
}
Thread.sleep(500)
expect("ping") {
messageLog
}
intercept(classOf[RuntimeException]) {
pingpong1 !! Die
}
Thread.sleep(500)
expect("pingDIE") { expect("pingDIE") {
messageLog messageLog
} }
@ -123,10 +122,11 @@ class SupervisorSpec extends Suite {
messageLog = "" messageLog = ""
val sup = getMultipleActorsOneForOneConf val sup = getMultipleActorsOneForOneConf
sup ! StartSupervisor sup ! StartSupervisor
Thread.sleep(500)
intercept(classOf[RuntimeException]) { intercept(classOf[RuntimeException]) {
pingpong3 !! Die pingpong3 !! Die
} }
Thread.sleep(100) Thread.sleep(500)
expect("DIE") { expect("DIE") {
messageLog messageLog
} }
@ -136,40 +136,41 @@ class SupervisorSpec extends Suite {
messageLog = "" messageLog = ""
val sup = getMultipleActorsOneForOneConf val sup = getMultipleActorsOneForOneConf
sup ! StartSupervisor sup ! StartSupervisor
Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong1 !! Ping).getOrElse("nil") (pingpong1 !! Ping).getOrElse("nil")
} }
Thread.sleep(100) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong2 !! Ping).getOrElse("nil") (pingpong2 !! Ping).getOrElse("nil")
} }
Thread.sleep(100) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong3 !! Ping).getOrElse("nil") (pingpong3 !! Ping).getOrElse("nil")
} }
Thread.sleep(100) Thread.sleep(500)
expect("pingpingping") { expect("pingpingping") {
messageLog messageLog
} }
intercept(classOf[RuntimeException]) { intercept(classOf[RuntimeException]) {
pingpong2 !! Die pingpong2 !! Die
} }
Thread.sleep(100) Thread.sleep(500)
expect("pingpingpingDIE") { expect("pingpingpingDIE") {
messageLog messageLog
} }
expect("pong") { expect("pong") {
(pingpong1 !! Ping).getOrElse("nil") (pingpong1 !! Ping).getOrElse("nil")
} }
Thread.sleep(100) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong2 !! Ping).getOrElse("nil") (pingpong2 !! Ping).getOrElse("nil")
} }
Thread.sleep(100) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong3 !! Ping).getOrElse("nil") (pingpong3 !! Ping).getOrElse("nil")
} }
Thread.sleep(100) Thread.sleep(500)
expect("pingpingpingDIEpingpingping") { expect("pingpingpingDIEpingpingping") {
messageLog messageLog
} }
@ -179,10 +180,11 @@ class SupervisorSpec extends Suite {
messageLog = "" messageLog = ""
val sup = getMultipleActorsAllForOneConf val sup = getMultipleActorsAllForOneConf
sup ! StartSupervisor sup ! StartSupervisor
Thread.sleep(500)
intercept(classOf[RuntimeException]) { intercept(classOf[RuntimeException]) {
pingpong2 !! Die pingpong2 !! Die
} }
Thread.sleep(100) Thread.sleep(500)
expect("DIEDIEDIE") { expect("DIEDIEDIE") {
messageLog messageLog
} }
@ -192,45 +194,240 @@ class SupervisorSpec extends Suite {
messageLog = "" messageLog = ""
val sup = getMultipleActorsAllForOneConf val sup = getMultipleActorsAllForOneConf
sup ! StartSupervisor sup ! StartSupervisor
Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong1 !! Ping).getOrElse("nil") (pingpong1 !! Ping).getOrElse("nil")
} }
Thread.sleep(100) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong2 !! Ping).getOrElse("nil") (pingpong2 !! Ping).getOrElse("nil")
} }
Thread.sleep(100) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong3 !! Ping).getOrElse("nil") (pingpong3 !! Ping).getOrElse("nil")
} }
Thread.sleep(100) Thread.sleep(500)
expect("pingpingping") { expect("pingpingping") {
messageLog messageLog
} }
intercept(classOf[RuntimeException]) { intercept(classOf[RuntimeException]) {
pingpong2 !! Die pingpong2 !! Die
} }
Thread.sleep(100) Thread.sleep(500)
expect("pingpingpingDIEDIEDIE") { expect("pingpingpingDIEDIEDIE") {
messageLog messageLog
} }
expect("pong") { expect("pong") {
(pingpong1 !! Ping).getOrElse("nil") (pingpong1 !! Ping).getOrElse("nil")
} }
Thread.sleep(100) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong2 !! Ping).getOrElse("nil") (pingpong2 !! Ping).getOrElse("nil")
} }
Thread.sleep(100) Thread.sleep(500)
expect("pong") { expect("pong") {
(pingpong3 !! Ping).getOrElse("nil") (pingpong3 !! Ping).getOrElse("nil")
} }
Thread.sleep(100) Thread.sleep(500)
expect("pingpingpingDIEDIEDIEpingpingping") { expect("pingpingpingDIEDIEDIEpingpingping") {
messageLog messageLog
} }
} }
def testOneWayKillSingleActorOneForOne = {
messageLog = ""
val sup = getSingleActorOneForOneSupervisor
sup ! StartSupervisor
Thread.sleep(500)
pingpong1 ! Die
Thread.sleep(500)
expect("DIE") {
messageLog
}
}
def testOneWayCallKillCallSingleActorOneForOne = {
messageLog = ""
val sup = getSingleActorOneForOneSupervisor
sup ! StartSupervisor
Thread.sleep(500)
pingpong1 ! OneWay
Thread.sleep(500)
expect("oneway") {
oneWayLog
}
pingpong1 ! Die
Thread.sleep(500)
expect("DIE") {
messageLog
}
pingpong1 ! OneWay
Thread.sleep(500)
expect("onewayoneway") {
oneWayLog
}
}
/*
def testOneWayKillSingleActorAllForOne = {
messageLog = ""
val sup = getSingleActorAllForOneSupervisor
sup ! StartSupervisor
Thread.sleep(500)
intercept(classOf[RuntimeException]) {
pingpong1 ! Die
}
Thread.sleep(500)
expect("DIE") {
messageLog
}
}
def testOneWayCallKillCallSingleActorAllForOne = {
messageLog = ""
val sup = getSingleActorAllForOneSupervisor
sup ! StartSupervisor
Thread.sleep(500)
expect("pong") {
(pingpong1 ! Ping).getOrElse("nil")
}
Thread.sleep(500)
expect("ping") {
messageLog
}
intercept(classOf[RuntimeException]) {
pingpong1 ! Die
}
Thread.sleep(500)
expect("pingDIE") {
messageLog
}
expect("pong") {
(pingpong1 ! Ping).getOrElse("nil")
}
Thread.sleep(500)
expect("pingDIEping") {
messageLog
}
}
def testOneWayKillMultipleActorsOneForOne = {
messageLog = ""
val sup = getMultipleActorsOneForOneConf
sup ! StartSupervisor
Thread.sleep(500)
intercept(classOf[RuntimeException]) {
pingpong3 ! Die
}
Thread.sleep(500)
expect("DIE") {
messageLog
}
}
def tesOneWayCallKillCallMultipleActorsOneForOne = {
messageLog = ""
val sup = getMultipleActorsOneForOneConf
sup ! StartSupervisor
Thread.sleep(500)
expect("pong") {
(pingpong1 ! Ping).getOrElse("nil")
}
Thread.sleep(500)
expect("pong") {
(pingpong2 ! Ping).getOrElse("nil")
}
Thread.sleep(500)
expect("pong") {
(pingpong3 ! Ping).getOrElse("nil")
}
Thread.sleep(500)
expect("pingpingping") {
messageLog
}
intercept(classOf[RuntimeException]) {
pingpong2 ! Die
}
Thread.sleep(500)
expect("pingpingpingDIE") {
messageLog
}
expect("pong") {
(pingpong1 ! Ping).getOrElse("nil")
}
Thread.sleep(500)
expect("pong") {
(pingpong2 ! Ping).getOrElse("nil")
}
Thread.sleep(500)
expect("pong") {
(pingpong3 ! Ping).getOrElse("nil")
}
Thread.sleep(500)
expect("pingpingpingDIEpingpingping") {
messageLog
}
}
def testOneWayKillMultipleActorsAllForOne = {
messageLog = ""
val sup = getMultipleActorsAllForOneConf
sup ! StartSupervisor
Thread.sleep(500)
intercept(classOf[RuntimeException]) {
pingpong2 ! Die
}
Thread.sleep(500)
expect("DIEDIEDIE") {
messageLog
}
}
def tesOneWayCallKillCallMultipleActorsAllForOne = {
messageLog = ""
val sup = getMultipleActorsAllForOneConf
sup ! StartSupervisor
Thread.sleep(500)
expect("pong") {
pingpong1 ! Ping
}
Thread.sleep(500)
expect("pong") {
(pingpong2 ! Ping).getOrElse("nil")
}
Thread.sleep(500)
expect("pong") {
(pingpong3 ! Ping).getOrElse("nil")
}
Thread.sleep(500)
expect("pingpingping") {
messageLog
}
intercept(classOf[RuntimeException]) {
pingpong2 ! Die
}
Thread.sleep(500)
expect("pingpingpingDIEDIEDIE") {
messageLog
}
expect("pong") {
(pingpong1 ! Ping).getOrElse("nil")
}
Thread.sleep(500)
expect("pong") {
(pingpong2 ! Ping).getOrElse("nil")
}
Thread.sleep(500)
expect("pong") {
(pingpong3 ! Ping).getOrElse("nil")
}
Thread.sleep(500)
expect("pingpingpingDIEDIEDIEpingpingping") {
messageLog
}
}
*/
/* /*
def testNestedSupervisorsTerminateFirstLevelActorAllForOne = { def testNestedSupervisorsTerminateFirstLevelActorAllForOne = {
messageLog = "" messageLog = ""
@ -239,7 +436,7 @@ class SupervisorSpec extends Suite {
intercept(classOf[RuntimeException]) { intercept(classOf[RuntimeException]) {
pingpong1 !! Die pingpong1 !! Die
} }
Thread.sleep(100) Thread.sleep(500)
expect("DIEDIEDIE") { expect("DIEDIEDIE") {
messageLog messageLog
} }
@ -375,6 +572,9 @@ class SupervisorSpec extends Suite {
messageLog += "ping" messageLog += "ping"
reply("pong") reply("pong")
case OneWay =>
oneWayLog += "oneway"
case Die => case Die =>
throw new RuntimeException("DIE") throw new RuntimeException("DIE")
} }

View file

@ -1,10 +1,8 @@
package se.scalablesolutions.akka.kernel.reactor package se.scalablesolutions.akka.kernel.reactor
import java.util.concurrent.BrokenBarrierException
import java.util.concurrent.CountDownLatch import java.util.concurrent.CountDownLatch
import java.util.concurrent.CyclicBarrier import java.util.concurrent.CyclicBarrier
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeoutException
import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.locks.Lock import java.util.concurrent.locks.Lock
import java.util.concurrent.locks.ReentrantLock import java.util.concurrent.locks.ReentrantLock
@ -62,7 +60,7 @@ class ThreadBasedDispatcherTest {
dispatcher.registerHandler(key, new TestMessageHandle(handleLatch)) dispatcher.registerHandler(key, new TestMessageHandle(handleLatch))
dispatcher.start dispatcher.start
for (i <- 0 until 100) { for (i <- 0 until 100) {
dispatcher.messageQueue.append(new MessageHandle(key, new Object, new NullFutureResult, None)) dispatcher.messageQueue.append(new MessageHandle(key, new Object, None, None))
} }
assertTrue(handleLatch.await(5, TimeUnit.SECONDS)) assertTrue(handleLatch.await(5, TimeUnit.SECONDS))
assertFalse(threadingIssueDetected.get) assertFalse(threadingIssueDetected.get)
@ -86,8 +84,8 @@ class ThreadBasedDispatcherTest {
} }
}) })
dispatcher.start dispatcher.start
dispatcher.messageQueue.append(new MessageHandle(key1, "Sending Message 1", new NullFutureResult, None)) dispatcher.messageQueue.append(new MessageHandle(key1, "Sending Message 1", None, None))
dispatcher.messageQueue.append(new MessageHandle(key2, "Sending Message 2", new NullFutureResult, None)) dispatcher.messageQueue.append(new MessageHandle(key2, "Sending Message 2", None, None))
handlersBarrier.await(5, TimeUnit.SECONDS) handlersBarrier.await(5, TimeUnit.SECONDS)
assertFalse(threadingIssueDetected.get) assertFalse(threadingIssueDetected.get)
//dispatcher.shutdown //dispatcher.shutdown
@ -122,8 +120,8 @@ class ThreadBasedDispatcherTest {
}) })
dispatcher.start dispatcher.start
for (i <- 0 until 100) { for (i <- 0 until 100) {
dispatcher.messageQueue.append(new MessageHandle(key1, new Integer(i), new NullFutureResult, None)) dispatcher.messageQueue.append(new MessageHandle(key1, new Integer(i), None, None))
dispatcher.messageQueue.append(new MessageHandle(key2, new Integer(i), new NullFutureResult, None)) dispatcher.messageQueue.append(new MessageHandle(key2, new Integer(i), None, None))
} }
assertTrue(handleLatch.await(5, TimeUnit.SECONDS)) assertTrue(handleLatch.await(5, TimeUnit.SECONDS))
assertFalse(threadingIssueDetected.get) assertFalse(threadingIssueDetected.get)