completed cassandra read/write (and bench) + added transactional vector and ref + cleaned up transactional state hierarchy + rewrote tx state wiring

This commit is contained in:
Jonas Boner 2009-04-27 19:55:57 +02:00
parent e9f7162245
commit 7dec0a747c
60 changed files with 4481 additions and 6283 deletions

724
akka.ipr
View file

@ -1,312 +1,412 @@
<?xml version="1.0" encoding="UTF-8"?>
<project relativePaths="true" version="4">
<component name="AntConfiguration">
<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 name="BuildJarProjectSettings">
<option name="BUILD_JARS_ON_MAKE" value="false" />
</component>
<component name="CodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS" />
<option name="USE_PER_PROJECT_SETTINGS" value="false" />
</component>
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<option name="DEPLOY_AFTER_MAKE" value="0" />
<resourceExtensions>
<entry name=".+\.(properties|xml|html|dtd|tld)" />
<entry name=".+\.(gif|png|jpeg|jpg)" />
</resourceExtensions>
<wildcardResourcePatterns>
<entry name="?*.properties" />
<entry name="?*.xml" />
<entry name="?*.gif" />
<entry name="?*.png" />
<entry name="?*.jpeg" />
<entry name="?*.jpg" />
<entry name="?*.html" />
<entry name="?*.dtd" />
<entry name="?*.tld" />
<entry name="?*.ftl" />
</wildcardResourcePatterns>
</component>
<component name="CopyrightManager" default="">
<module2copyright />
</component>
<component name="DependencyValidationManager">
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</component>
<component name="EclipseCompilerSettings">
<option name="DEBUGGING_INFO" value="true" />
<option name="GENERATE_NO_WARNINGS" value="true" />
<option name="DEPRECATION" value="false" />
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
<option name="MAXIMUM_HEAP_SIZE" value="128" />
</component>
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
<file url="file://$PROJECT_DIR$/api-java/src/main/java/se/scalablesolutions/akka/api/ActiveObjectGuiceConfigurator.java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/api-java/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java" charset="windows-1252" />
<file url="file://$PROJECT_DIR$/api-java/src/test/java/se/scalablesolutions/akka/api/PersistentStateTest.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="Scala">
<modules>
<module name="akka">
<files>
<file url="file://$PROJECT_DIR$/db/src/main/scala/Db.scala" />
<file url="file://$PROJECT_DIR$/db/src/test/scala/DbReplicationSpecs.scala" />
<file url="file://$PROJECT_DIR$/supervisor/sample.scala" />
<file url="file://$PROJECT_DIR$/supervisor/src/main/scala/GenericServer.scala" />
<file url="file://$PROJECT_DIR$/supervisor/src/main/scala/Helpers.scala" />
<file url="file://$PROJECT_DIR$/supervisor/src/main/scala/Supervisor.scala" />
<file url="file://$PROJECT_DIR$/supervisor/test-code/test/scala/GenericServerContainerSuite.scala" />
<file url="file://$PROJECT_DIR$/supervisor/test-code/test/scala/GenericServerSuite.scala" />
<file url="file://$PROJECT_DIR$/supervisor/test-code/test/scala/Messages.scala" />
<file url="file://$PROJECT_DIR$/supervisor/test-code/test/scala/SupervisorStateSuite.scala" />
<file url="file://$PROJECT_DIR$/supervisor/test-code/test/scala/SupervisorSuite.scala" />
</files>
</module>
</modules>
</facet-type>
</autodetection-disabled>
</component>
<component name="IdProvider" IDEtalkID="0E3A0445954D4D390C337AFB20B2746C" />
<component name="InspectionProjectProfileManager">
<option name="PROJECT_PROFILE" value="Project Default" />
<option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
<scopes />
<profiles>
<profile version="1.0" is_locked="false">
<option name="myName" value="Project Default" />
<option name="myLocal" value="false" />
</profile>
</profiles>
<list size="0" />
</component>
<component name="JavacSettings">
<option name="DEBUGGING_INFO" value="true" />
<option name="GENERATE_NO_WARNINGS" value="false" />
<option name="DEPRECATION" value="true" />
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
<option name="MAXIMUM_HEAP_SIZE" value="128" />
</component>
<component name="JavadocGenerationManager">
<option name="OUTPUT_DIRECTORY" />
<option name="OPTION_SCOPE" value="protected" />
<option name="OPTION_HIERARCHY" value="true" />
<option name="OPTION_NAVIGATOR" value="true" />
<option name="OPTION_INDEX" value="true" />
<option name="OPTION_SEPARATE_INDEX" value="true" />
<option name="OPTION_DOCUMENT_TAG_USE" value="false" />
<option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
<option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
<option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
<option name="OPTION_DEPRECATED_LIST" value="true" />
<option name="OTHER_OPTIONS" value="" />
<option name="HEAP_SIZE" />
<option name="LOCALE" />
<option name="OPEN_IN_BROWSER" value="true" />
</component>
<component name="JikesSettings">
<option name="JIKES_PATH" value="" />
<option name="DEBUGGING_INFO" value="true" />
<option name="DEPRECATION" value="true" />
<option name="GENERATE_NO_WARNINGS" value="false" />
<option name="IS_EMACS_ERRORS_MODE" value="true" />
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
</component>
<component name="Palette2">
<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">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
<component name="ProjectDetails">
<option name="projectName" value="akka" />
</component>
<component name="ProjectFileVersion" converted="true" />
<component name="ProjectKey">
<option name="state" value="project://C:\home\jboner\src\scala\akka\akka.ipr" />
</component>
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/akka.iml" filepath="$PROJECT_DIR$/akka.iml" />
<module fileurl="file://$PROJECT_DIR$/api-java/api-java.iml" filepath="$PROJECT_DIR$/api-java/api-java.iml" />
<module fileurl="file://$PROJECT_DIR$/kernel/kernel.iml" filepath="$PROJECT_DIR$/kernel/kernel.iml" />
<module fileurl="file://$PROJECT_DIR$/util-java/util-java.iml" filepath="$PROJECT_DIR$/util-java/util-java.iml" />
</modules>
</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">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="ResourceManagerContainer">
<option name="myResourceBundles">
<value>
<list size="0" />
</value>
</option>
</component>
<component name="RmicSettings">
<option name="IS_EANABLED" value="false" />
<option name="DEBUGGING_INFO" value="true" />
<option name="GENERATE_NO_WARNINGS" value="false" />
<option name="GENERATE_IIOP_STUBS" value="false" />
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
</component>
<component name="SvnBranchConfigurationManager">
<option name="myVersion" value="124" />
<option name="mySupportsUserInfoFilter" value="true" />
</component>
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
<component name="WebServicesPlugin" addRequiredLibraries="true" />
<component name="libraryTable">
<library name="scala-2.7.3">
<CLASSES>
<root url="jar://$PROJECT_DIR$/../../../../../bin/scala-2.7.3.final/lib/scala-compiler.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../../bin/scala-2.7.3.final/lib/scala-dbc.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../../bin/scala-2.7.3.final/lib/scala-library.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../../bin/scala-2.7.3.final/lib/scala-swing.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/../../../../../bin/scala-2.7.3.final/src/scala-compiler-src.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../../bin/scala-2.7.3.final/src/scala-dbc-src.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../../bin/scala-2.7.3.final/src/scala-library-src.jar!/" />
<root url="jar://$PROJECT_DIR$/../../../../../bin/scala-2.7.3.final/src/scala-swing-src.jar!/" />
</SOURCES>
</library>
</component>
<UsedPathMacros>
<macro name="MAVEN_REPOSITORY" description="Maven Local Repostiry" />
</UsedPathMacros>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project relativePaths="true" version="4">
<component name="AntConfiguration">
<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 name="BuildJarProjectSettings">
<option name="BUILD_JARS_ON_MAKE" value="false" />
</component>
<component name="CodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<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;" />
<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">
<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="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">
<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="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">
<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>
</value>
</option>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</component>
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Eclipse" />
<option name="DEPLOY_AFTER_MAKE" value="0" />
<resourceExtensions>
<entry name=".+\.(properties|xml|html|dtd|tld)" />
<entry name=".+\.(gif|png|jpeg|jpg)" />
</resourceExtensions>
<wildcardResourcePatterns>
<entry name="?*.properties" />
<entry name="?*.xml" />
<entry name="?*.gif" />
<entry name="?*.png" />
<entry name="?*.jpeg" />
<entry name="?*.jpg" />
<entry name="?*.html" />
<entry name="?*.dtd" />
<entry name="?*.tld" />
<entry name="?*.ftl" />
</wildcardResourcePatterns>
</component>
<component name="CopyrightManager" default="">
<module2copyright />
</component>
<component name="DependencyValidationManager">
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</component>
<component name="EclipseCompilerSettings">
<option name="DEBUGGING_INFO" value="true" />
<option name="GENERATE_NO_WARNINGS" value="true" />
<option name="DEPRECATION" value="false" />
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
<option name="MAXIMUM_HEAP_SIZE" value="128" />
</component>
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
<file url="file://$PROJECT_DIR$/api-java/src/main/java/se/scalablesolutions/akka/api/ActiveObjectGuiceConfigurator.java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/api-java/src/test/java/se/scalablesolutions/akka/api/InMemoryStateTest.java" charset="windows-1252" />
<file url="file://$PROJECT_DIR$/api-java/src/test/java/se/scalablesolutions/akka/api/PersistentStateTest.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="Scala">
<modules>
<module name="akka">
<files>
<file url="file://$PROJECT_DIR$/db/src/main/scala/Db.scala" />
<file url="file://$PROJECT_DIR$/db/src/test/scala/DbReplicationSpecs.scala" />
<file url="file://$PROJECT_DIR$/supervisor/sample.scala" />
<file url="file://$PROJECT_DIR$/supervisor/src/main/scala/GenericServer.scala" />
<file url="file://$PROJECT_DIR$/supervisor/src/main/scala/Helpers.scala" />
<file url="file://$PROJECT_DIR$/supervisor/src/main/scala/Supervisor.scala" />
<file url="file://$PROJECT_DIR$/supervisor/test-code/test/scala/GenericServerContainerSuite.scala" />
<file url="file://$PROJECT_DIR$/supervisor/test-code/test/scala/GenericServerSuite.scala" />
<file url="file://$PROJECT_DIR$/supervisor/test-code/test/scala/Messages.scala" />
<file url="file://$PROJECT_DIR$/supervisor/test-code/test/scala/SupervisorStateSuite.scala" />
<file url="file://$PROJECT_DIR$/supervisor/test-code/test/scala/SupervisorSuite.scala" />
</files>
</module>
<module name="kernel">
<files>
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/ActiveObject.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/AkkaComponentProvider.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/Boot.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/CassandraNode.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/Configuration.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/DataFlowVariable.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/ErrRef.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/GenericServer.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/HashCode.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/Helpers.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/Kernel.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/Logging.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/NetCat.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/Serializer.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/State.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/Supervisor.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/Transaction.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/collection/HashTrie.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/main/scala/collection/Vector.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/test/scala/AllSuite.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/test/scala/GenericServerContainerSuite.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/test/scala/GenericServerSpec.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/test/scala/Messages.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/test/scala/SupervisorSpec.scala" />
<file url="file://$PROJECT_DIR$/kernel/src/test/scala/SupervisorStateSpec.scala" />
</files>
</module>
</modules>
</facet-type>
</autodetection-disabled>
</component>
<component name="IdProvider" IDEtalkID="0E3A0445954D4D390C337AFB20B2746C" />
<component name="InspectionProjectProfileManager">
<option name="PROJECT_PROFILE" value="Project Default" />
<option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
<scopes />
<profiles>
<profile version="1.0" is_locked="false">
<option name="myName" value="Project Default" />
<option name="myLocal" value="false" />
</profile>
</profiles>
<list size="0" />
</component>
<component name="JavacSettings">
<option name="DEBUGGING_INFO" value="true" />
<option name="GENERATE_NO_WARNINGS" value="false" />
<option name="DEPRECATION" value="true" />
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
<option name="MAXIMUM_HEAP_SIZE" value="128" />
</component>
<component name="JavadocGenerationManager">
<option name="OUTPUT_DIRECTORY" />
<option name="OPTION_SCOPE" value="protected" />
<option name="OPTION_HIERARCHY" value="true" />
<option name="OPTION_NAVIGATOR" value="true" />
<option name="OPTION_INDEX" value="true" />
<option name="OPTION_SEPARATE_INDEX" value="true" />
<option name="OPTION_DOCUMENT_TAG_USE" value="false" />
<option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
<option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
<option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
<option name="OPTION_DEPRECATED_LIST" value="true" />
<option name="OTHER_OPTIONS" value="" />
<option name="HEAP_SIZE" />
<option name="LOCALE" />
<option name="OPEN_IN_BROWSER" value="true" />
</component>
<component name="JikesSettings">
<option name="JIKES_PATH" value="" />
<option name="DEBUGGING_INFO" value="true" />
<option name="DEPRECATION" value="true" />
<option name="GENERATE_NO_WARNINGS" value="false" />
<option name="IS_EMACS_ERRORS_MODE" value="true" />
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
</component>
<component name="Palette2">
<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">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
<component name="ProjectDetails">
<option name="projectName" value="akka" />
</component>
<component name="ProjectFileVersion" converted="true" />
<component name="ProjectKey">
<option name="state" value="project:///Users/jboner/src/scala/akka/akka.ipr" />
</component>
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/akka.iml" filepath="$PROJECT_DIR$/akka.iml" />
<module fileurl="file://$PROJECT_DIR$/api-java/api-java.iml" filepath="$PROJECT_DIR$/api-java/api-java.iml" />
<module fileurl="file://$PROJECT_DIR$/core/core.iml" filepath="$PROJECT_DIR$/core/core.iml" />
<module fileurl="file://$PROJECT_DIR$/util-java/util-java.iml" filepath="$PROJECT_DIR$/util-java/util-java.iml" />
</modules>
</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">
<output url="file://$PROJECT_DIR$/build" />
</component>
<component name="ResourceManagerContainer">
<option name="myResourceBundles">
<value>
<list size="0" />
</value>
</option>
</component>
<component name="RmicSettings">
<option name="IS_EANABLED" value="false" />
<option name="DEBUGGING_INFO" value="true" />
<option name="GENERATE_NO_WARNINGS" value="false" />
<option name="GENERATE_IIOP_STUBS" value="false" />
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
</component>
<component name="SvnBranchConfigurationManager">
<option name="myVersion" value="124" />
<option name="mySupportsUserInfoFilter" value="true" />
</component>
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
<component name="WebServicesPlugin" addRequiredLibraries="true" />
<UsedPathMacros>
<macro name="MAVEN_REPOSITORY" description="Maven Local Repostiry" />
</UsedPathMacros>
</project>

1491
akka.iws

File diff suppressed because it is too large Load diff

View file

@ -1,4 +0,0 @@
<!-- Documentation is available at http://www.sublimetext.com/docs/projects -->
<project>
<mount dir="." direxclude=".svn"/>
</project>

View file

@ -1,51 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<module relativePaths="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="file://$MODULE_DIR$/../kernel/build/classes" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module" module-name="util-java" exported="" />
<orderEntry type="module" module-name="kernel" exported="" />
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-core/2.0-SNAPSHOT/guice-core-2.0-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-jsr250/2.0-SNAPSHOT/guice-jsr250-2.0-SNAPSHOT.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>
</component>
</module>
<?xml version="1.0" encoding="UTF-8"?>
<module relativePaths="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="file://$MODULE_DIR$/../kernel/build/classes" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module" module-name="util-java" exported="" />
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-core/2.0-SNAPSHOT/guice-core-2.0-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/guiceyfruit/guice-jsr250/2.0-SNAPSHOT/guice-jsr250-2.0-SNAPSHOT.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>
</component>
</module>

View file

@ -1,74 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="api-java" default="default" basedir=".">
<description>Builds, tests, and runs the project api-java.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar-with-manifest: JAR building (if you are using a manifest)
-do-jar-without-manifest: JAR building (if you are not using a manifest)
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="api-java-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="api-java" default="default" basedir=".">
<description>Builds, tests, and runs the project api-java.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar-with-manifest: JAR building (if you are using a manifest)
-do-jar-without-manifest: JAR building (if you are not using a manifest)
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="api-java-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
build.xml.data.CRC32=3e53666f
build.xml.script.CRC32=b65508dc
build.xml.stylesheet.CRC32=958a1d3e
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=3e53666f
nbproject/build-impl.xml.script.CRC32=0784ec5f
nbproject/build-impl.xml.stylesheet.CRC32=65b8de21
build.xml.data.CRC32=3e53666f
build.xml.script.CRC32=b65508dc
build.xml.stylesheet.CRC32=958a1d3e@1.25.0.45
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=3e53666f
nbproject/build-impl.xml.script.CRC32=1b57f6f0
nbproject/build-impl.xml.stylesheet.CRC32=ce896a9e@1.25.0.45

View file

@ -1,7 +1,6 @@
compile.on.save=true
do.depend=false
do.jar=true
javac.debug=true
javadoc.preview=true
jaxws.endorsed.dir=C:\\Program Files\\NetBeans 6.5.1\\java2\\modules\\ext\\jaxws21\\api:C:\\Program Files\\NetBeans 6.5.1\\ide10\\modules\\ext\\jaxb\\api
user.properties.file=C:\\Documents and Settings\\jboner\\.netbeans\\6.5\\build.properties
compile.on.save=true
do.depend=false
do.jar=true
javac.debug=true
javadoc.preview=true
user.properties.file=/Users/jboner/.netbeans/dev/build.properties

View file

@ -1,185 +1,217 @@
application.title=api-java
application.vendor=jboner
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
# Uncomment to specify the preferred debugger connection transport:
#debug.transport=dt_socket
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/api-java.jar
dist.javadoc.dir=${dist.dir}/javadoc
excludes=
file.reference.activation-1.1.jar=../lib/activation-1.1.jar
file.reference.akka-util-java.jar=../lib/akka-util-java.jar
file.reference.aopalliance-1.0.jar=../lib/aopalliance-1.0.jar
file.reference.asm-3.1.jar=../lib/asm-3.1.jar
file.reference.catalina-ant.jar=../lib/catalina-ant.jar
file.reference.cglib-2.2.jar=../lib/cglib-2.2.jar
file.reference.colt-1.2.0.jar=../lib/colt-1.2.0.jar
file.reference.commons-codec-1.3.jar=../lib/commons-codec-1.3.jar
file.reference.commons-collections-3.1.jar=../lib/commons-collections-3.1.jar
file.reference.commons-dbcp-1.2.2.jar=../lib/commons-dbcp-1.2.2.jar
file.reference.commons-httpclient-3.1.jar=../lib/commons-httpclient-3.1.jar
file.reference.commons-io-1.3.2.jar=../lib/commons-io-1.3.2.jar
file.reference.commons-lang-2.1.jar=../lib/commons-lang-2.1.jar
file.reference.commons-logging.jar=../lib/commons-logging.jar
file.reference.commons-pool-1.4.jar=../lib/commons-pool-1.4.jar
file.reference.configgy-1.2.jar=../lib/configgy-1.2.jar
file.reference.google-collect-snapshot-20090211.jar=../lib/google-collect-snapshot-20090211.jar
file.reference.grizzly-framework-1.8.6.3.jar=../lib/grizzly-framework-1.8.6.3.jar
file.reference.grizzly-http-1.8.6.3.jar=../lib/grizzly-http-1.8.6.3.jar
file.reference.grizzly-http-servlet-1.8.6.3.jar=../lib/grizzly-http-servlet-1.8.6.3.jar
file.reference.grizzly-http-utils-1.8.6.3.jar=../lib/grizzly-http-utils-1.8.6.3.jar
file.reference.grizzly-portunif-1.8.6.3.jar=../lib/grizzly-portunif-1.8.6.3.jar
file.reference.grizzly-rcm-1.8.6.3.jar=../lib/grizzly-rcm-1.8.6.3.jar
file.reference.grizzly-servlet-webserver-1.8.6.3.jar=../lib/grizzly-servlet-webserver-1.8.6.3.jar
file.reference.guice-core-2.0-SNAPSHOT.jar=../lib/guice-core-2.0-SNAPSHOT.jar
file.reference.guice-jsr250-2.0-SNAPSHOT.jar=../lib/guice-jsr250-2.0-SNAPSHOT.jar
file.reference.jaxb-api-2.1.jar=../lib/jaxb-api-2.1.jar
file.reference.jaxb-impl-2.1.jar=../lib/jaxb-impl-2.1.jar
file.reference.jdom-1.0.jar=../lib/jdom-1.0.jar
file.reference.je-3.3.62.jar=../lib/je-3.3.62.jar
file.reference.jersey-atom-1.0.1.jar=../lib/jersey-atom-1.0.1.jar
file.reference.jersey-core-1.0.1.jar=../lib/jersey-core-1.0.1.jar
file.reference.jersey-json-1.0.1.jar=../lib/jersey-json-1.0.1.jar
file.reference.jersey-server-1.0.1.jar=../lib/jersey-server-1.0.1.jar
file.reference.jettison-1.0.1.jar=../lib/jettison-1.0.1.jar
file.reference.jetty-6.1.6rc0.jar=../lib/jetty-6.1.6rc0.jar
file.reference.jetty-util-6.1.6rc0.jar=../lib/jetty-util-6.1.6rc0.jar
file.reference.jsr250-api-1.0.jar=../lib/jsr250-api-1.0.jar
file.reference.jsr311-api-1.0.jar=../lib/jsr311-api-1.0.jar
file.reference.junit-3.8.2.jar=../lib/junit-3.8.2.jar
file.reference.libthrift-20080411p1.jar=../lib/libthrift-20080411p1.jar
file.reference.log4j-1.2.13.jar=../lib/log4j-1.2.13.jar
file.reference.main-java=src/main/java
file.reference.mina-core-2.0.0-M2-SNAPSHOT.jar=../lib/mina-core-2.0.0-M2-SNAPSHOT.jar
file.reference.mina-integration-scala-2.0.0-M2-SNAPSHOT.jar=../lib/mina-integration-scala-2.0.0-M2-SNAPSHOT.jar
file.reference.protobuf-java-2.0.3.jar=../lib/protobuf-java-2.0.3.jar
file.reference.rome-0.9.jar=../lib/rome-0.9.jar
file.reference.scala-library-2.7.3.jar=../lib/scala-library-2.7.3.jar
file.reference.scalatest-0.9.5.jar=../lib/scalatest-0.9.5.jar
file.reference.scalatest-0.9.5.zip=../lib/scalatest-0.9.5.zip
file.reference.servlet-api-2.5.jar=../lib/servlet-api-2.5.jar
file.reference.slf4j-api-1.4.3.jar=../lib/slf4j-api-1.4.3.jar
file.reference.slf4j-log4j12-1.4.3.jar=../lib/slf4j-log4j12-1.4.3.jar
file.reference.stax-api-1.0-2.jar=../lib/stax-api-1.0-2.jar
file.reference.test-java=src/test/java
file.reference.velocity-1.5.jar=../lib/velocity-1.5.jar
file.reference.voldemort-0.4a.jar=../lib/voldemort-0.4a.jar
file.reference.voldemort-contrib-0.4a.jar=../lib/voldemort-contrib-0.4a.jar
file.reference.xerces.jar=../lib/xerces.jar
file.reference.zookeeper-3.1.0.jar=../lib/zookeeper-3.1.0.jar
includes=**
jar.compress=false
javac.classpath=\
${reference.akka-kernel.jar}:\
${file.reference.guice-core-2.0-SNAPSHOT.jar}:\
${file.reference.guice-jsr250-2.0-SNAPSHOT.jar}:\
${file.reference.activation-1.1.jar}:\
${file.reference.aopalliance-1.0.jar}:\
${file.reference.asm-3.1.jar}:\
${file.reference.catalina-ant.jar}:\
${file.reference.cglib-2.2.jar}:\
${file.reference.colt-1.2.0.jar}:\
${file.reference.akka-util-java.jar}:\
${file.reference.commons-codec-1.3.jar}:\
${file.reference.commons-collections-3.1.jar}:\
${file.reference.commons-dbcp-1.2.2.jar}:\
${file.reference.commons-httpclient-3.1.jar}:\
${file.reference.commons-io-1.3.2.jar}:\
${file.reference.commons-lang-2.1.jar}:\
${file.reference.commons-logging.jar}:\
${file.reference.commons-pool-1.4.jar}:\
${file.reference.configgy-1.2.jar}:\
${file.reference.google-collect-snapshot-20090211.jar}:\
${file.reference.grizzly-framework-1.8.6.3.jar}:\
${file.reference.grizzly-http-1.8.6.3.jar}:\
${file.reference.grizzly-http-servlet-1.8.6.3.jar}:\
${file.reference.grizzly-http-utils-1.8.6.3.jar}:\
${file.reference.grizzly-portunif-1.8.6.3.jar}:\
${file.reference.grizzly-rcm-1.8.6.3.jar}:\
${file.reference.grizzly-servlet-webserver-1.8.6.3.jar}:\
${file.reference.jaxb-api-2.1.jar}:\
${file.reference.jaxb-impl-2.1.jar}:\
${file.reference.jdom-1.0.jar}:\
${file.reference.je-3.3.62.jar}:\
${file.reference.jersey-atom-1.0.1.jar}:\
${file.reference.jersey-core-1.0.1.jar}:\
${file.reference.jersey-json-1.0.1.jar}:\
${file.reference.jersey-server-1.0.1.jar}:\
${file.reference.jettison-1.0.1.jar}:\
${file.reference.jetty-6.1.6rc0.jar}:\
${file.reference.jetty-util-6.1.6rc0.jar}:\
${file.reference.jsr250-api-1.0.jar}:\
${file.reference.jsr311-api-1.0.jar}:\
${file.reference.junit-3.8.2.jar}:\
${file.reference.libthrift-20080411p1.jar}:\
${file.reference.log4j-1.2.13.jar}:\
${file.reference.mina-core-2.0.0-M2-SNAPSHOT.jar}:\
${file.reference.mina-integration-scala-2.0.0-M2-SNAPSHOT.jar}:\
${file.reference.protobuf-java-2.0.3.jar}:\
${file.reference.rome-0.9.jar}:\
${file.reference.scala-library-2.7.3.jar}:\
${file.reference.scalatest-0.9.5.jar}:\
${file.reference.scalatest-0.9.5.zip}:\
${file.reference.servlet-api-2.5.jar}:\
${file.reference.slf4j-api-1.4.3.jar}:\
${file.reference.slf4j-log4j12-1.4.3.jar}:\
${file.reference.stax-api-1.0-2.jar}:\
${file.reference.velocity-1.5.jar}:\
${file.reference.voldemort-0.4a.jar}:\
${file.reference.voldemort-contrib-0.4a.jar}:\
${file.reference.xerces.jar}:\
${file.reference.zookeeper-3.1.0.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.source=1.5
javac.target=1.5
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
${libs.junit.classpath}:\
${libs.junit_4.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
platform.active=default_platform
project.akka-kernel=../kernel
reference.akka-kernel.jar=${project.akka-kernel}/dist/akka-kernel.jar
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
# or test-sys-prop.name=value to set system properties for unit tests):
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
source.encoding=UTF-8
src.dir=${file.reference.main-java}
test.src.dir=${file.reference.test-java}
application.title=api-java
application.vendor=jboner
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
# Uncomment to specify the preferred debugger connection transport:
#debug.transport=dt_socket
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/api-java.jar
dist.javadoc.dir=${dist.dir}/javadoc
excludes=
file.reference.activation-1.1.jar=../lib/activation-1.1.jar
file.reference.akka-util-java.jar=../lib/akka-util-java.jar
file.reference.antlr-3.1.3.jar=../lib/antlr-3.1.3.jar
file.reference.aopalliance-1.0.jar=../lib/aopalliance-1.0.jar
file.reference.asm-3.1.jar=../lib/asm-3.1.jar
file.reference.asm-all-2.2.1.jar=../lib/asm-all-2.2.1.jar
file.reference.cassandra.jar=../lib/cassandra.jar
file.reference.catalina-ant.jar=../lib/catalina-ant.jar
file.reference.cglib-2.2.jar=../lib/cglib-2.2.jar
file.reference.colt-1.2.0.jar=../lib/colt-1.2.0.jar
file.reference.commons-cli-1.1.jar=../lib/commons-cli-1.1.jar
file.reference.commons-codec-1.3.jar=../lib/commons-codec-1.3.jar
file.reference.commons-collections-3.2.1.jar=../lib/commons-collections-3.2.1.jar
file.reference.commons-dbcp-1.2.2.jar=../lib/commons-dbcp-1.2.2.jar
file.reference.commons-httpclient-3.1.jar=../lib/commons-httpclient-3.1.jar
file.reference.commons-io-1.3.2.jar=../lib/commons-io-1.3.2.jar
file.reference.commons-javaflow-1.0-SNAPSHOT.jar=../lib/commons-javaflow-1.0-SNAPSHOT.jar
file.reference.commons-lang-2.4.jar=../lib/commons-lang-2.4.jar
file.reference.commons-logging-1.0.4.jar=../lib/commons-logging-1.0.4.jar
file.reference.commons-math-1.1.jar=../lib/commons-math-1.1.jar
file.reference.commons-pool-1.4.jar=../lib/commons-pool-1.4.jar
file.reference.configgy-1.2.jar=../lib/configgy-1.2.jar
file.reference.google-collect-snapshot-20090211.jar=../lib/google-collect-snapshot-20090211.jar
file.reference.grizzly-framework-1.8.6.3.jar=../lib/grizzly-framework-1.8.6.3.jar
file.reference.grizzly-http-1.8.6.3.jar=../lib/grizzly-http-1.8.6.3.jar
file.reference.grizzly-http-servlet-1.8.6.3.jar=../lib/grizzly-http-servlet-1.8.6.3.jar
file.reference.grizzly-http-utils-1.8.6.3.jar=../lib/grizzly-http-utils-1.8.6.3.jar
file.reference.grizzly-portunif-1.8.6.3.jar=../lib/grizzly-portunif-1.8.6.3.jar
file.reference.grizzly-rcm-1.8.6.3.jar=../lib/grizzly-rcm-1.8.6.3.jar
file.reference.grizzly-servlet-webserver-1.8.6.3.jar=../lib/grizzly-servlet-webserver-1.8.6.3.jar
file.reference.guice-core-2.0-SNAPSHOT.jar=../lib/guice-core-2.0-SNAPSHOT.jar
file.reference.guice-jsr250-2.0-SNAPSHOT.jar=../lib/guice-jsr250-2.0-SNAPSHOT.jar
file.reference.high-scale-lib.jar=../lib/high-scale-lib.jar
file.reference.jaxb-api-2.1.jar=../lib/jaxb-api-2.1.jar
file.reference.jaxb-impl-2.1.jar=../lib/jaxb-impl-2.1.jar
file.reference.jdom-1.0.jar=../lib/jdom-1.0.jar
file.reference.je-3.3.62.jar=../lib/je-3.3.62.jar
file.reference.jersey-atom-1.0.1.jar=../lib/jersey-atom-1.0.1.jar
file.reference.jersey-core-1.0.1.jar=../lib/jersey-core-1.0.1.jar
file.reference.jersey-json-1.0.1.jar=../lib/jersey-json-1.0.1.jar
file.reference.jersey-server-1.0.1.jar=../lib/jersey-server-1.0.1.jar
file.reference.jettison-1.0.1.jar=../lib/jettison-1.0.1.jar
file.reference.jetty-6.1.6rc0.jar=../lib/jetty-6.1.6rc0.jar
file.reference.jetty-util-6.1.6rc0.jar=../lib/jetty-util-6.1.6rc0.jar
file.reference.JSAP-2.1.jar=../lib/JSAP-2.1.jar
file.reference.jsr250-api-1.0.jar=../lib/jsr250-api-1.0.jar
file.reference.jsr311-api-1.0.jar=../lib/jsr311-api-1.0.jar
file.reference.junit-3.8.2.jar=../lib/junit-3.8.2.jar
file.reference.junit-4.5.jar=../lib/junit-4.5.jar
file.reference.junit4runner-1.0-SNAPSHOT.jar=../lib/junit4runner-1.0-SNAPSHOT.jar
file.reference.libfb303.jar=../lib/libfb303.jar
file.reference.libthrift-20080411p1.jar=../lib/libthrift-20080411p1.jar
file.reference.libthrift.jar=../lib/libthrift.jar
file.reference.log4j-1.2.15.jar=../lib/log4j-1.2.15.jar
file.reference.lucene-core-2.2.0.jar=../lib/lucene-core-2.2.0.jar
file.reference.main-java=src/main/java
file.reference.mina-core-2.0.0-M2-SNAPSHOT.jar=../lib/mina-core-2.0.0-M2-SNAPSHOT.jar
file.reference.mina-integration-scala-2.0.0-M2-SNAPSHOT.jar=../lib/mina-integration-scala-2.0.0-M2-SNAPSHOT.jar
file.reference.pcj.jar=../lib/pcj.jar
file.reference.protobuf-java-2.0.3.jar=../lib/protobuf-java-2.0.3.jar
file.reference.rome-0.9.jar=../lib/rome-0.9.jar
file.reference.scala-library-2.7.3.jar=../lib/scala-library-2.7.3.jar
file.reference.scala-library-2.7.3.zip=../lib/scala-library-2.7.3.zip
file.reference.scalatest-0.9.5.jar=../lib/scalatest-0.9.5.jar
file.reference.scalatest-0.9.5.zip=../lib/scalatest-0.9.5.zip
file.reference.servlet-api-2.5.jar=../lib/servlet-api-2.5.jar
file.reference.slf4j-api-1.4.3.jar=../lib/slf4j-api-1.4.3.jar
file.reference.slf4j-log4j12-1.4.3.jar=../lib/slf4j-log4j12-1.4.3.jar
file.reference.stax-api-1.0-2.jar=../lib/stax-api-1.0-2.jar
file.reference.stringtemplate-3.0.jar=../lib/stringtemplate-3.0.jar
file.reference.test-java=src/test/java
file.reference.velocity-1.5.jar=../lib/velocity-1.5.jar
file.reference.voldemort-0.4a.jar=../lib/voldemort-0.4a.jar
file.reference.voldemort-contrib-0.4a.jar=../lib/voldemort-contrib-0.4a.jar
file.reference.xerces.jar=../lib/xerces.jar
file.reference.zookeeper-3.1.0.jar=../lib/zookeeper-3.1.0.jar
includes=**
jar.compress=false
javac.classpath=\
${reference.akka-kernel.jar}:\
${file.reference.activation-1.1.jar}:\
${file.reference.akka-util-java.jar}:\
${file.reference.antlr-3.1.3.jar}:\
${file.reference.aopalliance-1.0.jar}:\
${file.reference.asm-3.1.jar}:\
${file.reference.asm-all-2.2.1.jar}:\
${file.reference.cassandra.jar}:\
${file.reference.catalina-ant.jar}:\
${file.reference.cglib-2.2.jar}:\
${file.reference.colt-1.2.0.jar}:\
${file.reference.commons-cli-1.1.jar}:\
${file.reference.commons-codec-1.3.jar}:\
${file.reference.commons-collections-3.2.1.jar}:\
${file.reference.commons-dbcp-1.2.2.jar}:\
${file.reference.commons-httpclient-3.1.jar}:\
${file.reference.commons-io-1.3.2.jar}:\
${file.reference.commons-javaflow-1.0-SNAPSHOT.jar}:\
${file.reference.commons-lang-2.4.jar}:\
${file.reference.commons-logging-1.0.4.jar}:\
${file.reference.commons-math-1.1.jar}:\
${file.reference.commons-pool-1.4.jar}:\
${file.reference.configgy-1.2.jar}:\
${file.reference.google-collect-snapshot-20090211.jar}:\
${file.reference.grizzly-framework-1.8.6.3.jar}:\
${file.reference.grizzly-http-1.8.6.3.jar}:\
${file.reference.grizzly-http-servlet-1.8.6.3.jar}:\
${file.reference.grizzly-http-utils-1.8.6.3.jar}:\
${file.reference.grizzly-portunif-1.8.6.3.jar}:\
${file.reference.grizzly-rcm-1.8.6.3.jar}:\
${file.reference.grizzly-servlet-webserver-1.8.6.3.jar}:\
${file.reference.guice-core-2.0-SNAPSHOT.jar}:\
${file.reference.guice-jsr250-2.0-SNAPSHOT.jar}:\
${file.reference.high-scale-lib.jar}:\
${file.reference.jaxb-api-2.1.jar}:\
${file.reference.jaxb-impl-2.1.jar}:\
${file.reference.jdom-1.0.jar}:\
${file.reference.je-3.3.62.jar}:\
${file.reference.jersey-atom-1.0.1.jar}:\
${file.reference.jersey-core-1.0.1.jar}:\
${file.reference.jersey-json-1.0.1.jar}:\
${file.reference.jersey-server-1.0.1.jar}:\
${file.reference.jettison-1.0.1.jar}:\
${file.reference.jetty-6.1.6rc0.jar}:\
${file.reference.jetty-util-6.1.6rc0.jar}:\
${file.reference.JSAP-2.1.jar}:\
${file.reference.jsr250-api-1.0.jar}:\
${file.reference.jsr311-api-1.0.jar}:\
${file.reference.junit-3.8.2.jar}:\
${file.reference.junit-4.5.jar}:\
${file.reference.junit4runner-1.0-SNAPSHOT.jar}:\
${file.reference.libfb303.jar}:\
${file.reference.libthrift-20080411p1.jar}:\
${file.reference.libthrift.jar}:\
${file.reference.log4j-1.2.15.jar}:\
${file.reference.lucene-core-2.2.0.jar}:\
${file.reference.mina-core-2.0.0-M2-SNAPSHOT.jar}:\
${file.reference.mina-integration-scala-2.0.0-M2-SNAPSHOT.jar}:\
${file.reference.pcj.jar}:\
${file.reference.protobuf-java-2.0.3.jar}:\
${file.reference.rome-0.9.jar}:\
${file.reference.scala-library-2.7.3.jar}:\
${file.reference.scala-library-2.7.3.zip}:\
${file.reference.scalatest-0.9.5.jar}:\
${file.reference.scalatest-0.9.5.zip}:\
${file.reference.servlet-api-2.5.jar}:\
${file.reference.slf4j-api-1.4.3.jar}:\
${file.reference.slf4j-log4j12-1.4.3.jar}:\
${file.reference.stax-api-1.0-2.jar}:\
${file.reference.stringtemplate-3.0.jar}:\
${file.reference.velocity-1.5.jar}:\
${file.reference.voldemort-0.4a.jar}:\
${file.reference.voldemort-contrib-0.4a.jar}:\
${file.reference.xerces.jar}:\
${file.reference.zookeeper-3.1.0.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.source=1.5
javac.target=1.5
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
${libs.junit.classpath}:\
${libs.junit_4.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
platform.active=default_platform
project.akka-kernel=../kernel
reference.akka-kernel.jar=${project.akka-kernel}/dist/akka-kernel.jar
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
# or test-sys-prop.name=value to set system properties for unit tests):
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
source.encoding=UTF-8
src.dir=${file.reference.main-java}
test.src.dir=${file.reference.test-java}

View file

@ -1,26 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>api-java</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
<references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
<reference>
<foreign-project>akka-kernel</foreign-project>
<artifact-type>jar</artifact-type>
<script>build.xml</script>
<target>jar</target>
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
</references>
</configuration>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>api-java</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
<references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
<reference>
<foreign-project>akka-kernel</foreign-project>
<artifact-type>jar</artifact-type>
<script>build.xml</script>
<target>jar</target>
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
</references>
</configuration>
</project>

View file

@ -103,58 +103,58 @@ public class ActiveObjectGuiceConfiguratorTest extends TestCase {
} catch (RuntimeException e) {
}
}
}
interface Foo {
public String foo(String msg);
@oneway public void bar(String msg);
public void longRunning();
public void throwsException();
public Bar getBar();
interface Foo {
public String foo(String msg);
@oneway public void bar(String msg);
public void longRunning();
public void throwsException();
public Bar getBar();
}
class FooImpl implements Foo {
@Inject private Bar bar;
public Bar getBar() {
return bar;
}
class FooImpl implements Foo {
@Inject private Bar bar;
public Bar getBar() {
return bar;
}
public String foo(String msg) {
return msg + "return_foo ";
}
public void bar(String msg) {
bar.bar(msg);
}
public void longRunning() {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
}
}
public void throwsException() {
throw new RuntimeException("expected");
public String foo(String msg) {
return msg + "return_foo ";
}
public void bar(String msg) {
bar.bar(msg);
}
public void longRunning() {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
}
}
interface Bar {
@oneway void bar(String msg);
Ext getExt();
public void throwsException() {
throw new RuntimeException("expected");
}
}
class BarImpl implements Bar {
@Inject private Ext ext;
public Ext getExt() {
return ext;
}
public void bar(String msg) {
}
interface Bar {
@oneway void bar(String msg);
Ext getExt();
}
class BarImpl implements Bar {
@Inject private Ext ext;
public Ext getExt() {
return ext;
}
interface Ext {
void ext();
public void bar(String msg) {
}
}
class ExtImpl implements Ext {
public void ext() {
}
interface Ext {
void ext();
}
class ExtImpl implements Ext {
public void ext() {
}
}

View file

@ -14,7 +14,6 @@ import com.google.inject.Scopes;
import junit.framework.TestCase;
public class InMemoryStateTest extends TestCase {
static String messageLog = "";
@ -22,57 +21,50 @@ public class InMemoryStateTest extends TestCase {
protected void setUp() {
conf.configureActiveObjects(
new RestartStrategy(new AllForOne(), 3, 5000), new Component[]{
new Component(
Stateful.class,
StatefulImpl.class,
new LifeCycle(new Permanent(), 1000),
10000000),
new Component(
Failer.class,
FailerImpl.class,
new LifeCycle(new Permanent(), 1000),
1000),
new Component(
Clasher.class,
ClasherImpl.class,
new LifeCycle(new Permanent(), 1000),
100000)
new RestartStrategy(new AllForOne(), 3, 5000),
new Component[] {
new Component(InMemStateful.class, InMemStatefulImpl.class, new LifeCycle(new Permanent(), 1000), 10000000),
new Component(InMemFailer.class, InMemFailerImpl.class, new LifeCycle(new Permanent(), 1000), 1000),
new Component(InMemClasher.class, InMemClasherImpl.class, new LifeCycle(new Permanent(), 1000), 100000)
}).inject().supervise();
}
// public void testShouldNotRollbackStateForStatefulServerInCaseOfSuccess() {
// Stateful stateful = conf.getActiveObject(Stateful.class);
// stateful.setState("stateful", "init"); // set init state
// stateful.success("stateful", "new state"); // transactional
// assertEquals("new state", stateful.getState("stateful"));
// }
//
// public void testShouldRollbackStateForStatefulServerInCaseOfFailure() {
// Stateful stateful = conf.getActiveObject(Stateful.class);
// stateful.setState("stateful", "init"); // set init state
//
// Failer failer = conf.getActiveObject(Failer.class);
// try {
// stateful.failure("stateful", "new state", failer); // call failing transactional method
// fail("should have thrown an exception");
// } catch (RuntimeException e) { } // expected
// assertEquals("init", stateful.getState("stateful")); // check that state is == init state
// }
// public void testShouldNotRollbackStateForStatefulServerInCaseOfSuccess() {
// Stateful stateful = conf.getActiveObject(Stateful.class);
// stateful.setState("stateful", "init"); // set init state
// stateful.success("stateful", "new state"); // transactional
// assertEquals("new state", stateful.getState("stateful"));
// }
//
// public void testShouldRollbackStateForStatefulServerInCaseOfFailure() {
// Stateful stateful = conf.getActiveObject(Stateful.class);
// stateful.setState("stateful", "init"); // set init state
//
// Failer failer = conf.getActiveObject(Failer.class);
// try {
// stateful.failure("stateful", "new state", failer); // call failing
// transactional method
// fail("should have thrown an exception");
// } catch (RuntimeException e) { } // expected
// assertEquals("init", stateful.getState("stateful")); // check that state is
// == init state
// }
public void testShouldRollbackStateForStatefulServerInCaseOfMessageClash() {
Stateful stateful = conf.getActiveObject(Stateful.class);
InMemStateful stateful = conf.getActiveObject(InMemStateful.class);
stateful.setState("stateful", "init"); // set init state
Clasher clasher = conf.getActiveObject(Clasher.class);
InMemClasher clasher = conf.getActiveObject(InMemClasher.class);
clasher.setState("clasher", "init"); // set init state
// try {
// stateful.clashOk("stateful", "new state", clasher);
// } catch (RuntimeException e) { } // expected
// assertEquals("new state", stateful.getState("stateful")); // check that state is == init state
// assertEquals("was here", clasher.getState("clasher")); // check that state is == init state
// try {
// stateful.clashOk("stateful", "new state", clasher);
// } catch (RuntimeException e) { } // expected
// assertEquals("new state", stateful.getState("stateful")); // check that
// state is == init state
// assertEquals("was here", clasher.getState("clasher")); // check that
// state is == init state
try {
stateful.clashNotOk("stateful", "new state", clasher);
@ -80,113 +72,111 @@ public class InMemoryStateTest extends TestCase {
} catch (RuntimeException e) {
System.out.println(e);
} // expected
assertEquals("init", stateful.getState("stateful")); // check that state is == init state
//assertEquals("init", clasher.getState("clasher")); // check that state is == init state
}
interface Stateful {
// transactional
@transactional
public void success(String key, String msg);
@transactional
public void failure(String key, String msg, Failer failer);
@transactional
public void clashOk(String key, String msg, Clasher clasher);
@transactional
public void clashNotOk(String key, String msg, Clasher clasher);
// non-transactional
public String getState(String key);
public void setState(String key, String value);
}
class StatefulImpl implements Stateful {
@state
private
InMemoryState<String, Object> state = new InMemoryState<String, Object>();
public String getState(String key) {
return (String) state.get(key);
}
public void setState(String key, String msg) {
state.put(key, msg);
}
public void success(String key, String msg) {
state.put(key, msg);
}
public void failure(String key, String msg, Failer failer) {
state.put(key, msg);
failer.fail();
}
public void clashOk(String key, String msg, Clasher clasher) {
state.put(key, msg);
clasher.clash();
}
public void clashNotOk(String key, String msg, Clasher clasher) {
state.put(key, msg);
clasher.clash();
clasher.clash();
}
}
interface Failer {
public void fail();
}
class FailerImpl implements Failer {
public void fail() {
throw new RuntimeException("expected");
}
}
interface Clasher {
public void clash();
public String getState(String key);
public void setState(String key, String value);
}
class ClasherImpl implements Clasher {
@state
private InMemoryState<String, Object> state = new InMemoryState<String, Object>();
public String getState(String key) {
return (String) state.get(key);
}
public void setState(String key, String msg) {
state.put(key, msg);
}
public void clash() {
state.put("clasher", "was here");
// spend some time here
for (long i = 0; i < 1000000000; i++) {
for (long j = 0; j < 10000000; j++) {
j += i;
}
}
// FIXME: this statement gives me this error:
// se.scalablesolutions.akka.kernel.ActiveObjectException:
// Unexpected message [!(scala.actors.Channel@c2b2f6,ErrRef[Right(null)])] to
// [GenericServer[se.scalablesolutions.akka.api.StatefulImpl]] from
// [GenericServer[se.scalablesolutions.akka.api.ClasherImpl]]]
//try { Thread.sleep(1000); } catch (InterruptedException e) {}
}
assertEquals("init", stateful.getState("stateful")); // check that state is
// == init state
// assertEquals("init", clasher.getState("clasher")); // check that state is
// == init state
}
}
interface InMemStateful {
// transactional
@transactional
public void success(String key, String msg);
@transactional
public void failure(String key, String msg, InMemFailer failer);
@transactional
public void clashOk(String key, String msg, InMemClasher clasher);
@transactional
public void clashNotOk(String key, String msg, InMemClasher clasher);
// non-transactional
public String getState(String key);
public void setState(String key, String value);
}
class InMemStatefulImpl implements InMemStateful {
@state
private InMemoryState<String, Object> state = new InMemoryState<String, Object>();
public String getState(String key) {
return (String) state.get(key);
}
public void setState(String key, String msg) {
state.put(key, msg);
}
public void success(String key, String msg) {
state.put(key, msg);
}
public void failure(String key, String msg, InMemFailer failer) {
state.put(key, msg);
failer.fail();
}
public void clashOk(String key, String msg, InMemClasher clasher) {
state.put(key, msg);
clasher.clash();
}
public void clashNotOk(String key, String msg, InMemClasher clasher) {
state.put(key, msg);
clasher.clash();
clasher.clash();
}
}
interface InMemFailer {
public void fail();
}
class InMemFailerImpl implements InMemFailer {
public void fail() {
throw new RuntimeException("expected");
}
}
interface InMemClasher {
public void clash();
public String getState(String key);
public void setState(String key, String value);
}
class InMemClasherImpl implements InMemClasher {
@state
private InMemoryState<String, Object> state = new InMemoryState<String, Object>();
public String getState(String key) {
return (String) state.get(key);
}
public void setState(String key, String msg) {
state.put(key, msg);
}
public void clash() {
state.put("clasher", "was here");
// spend some time here
for (long i = 0; i < 1000000000; i++) {
for (long j = 0; j < 10000000; j++) {
j += i;
}
}
// FIXME: this statement gives me this error:
// se.scalablesolutions.akka.kernel.ActiveObjectException:
// Unexpected message [!(scala.actors.Channel@c2b2f6,ErrRef[Right(null)])]
// to
// [GenericServer[se.scalablesolutions.akka.api.StatefulImpl]] from
// [GenericServer[se.scalablesolutions.akka.api.ClasherImpl]]]
// try { Thread.sleep(1000); } catch (InterruptedException e) {}
}
}

View file

@ -14,7 +14,6 @@ import com.google.inject.Scopes;
import junit.framework.TestCase;
public class PersistentStateTest extends TestCase {
static String messageLog = "";
@ -22,131 +21,121 @@ public class PersistentStateTest extends TestCase {
protected void setUp() {
conf.configureActiveObjects(
new RestartStrategy(new AllForOne(), 3, 5000), new Component[]{
new Component(
Stateful.class,
StatefulImpl.class,
new LifeCycle(new Permanent(), 1000),
10000000),
new Component(
Failer.class,
FailerImpl.class,
new LifeCycle(new Permanent(), 1000),
1000),
new Component(
Clasher.class,
ClasherImpl.class,
new LifeCycle(new Permanent(), 1000),
100000)
new RestartStrategy(new AllForOne(), 3, 5000),
new Component[] {
new Component(PersistentStateful.class, PersistentStatefulImpl.class, new LifeCycle(new Permanent(), 1000), 10000000),
new Component(PersistentFailer.class, PersistentFailerImpl.class, new LifeCycle(new Permanent(), 1000), 1000),
new Component(PersistentClasher.class, PersistentClasherImpl.class, new LifeCycle(new Permanent(), 1000), 100000)
}).inject().supervise();
}
public void testShouldNotRollbackStateForStatefulServerInCaseOfSuccess() {
Stateful stateful = conf.getActiveObject(Stateful.class);
PersistentStateful stateful = conf.getActiveObject(PersistentStateful.class);
stateful.setState("stateful", "init"); // set init state
stateful.success("stateful", "new state"); // transactional
assertEquals("new state", stateful.getState("stateful"));
}
}
interface Stateful {
// transactional
@transactional
public void success(String key, String msg);
interface PersistentStateful {
// transactional
@transactional
public void success(String key, String msg);
@transactional
public void failure(String key, String msg, Failer failer);
@transactional
public void failure(String key, String msg, PersistentFailer failer);
@transactional
public void clashOk(String key, String msg, Clasher clasher);
@transactional
public void clashOk(String key, String msg, PersistentClasher clasher);
@transactional
public void clashNotOk(String key, String msg, Clasher clasher);
@transactional
public void clashNotOk(String key, String msg, PersistentClasher clasher);
// non-transactional
public String getState(String key);
// non-transactional
public String getState(String key);
public void setState(String key, String value);
public void setState(String key, String value);
}
class PersistentStatefulImpl implements PersistentStateful {
@state
private InMemoryState<String, Object> state = new InMemoryState<String, Object>();
public String getState(String key) {
return (String) state.get(key);
}
class StatefulImpl implements Stateful {
@state
private InMemoryState<String, Object> state = new InMemoryState<String, Object>();
public String getState(String key) {
return (String) state.get(key);
}
public void setState(String key, String msg) {
state.put(key, msg);
}
public void success(String key, String msg) {
state.put(key, msg);
}
public void failure(String key, String msg, Failer failer) {
state.put(key, msg);
failer.fail();
}
public void clashOk(String key, String msg, Clasher clasher) {
state.put(key, msg);
clasher.clash();
}
public void clashNotOk(String key, String msg, Clasher clasher) {
state.put(key, msg);
clasher.clash();
clasher.clash();
}
public void setState(String key, String msg) {
state.put(key, msg);
}
interface Failer {
public void fail();
public void success(String key, String msg) {
state.put(key, msg);
}
class FailerImpl implements Failer {
public void fail() {
throw new RuntimeException("expected");
}
public void failure(String key, String msg, PersistentFailer failer) {
state.put(key, msg);
failer.fail();
}
interface Clasher {
public void clash();
public String getState(String key);
public void setState(String key, String value);
public void clashOk(String key, String msg, PersistentClasher clasher) {
state.put(key, msg);
clasher.clash();
}
class ClasherImpl implements Clasher {
@state
private InMemoryState<String, Object> state = new InMemoryState<String, Object>();
public void clashNotOk(String key, String msg, PersistentClasher clasher) {
state.put(key, msg);
clasher.clash();
clasher.clash();
}
}
public String getState(String key) {
return (String) state.get(key);
}
interface PersistentFailer {
public void fail();
}
public void setState(String key, String msg) {
state.put(key, msg);
}
class PersistentFailerImpl implements PersistentFailer {
public void fail() {
throw new RuntimeException("expected");
}
}
public void clash() {
state.put("clasher", "was here");
// spend some time here
for (long i = 0; i < 1000000000; i++) {
for (long j = 0; j < 10000000; j++) {
j += i;
}
interface PersistentClasher {
public void clash();
public String getState(String key);
public void setState(String key, String value);
}
class PersistentClasherImpl implements PersistentClasher {
@state
private InMemoryState<String, Object> state = new InMemoryState<String, Object>();
public String getState(String key) {
return (String) state.get(key);
}
public void setState(String key, String msg) {
state.put(key, msg);
}
public void clash() {
state.put("clasher", "was here");
// spend some time here
for (long i = 0; i < 1000000000; i++) {
for (long j = 0; j < 10000000; j++) {
j += i;
}
// FIXME: this statement gives me this error:
// se.scalablesolutions.akka.kernel.ActiveObjectException:
// Unexpected message [!(scala.actors.Channel@c2b2f6,ErrRef[Right(null)])] to
// [GenericServer[se.scalablesolutions.akka.api.StatefulImpl]] from
// [GenericServer[se.scalablesolutions.akka.api.ClasherImpl]]]
//try { Thread.sleep(1000); } catch (InterruptedException e) {}
}
// FIXME: this statement gives me this error:
// se.scalablesolutions.akka.kernel.ActiveObjectException:
// Unexpected message [!(scala.actors.Channel@c2b2f6,ErrRef[Right(null)])]
// to
// [GenericServer[se.scalablesolutions.akka.api.StatefulImpl]] from
// [GenericServer[se.scalablesolutions.akka.api.ClasherImpl]]]
// try { Thread.sleep(1000); } catch (InterruptedException e) {}
}
}

View file

@ -39,4 +39,4 @@ JVM_OPTS=" \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false"
java $JVM_OPTS $STORAGE_OPTS -cp $CLASSPATH se.scalablesolutions.akka.Boot se.scalablesolutions.akka.kernel.Kernel ${1}
java $JVM_OPTS $STORAGE_OPTS -cp $CLASSPATH se.scalablesolutions.akka.Boot se.scalablesolutions.akka.kernel.Kernel ${1}

View file

@ -22,25 +22,33 @@ JERSEY = ['com.sun.jersey:jersey-core:jar:1.0.1',
'com.sun.jersey:jersey-json:jar:1.0.1',
'com.sun.jersey:jersey-atom:jar:1.0.1',
'javax.ws.rs:jsr311-api:jar:1.0']
VOLDEMORT = ['voldemort:voldemort:jar:0.4a',
'voldemort:voldemort-contrib:jar:0.4a']
ZOOKEEPER = 'org.apache:zookeeper:jar:3.1.0'
GRIZZLY = 'com.sun.grizzly:grizzly-servlet-webserver:jar:1.8.6.3'
MINA_CORE = 'com.assembla.scala.mina:mina-core:jar:2.0.0-M2-SNAPSHOT'
MINA_SCALA = 'com.assembla.scala.mina:mina-integration-scala:jar:2.0.0-M2-SNAPSHOT'
NETTY = 'org.jboss.netty:netty:jar:3.1.0.BETA2'
CASSANDRA = 'org.apache.cassandra:cassandra:jar:1.0'
THRIFT = 'com.facebook:thrift:jar:1.0'
FB303 = 'com.facebook:fb303:jar:1.0'
CONFIGGY = 'net.lag:configgy:jar:1.2'
JSR_250 = 'javax.annotation:jsr250-api:jar:1.0'
SLF4J = ['org.slf4j:slf4j-log4j12:jar:1.4.3',
'org.slf4j:slf4j-api:jar:1.4.3',
'log4j:log4j:jar:1.2.13']
JDOM = 'jdom:jdom:jar:1.0'
CGLIB = 'cglib:cglib-nodep:jar:2.1_3'
AOPALLIANCE = 'aopalliance:aopalliance:jar:1.0'
GOOGLE_COLLECT = 'com.google.code.google-collections:google-collect:jar:snapshot-20080530'
SCALA = 'org.scala-lang:scala-library:jar:2.7.3'
SCALATEST = 'org.scala-tools.testing:scalatest:jar:0.9.5'
JUNIT4 = 'junit:junit:jar:4.5'
JUNIT3 = 'junit:junit:jar:3.8.2'
#SCALATEST_JUNIT4_MVN_PLUGIN = 'com.jteigen.scalatest:junit4runner:jar:1.0-SNAPSHOT'
JUNIT4RUNNER = 'com.jteigen.scalatest:junit4runner:jar:1.0'
#VOLDEMORT = ['voldemort:voldemort:jar:0.4a',
# 'voldemort:voldemort-contrib:jar:0.4a']
#MINA_CORE = 'com.assembla.scala.mina:mina-core:jar:2.0.0-M2-SNAPSHOT'
#MINA_SCALA = 'com.assembla.scala.mina:mina-integration-scala:jar:2.0.0-M2-SNAPSHOT'
#ZOOKEEPER = 'org.apache:zookeeper:jar:3.1.0'
desc 'The Akka Actor Kernel'
define 'akka' do
@ -55,16 +63,17 @@ define 'akka' do
package :jar
end
desc 'Akka Actor kernel core implementation'
desc 'Akka Actor Kernel core implementation'
define 'kernel' do
compile.with(AKKA_UTIL_JAVA, GUICEYFRUIT, MINA_CORE, MINA_SCALA, JERSEY, VOLDEMORT, ZOOKEEPER, SLF4J, GRIZZLY, CONFIGGY)
test.using :scalatest
compile.with(AKKA_UTIL_JAVA, GUICEYFRUIT, NETTY, JERSEY, GRIZZLY, CASSANDRA, THRIFT, FB303, SLF4J, CONFIGGY, JUNIT4RUNNER, JUNIT4, SCALATEST)
test.using :junit
package :jar
end
desc 'Akka Java API'
define 'api-java' do
compile.with(AKKA_KERNEL, AKKA_UTIL_JAVA, GUICEYFRUIT)
compile.with(AKKA_KERNEL, AKKA_UTIL_JAVA, NETTY, JERSEY, GRIZZLY, CASSANDRA, THRIFT, FB303, SLF4J, CONFIGGY, GUICEYFRUIT, SCALA, GOOGLE_COLLECT, AOPALLIANCE, CGLIB, JSR_250)
test.using :junit
package :jar
end
@ -74,20 +83,12 @@ define 'akka' do
# test.using :scalatest
# package :jar
#end
#desc 'Implementation of Erlangs Supervisor and GenericServer behaviors'
#define 'supervisor' do
# compile.with(CONFIGGY)
# test.using :scalatest
# package :jar
#end
package(:zip).include 'README'
package(:zip).include 'bin/*', :path=>'bin'
package(:zip).include 'config/*', :path=>'config'
package(:zip).include 'kernel/lib/*', :path=>'lib'
package(:zip).include 'kernel/target/*.jar', :path=>'lib'
#package(:zip).include 'supervisor/target/*.jar', :path=>'lib'
package(:zip).include 'api-java/target/*.jar', :path=>'lib'
package(:zip).include 'util-java/target/*.jar', :path=>'lib'
@ -100,7 +101,7 @@ define 'akka' do
# uri = URI("file://./lib")
# uri.upload file('kernel')
cp = [SCALA, GUICEYFRUIT, JERSEY, VOLDEMORT, GOOGLE_COLLECT, JDOM, ZOOKEEPER, SLF4J, GRIZZLY, CONFIGGY, project('kernel').package(:jar)]
cp = [SCALA, GUICEYFRUIT, JERSEY, CASSANDRA, GOOGLE_COLLECT, JDOM, ZOOKEEPER, SLF4J, GRIZZLY, CONFIGGY, project('kernel').package(:jar)]
# Java.java('se.scalablesolutions.akka.kernel.Kernel', {:classpath => '-cp ' + cp})
# cp = FileList[_('lib/*')].join(File::PATH_SEPARATOR)
puts "Running with classpath:\n" + cp

View file

@ -2,7 +2,7 @@
# and the pattern to %c instead of %l. (%l is slower.)
# output messages into a rolling log file as well as stdout
log4j.rootLogger=DEBUG,stdout,R
log4j.rootLogger=ERROR,stdout,R
# stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender

View file

@ -19,22 +19,22 @@
<ThriftPort>9160</ThriftPort>
<ColumnIndexSizeInKB>256</ColumnIndexSizeInKB>
<HttpPort>7002</HttpPort>
<MetadataDirectory>./storage/system</MetadataDirectory>
<CommitLogDirectory>./storage/commitlog</CommitLogDirectory>
<MetadataDirectory>/Users/jboner/src/scala/akka/storage/system</MetadataDirectory>
<CommitLogDirectory>/Users/jboner/src/scala/akka/storage/commitlog</CommitLogDirectory>
<CommitLogRotationThresholdInMB>128</CommitLogRotationThresholdInMB>
<GangliaServers>
<GangliaServer>127.0.0.1:12000</GangliaServer>
</GangliaServers>
<DataFileDirectories>
<DataFileDirectory>./storage/data</DataFileDirectory>
<DataFileDirectory>/Users/jboner/src/scala/akka/storage/data</DataFileDirectory>
</DataFileDirectories>
<CalloutLocation>./storage/callouts</CalloutLocation>
<BootstrapFileDirectory>./storage/bootstrap</BootstrapFileDirectory>
<StagingFileDirectory>./storage/staging</StagingFileDirectory>
<CalloutLocation>/Users/jboner/src/scala/akka/storage/callouts</CalloutLocation>
<BootstrapFileDirectory>/Users/jboner/src/scala/akka/storage/bootstrap</BootstrapFileDirectory>
<StagingFileDirectory>/Users/jboner/src/scala/akka/storage/staging</StagingFileDirectory>
<CommitLogFastSync>false</CommitLogFastSync>
<Tables>
<Table Name = "akka">
<ColumnFamily ColumnSort="Name" Name="hash"/>
<ColumnFamily ColumnSort="Name" Name="hashtrie"/>
<!--ColumnFamily ColumnType="Super" ColumnSort="Name" Name="Super2"/-->
</Table>
</Tables>

View file

@ -76,7 +76,6 @@
<classpathentry kind="lib" path="/Users/jboner/src/scala/akka/lib/voldemort-contrib-0.4a.jar"/>
<classpathentry kind="lib" path="/Users/jboner/src/scala/akka/lib/xerces.jar"/>
<classpathentry kind="lib" path="/Users/jboner/src/scala/akka/lib/zookeeper-3.1.0.jar"/>
<classpathentry kind="var" path="JRE_LIB"/>
<classpathentry kind="lib" path="/Users/jboner/src/scala/akka/config"/>
<classpathentry kind="output" path="build"/>
</classpath>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
build.xml.data.CRC32=e25238a8
build.xml.script.CRC32=c2aecc70
build.xml.stylesheet.CRC32=ca9d572e
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=4c75645b
nbproject/build-impl.xml.script.CRC32=a2fb0c36
nbproject/build-impl.xml.stylesheet.CRC32=371897b9
build.xml.data.CRC32=e25238a8
build.xml.script.CRC32=c2aecc70
build.xml.stylesheet.CRC32=ca9d572e
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=e25238a8
nbproject/build-impl.xml.script.CRC32=749b9ab1
nbproject/build-impl.xml.stylesheet.CRC32=371897b9@1.3.0

View file

@ -1,6 +1,5 @@
do.depend=false
do.jar=false
javac.debug=true
javadoc.preview=true
jaxws.endorsed.dir=C:\\Program Files\\NetBeans 6.5.1\\java2\\modules\\ext\\jaxws21\\api
user.properties.file=C:\\Documents and Settings\\jboner\\.netbeans\\6.5\\build.properties
do.depend=false
do.jar=false
javac.debug=true
javadoc.preview=true
user.properties.file=/Users/jboner/.netbeans/dev/build.properties

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
</project-private>
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
</project-private>

View file

@ -1,216 +1,222 @@
application.title=akka-kernel
application.vendor=jboner
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form,**/*.scala
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/akka-kernel.jar
dist.javadoc.dir=${dist.dir}/javadoc
excludes=
file.reference.activation-1.1.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\activation-1.1.jar
file.reference.akka-util-java.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\akka-util-java.jar
file.reference.antlr-3.1.3.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\antlr-3.1.3.jar
file.reference.aopalliance-1.0.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\aopalliance-1.0.jar
file.reference.asm-3.1.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\asm-3.1.jar
file.reference.asm-all-2.2.1.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\asm-all-2.2.1.jar
file.reference.cassandra.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\cassandra.jar
file.reference.catalina-ant.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\catalina-ant.jar
file.reference.cglib-2.2.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\cglib-2.2.jar
file.reference.colt-1.2.0.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\colt-1.2.0.jar
file.reference.commons-cli-1.1.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\commons-cli-1.1.jar
file.reference.commons-codec-1.3.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\commons-codec-1.3.jar
file.reference.commons-collections-3.2.1.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\commons-collections-3.2.1.jar
file.reference.commons-dbcp-1.2.2.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\commons-dbcp-1.2.2.jar
file.reference.commons-httpclient-3.1.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\commons-httpclient-3.1.jar
file.reference.commons-io-1.3.2.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\commons-io-1.3.2.jar
file.reference.commons-javaflow-1.0-SNAPSHOT.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\commons-javaflow-1.0-SNAPSHOT.jar
file.reference.commons-lang-2.4.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\commons-lang-2.4.jar
file.reference.commons-logging-1.0.4.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\commons-logging-1.0.4.jar
file.reference.commons-math-1.1.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\commons-math-1.1.jar
file.reference.commons-pool-1.4.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\commons-pool-1.4.jar
file.reference.configgy-1.2.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\configgy-1.2.jar
file.reference.google-collect-snapshot-20090211.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\google-collect-snapshot-20090211.jar
file.reference.grizzly-framework-1.8.6.3.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\grizzly-framework-1.8.6.3.jar
file.reference.grizzly-http-1.8.6.3.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\grizzly-http-1.8.6.3.jar
file.reference.grizzly-http-servlet-1.8.6.3.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\grizzly-http-servlet-1.8.6.3.jar
file.reference.grizzly-http-utils-1.8.6.3.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\grizzly-http-utils-1.8.6.3.jar
file.reference.grizzly-portunif-1.8.6.3.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\grizzly-portunif-1.8.6.3.jar
file.reference.grizzly-rcm-1.8.6.3.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\grizzly-rcm-1.8.6.3.jar
file.reference.grizzly-servlet-webserver-1.8.6.3.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\grizzly-servlet-webserver-1.8.6.3.jar
file.reference.guice-core-2.0-SNAPSHOT.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\guice-core-2.0-SNAPSHOT.jar
file.reference.guice-jsr250-2.0-SNAPSHOT.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\guice-jsr250-2.0-SNAPSHOT.jar
file.reference.high-scale-lib.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\high-scale-lib.jar
file.reference.jaxb-api-2.1.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\jaxb-api-2.1.jar
file.reference.jaxb-impl-2.1.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\jaxb-impl-2.1.jar
file.reference.jdom-1.0.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\jdom-1.0.jar
file.reference.je-3.3.62.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\je-3.3.62.jar
file.reference.jersey-atom-1.0.1.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\jersey-atom-1.0.1.jar
file.reference.jersey-core-1.0.1.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\jersey-core-1.0.1.jar
file.reference.jersey-json-1.0.1.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\jersey-json-1.0.1.jar
file.reference.jersey-server-1.0.1.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\jersey-server-1.0.1.jar
file.reference.jettison-1.0.1.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\jettison-1.0.1.jar
file.reference.jetty-6.1.6rc0.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\jetty-6.1.6rc0.jar
file.reference.jetty-util-6.1.6rc0.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\jetty-util-6.1.6rc0.jar
file.reference.JSAP-2.1.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\JSAP-2.1.jar
file.reference.jsr250-api-1.0.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\jsr250-api-1.0.jar
file.reference.jsr311-api-1.0.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\jsr311-api-1.0.jar
file.reference.junit-3.8.2.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\junit-3.8.2.jar
file.reference.junit-4.5.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\junit-4.5.jar
file.reference.junit4runner-1.0-SNAPSHOT.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\junit4runner-1.0-SNAPSHOT.jar
file.reference.libfb303.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\libfb303.jar
file.reference.libthrift-20080411p1.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\libthrift-20080411p1.jar
file.reference.libthrift.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\libthrift.jar
file.reference.log4j-1.2.15.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\log4j-1.2.15.jar
file.reference.lucene-core-2.2.0.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\lucene-core-2.2.0.jar
file.reference.main-scala=src/main/scala
file.reference.mina-core-2.0.0-M2-SNAPSHOT.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\mina-core-2.0.0-M2-SNAPSHOT.jar
file.reference.mina-integration-scala-2.0.0-M2-SNAPSHOT.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\mina-integration-scala-2.0.0-M2-SNAPSHOT.jar
file.reference.pcj.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\pcj.jar
file.reference.protobuf-java-2.0.3.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\protobuf-java-2.0.3.jar
file.reference.rome-0.9.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\rome-0.9.jar
file.reference.scala-library-2.7.3.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\scala-library-2.7.3.jar
file.reference.scala-library-2.7.3.zip=C:\\home\\jboner\\src\\scala\\akka\\lib\\scala-library-2.7.3.zip
file.reference.scalatest-0.9.5.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\scalatest-0.9.5.jar
file.reference.scalatest-0.9.5.zip=C:\\home\\jboner\\src\\scala\\akka\\lib\\scalatest-0.9.5.zip
file.reference.servlet-api-2.5.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\servlet-api-2.5.jar
file.reference.slf4j-api-1.4.3.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\slf4j-api-1.4.3.jar
file.reference.slf4j-log4j12-1.4.3.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\slf4j-log4j12-1.4.3.jar
file.reference.stax-api-1.0-2.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\stax-api-1.0-2.jar
file.reference.stringtemplate-3.0.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\stringtemplate-3.0.jar
file.reference.test-scala=src/test/scala
file.reference.velocity-1.5.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\velocity-1.5.jar
file.reference.voldemort-0.4a.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\voldemort-0.4a.jar
file.reference.voldemort-contrib-0.4a.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\voldemort-contrib-0.4a.jar
file.reference.xerces.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\xerces.jar
file.reference.zookeeper-3.1.0.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\zookeeper-3.1.0.jar
includes=**
jar.compress=false
java.platform.active=java_default_platform
javac.classpath=\
${file.reference.activation-1.1.jar}:\
${file.reference.akka-util-java.jar}:\
${file.reference.antlr-3.1.3.jar}:\
${file.reference.aopalliance-1.0.jar}:\
${file.reference.asm-3.1.jar}:\
${file.reference.asm-all-2.2.1.jar}:\
${file.reference.cassandra.jar}:\
${file.reference.catalina-ant.jar}:\
${file.reference.cglib-2.2.jar}:\
${file.reference.colt-1.2.0.jar}:\
${file.reference.commons-cli-1.1.jar}:\
${file.reference.commons-codec-1.3.jar}:\
${file.reference.commons-collections-3.2.1.jar}:\
${file.reference.commons-dbcp-1.2.2.jar}:\
${file.reference.commons-httpclient-3.1.jar}:\
${file.reference.commons-io-1.3.2.jar}:\
${file.reference.commons-javaflow-1.0-SNAPSHOT.jar}:\
${file.reference.commons-lang-2.4.jar}:\
${file.reference.commons-logging-1.0.4.jar}:\
${file.reference.commons-math-1.1.jar}:\
${file.reference.commons-pool-1.4.jar}:\
${file.reference.configgy-1.2.jar}:\
${file.reference.google-collect-snapshot-20090211.jar}:\
${file.reference.grizzly-framework-1.8.6.3.jar}:\
${file.reference.grizzly-http-1.8.6.3.jar}:\
${file.reference.grizzly-http-servlet-1.8.6.3.jar}:\
${file.reference.grizzly-http-utils-1.8.6.3.jar}:\
${file.reference.grizzly-portunif-1.8.6.3.jar}:\
${file.reference.grizzly-rcm-1.8.6.3.jar}:\
${file.reference.grizzly-servlet-webserver-1.8.6.3.jar}:\
${file.reference.guice-core-2.0-SNAPSHOT.jar}:\
${file.reference.guice-jsr250-2.0-SNAPSHOT.jar}:\
${file.reference.high-scale-lib.jar}:\
${file.reference.jaxb-api-2.1.jar}:\
${file.reference.jaxb-impl-2.1.jar}:\
${file.reference.jdom-1.0.jar}:\
${file.reference.je-3.3.62.jar}:\
${file.reference.jersey-atom-1.0.1.jar}:\
${file.reference.jersey-core-1.0.1.jar}:\
${file.reference.jersey-json-1.0.1.jar}:\
${file.reference.jersey-server-1.0.1.jar}:\
${file.reference.jettison-1.0.1.jar}:\
${file.reference.jetty-6.1.6rc0.jar}:\
${file.reference.jetty-util-6.1.6rc0.jar}:\
${file.reference.JSAP-2.1.jar}:\
${file.reference.jsr250-api-1.0.jar}:\
${file.reference.jsr311-api-1.0.jar}:\
${file.reference.junit-3.8.2.jar}:\
${file.reference.junit-4.5.jar}:\
${file.reference.junit4runner-1.0-SNAPSHOT.jar}:\
${file.reference.libfb303.jar}:\
${file.reference.libthrift-20080411p1.jar}:\
${file.reference.libthrift.jar}:\
${file.reference.log4j-1.2.15.jar}:\
${file.reference.lucene-core-2.2.0.jar}:\
${file.reference.mina-core-2.0.0-M2-SNAPSHOT.jar}:\
${file.reference.mina-integration-scala-2.0.0-M2-SNAPSHOT.jar}:\
${file.reference.pcj.jar}:\
${file.reference.protobuf-java-2.0.3.jar}:\
${file.reference.rome-0.9.jar}:\
${file.reference.scala-library-2.7.3.jar}:\
${file.reference.scala-library-2.7.3.zip}:\
${file.reference.scalatest-0.9.5.jar}:\
${file.reference.scalatest-0.9.5.zip}:\
${file.reference.servlet-api-2.5.jar}:\
${file.reference.slf4j-api-1.4.3.jar}:\
${file.reference.slf4j-log4j12-1.4.3.jar}:\
${file.reference.stax-api-1.0-2.jar}:\
${file.reference.stringtemplate-3.0.jar}:\
${file.reference.velocity-1.5.jar}:\
${file.reference.voldemort-0.4a.jar}:\
${file.reference.voldemort-contrib-0.4a.jar}:\
${file.reference.xerces.jar}:\
${file.reference.zookeeper-3.1.0.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.source=1.5
javac.target=1.5
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
${file.reference.scalatest-0.9.5.jar}:\
${file.reference.junit-4.5.jar}:\
${file.reference.junit4runner-1.0-SNAPSHOT.jar}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
platform.active=default_platform
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
# or test-sys-prop.name=value to set system properties for unit tests):
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}:\
${file.reference.scalatest-0.9.5.jar}:\
${file.reference.junit-4.5.jar}:\
${file.reference.junit4runner-1.0-SNAPSHOT.jar}
source.encoding=UTF-8
src.dir=${file.reference.main-scala}
test.src.dir=${file.reference.test-scala}
application.title=akka-kernel
application.vendor=jboner
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form,**/*.scala
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/akka-kernel.jar
dist.javadoc.dir=${dist.dir}/javadoc
excludes=
file.reference.activation-1.1.jar=/Users/jboner/src/scala/akka/lib/activation-1.1.jar
file.reference.akka-util-java.jar=/Users/jboner/src/scala/akka/lib/akka-util-java.jar
file.reference.antlr-3.1.3.jar=/Users/jboner/src/scala/akka/lib/antlr-3.1.3.jar
file.reference.aopalliance-1.0.jar=/Users/jboner/src/scala/akka/lib/aopalliance-1.0.jar
file.reference.asm-3.1.jar=/Users/jboner/src/scala/akka/lib/asm-3.1.jar
file.reference.asm-all-2.2.1.jar=/Users/jboner/src/scala/akka/lib/asm-all-2.2.1.jar
file.reference.cassandra.jar=/Users/jboner/src/scala/akka/lib/cassandra.jar
file.reference.catalina-ant.jar=/Users/jboner/src/scala/akka/lib/catalina-ant.jar
file.reference.cglib-2.2.jar=/Users/jboner/src/scala/akka/lib/cglib-2.2.jar
file.reference.colt-1.2.0.jar=/Users/jboner/src/scala/akka/lib/colt-1.2.0.jar
file.reference.commons-cli-1.1.jar=/Users/jboner/src/scala/akka/lib/commons-cli-1.1.jar
file.reference.commons-codec-1.3.jar=/Users/jboner/src/scala/akka/lib/commons-codec-1.3.jar
file.reference.commons-collections-3.2.1.jar=/Users/jboner/src/scala/akka/lib/commons-collections-3.2.1.jar
file.reference.commons-dbcp-1.2.2.jar=/Users/jboner/src/scala/akka/lib/commons-dbcp-1.2.2.jar
file.reference.commons-httpclient-3.1.jar=/Users/jboner/src/scala/akka/lib/commons-httpclient-3.1.jar
file.reference.commons-io-1.3.2.jar=/Users/jboner/src/scala/akka/lib/commons-io-1.3.2.jar
file.reference.commons-javaflow-1.0-SNAPSHOT.jar=/Users/jboner/src/scala/akka/lib/commons-javaflow-1.0-SNAPSHOT.jar
file.reference.commons-lang-2.4.jar=/Users/jboner/src/scala/akka/lib/commons-lang-2.4.jar
file.reference.commons-logging-1.0.4.jar=/Users/jboner/src/scala/akka/lib/commons-logging-1.0.4.jar
file.reference.commons-math-1.1.jar=/Users/jboner/src/scala/akka/lib/commons-math-1.1.jar
file.reference.commons-pool-1.4.jar=/Users/jboner/src/scala/akka/lib/commons-pool-1.4.jar
file.reference.configgy-1.2.jar=/Users/jboner/src/scala/akka/lib/configgy-1.2.jar
file.reference.google-collect-snapshot-20090211.jar=/Users/jboner/src/scala/akka/lib/google-collect-snapshot-20090211.jar
file.reference.grizzly-framework-1.8.6.3.jar=/Users/jboner/src/scala/akka/lib/grizzly-framework-1.8.6.3.jar
file.reference.grizzly-http-1.8.6.3.jar=/Users/jboner/src/scala/akka/lib/grizzly-http-1.8.6.3.jar
file.reference.grizzly-http-servlet-1.8.6.3.jar=/Users/jboner/src/scala/akka/lib/grizzly-http-servlet-1.8.6.3.jar
file.reference.grizzly-http-utils-1.8.6.3.jar=/Users/jboner/src/scala/akka/lib/grizzly-http-utils-1.8.6.3.jar
file.reference.grizzly-portunif-1.8.6.3.jar=/Users/jboner/src/scala/akka/lib/grizzly-portunif-1.8.6.3.jar
file.reference.grizzly-rcm-1.8.6.3.jar=/Users/jboner/src/scala/akka/lib/grizzly-rcm-1.8.6.3.jar
file.reference.grizzly-servlet-webserver-1.8.6.3.jar=/Users/jboner/src/scala/akka/lib/grizzly-servlet-webserver-1.8.6.3.jar
file.reference.guice-core-2.0-SNAPSHOT.jar=/Users/jboner/src/scala/akka/lib/guice-core-2.0-SNAPSHOT.jar
file.reference.guice-jsr250-2.0-SNAPSHOT.jar=/Users/jboner/src/scala/akka/lib/guice-jsr250-2.0-SNAPSHOT.jar
file.reference.high-scale-lib.jar=/Users/jboner/src/scala/akka/lib/high-scale-lib.jar
file.reference.jaxb-api-2.1.jar=/Users/jboner/src/scala/akka/lib/jaxb-api-2.1.jar
file.reference.jaxb-impl-2.1.jar=/Users/jboner/src/scala/akka/lib/jaxb-impl-2.1.jar
file.reference.jdom-1.0.jar=/Users/jboner/src/scala/akka/lib/jdom-1.0.jar
file.reference.je-3.3.62.jar=/Users/jboner/src/scala/akka/lib/je-3.3.62.jar
file.reference.jersey-atom-1.0.1.jar=/Users/jboner/src/scala/akka/lib/jersey-atom-1.0.1.jar
file.reference.jersey-core-1.0.1.jar=/Users/jboner/src/scala/akka/lib/jersey-core-1.0.1.jar
file.reference.jersey-json-1.0.1.jar=/Users/jboner/src/scala/akka/lib/jersey-json-1.0.1.jar
file.reference.jersey-server-1.0.1.jar=/Users/jboner/src/scala/akka/lib/jersey-server-1.0.1.jar
file.reference.jettison-1.0.1.jar=/Users/jboner/src/scala/akka/lib/jettison-1.0.1.jar
file.reference.jetty-6.1.6rc0.jar=/Users/jboner/src/scala/akka/lib/jetty-6.1.6rc0.jar
file.reference.jetty-util-6.1.6rc0.jar=/Users/jboner/src/scala/akka/lib/jetty-util-6.1.6rc0.jar
file.reference.JSAP-2.1.jar=/Users/jboner/src/scala/akka/lib/JSAP-2.1.jar
file.reference.jsr250-api-1.0.jar=/Users/jboner/src/scala/akka/lib/jsr250-api-1.0.jar
file.reference.jsr311-api-1.0.jar=/Users/jboner/src/scala/akka/lib/jsr311-api-1.0.jar
file.reference.junit-3.8.2.jar=/Users/jboner/src/scala/akka/lib/junit-3.8.2.jar
file.reference.junit-4.5.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\junit-4.5.jar
file.reference.junit-4.5.jar-1=/Users/jboner/src/scala/akka/lib/junit-4.5.jar
file.reference.junit4runner-1.0-SNAPSHOT.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\junit4runner-1.0-SNAPSHOT.jar
file.reference.junit4runner-1.0-SNAPSHOT.jar-1=/Users/jboner/src/scala/akka/lib/junit4runner-1.0-SNAPSHOT.jar
file.reference.libfb303.jar=/Users/jboner/src/scala/akka/lib/libfb303.jar
file.reference.libthrift-20080411p1.jar=/Users/jboner/src/scala/akka/lib/libthrift-20080411p1.jar
file.reference.libthrift.jar=/Users/jboner/src/scala/akka/lib/libthrift.jar
file.reference.log4j-1.2.15.jar=/Users/jboner/src/scala/akka/lib/log4j-1.2.15.jar
file.reference.lucene-core-2.2.0.jar=/Users/jboner/src/scala/akka/lib/lucene-core-2.2.0.jar
file.reference.main-scala=src/main/scala
file.reference.mina-core-2.0.0-M2-SNAPSHOT.jar=/Users/jboner/src/scala/akka/lib/mina-core-2.0.0-M2-SNAPSHOT.jar
file.reference.mina-integration-scala-2.0.0-M2-SNAPSHOT.jar=/Users/jboner/src/scala/akka/lib/mina-integration-scala-2.0.0-M2-SNAPSHOT.jar
file.reference.pcj.jar=/Users/jboner/src/scala/akka/lib/pcj.jar
file.reference.protobuf-java-2.0.3.jar=/Users/jboner/src/scala/akka/lib/protobuf-java-2.0.3.jar
file.reference.rome-0.9.jar=/Users/jboner/src/scala/akka/lib/rome-0.9.jar
file.reference.scala-library-2.7.3.jar=/Users/jboner/src/scala/akka/lib/scala-library-2.7.3.jar
file.reference.scala-library-2.7.3.zip=/Users/jboner/src/scala/akka/lib/scala-library-2.7.3.zip
file.reference.scalatest-0.9.5.jar=C:\\home\\jboner\\src\\scala\\akka\\lib\\scalatest-0.9.5.jar
file.reference.scalatest-0.9.5.jar-1=/Users/jboner/src/scala/akka/lib/scalatest-0.9.5.jar
file.reference.scalatest-0.9.5.zip=/Users/jboner/src/scala/akka/lib/scalatest-0.9.5.zip
file.reference.servlet-api-2.5.jar=/Users/jboner/src/scala/akka/lib/servlet-api-2.5.jar
file.reference.slf4j-api-1.4.3.jar=/Users/jboner/src/scala/akka/lib/slf4j-api-1.4.3.jar
file.reference.slf4j-log4j12-1.4.3.jar=/Users/jboner/src/scala/akka/lib/slf4j-log4j12-1.4.3.jar
file.reference.stax-api-1.0-2.jar=/Users/jboner/src/scala/akka/lib/stax-api-1.0-2.jar
file.reference.stringtemplate-3.0.jar=/Users/jboner/src/scala/akka/lib/stringtemplate-3.0.jar
file.reference.test-scala=src/test/scala
file.reference.velocity-1.5.jar=/Users/jboner/src/scala/akka/lib/velocity-1.5.jar
file.reference.voldemort-0.4a.jar=/Users/jboner/src/scala/akka/lib/voldemort-0.4a.jar
file.reference.voldemort-contrib-0.4a.jar=/Users/jboner/src/scala/akka/lib/voldemort-contrib-0.4a.jar
file.reference.xerces.jar=/Users/jboner/src/scala/akka/lib/xerces.jar
file.reference.zookeeper-3.1.0.jar=/Users/jboner/src/scala/akka/lib/zookeeper-3.1.0.jar
includes=**
jar.compress=false
java.platform.active=java_default_platform
javac.classpath=\
${file.reference.activation-1.1.jar}:\
${reference.akka-util-java.jar}:\
${file.reference.akka-util-java.jar}:\
${file.reference.antlr-3.1.3.jar}:\
${file.reference.aopalliance-1.0.jar}:\
${file.reference.asm-3.1.jar}:\
${file.reference.asm-all-2.2.1.jar}:\
${file.reference.cassandra.jar}:\
${file.reference.catalina-ant.jar}:\
${file.reference.cglib-2.2.jar}:\
${file.reference.colt-1.2.0.jar}:\
${file.reference.commons-cli-1.1.jar}:\
${file.reference.commons-codec-1.3.jar}:\
${file.reference.commons-collections-3.2.1.jar}:\
${file.reference.commons-dbcp-1.2.2.jar}:\
${file.reference.commons-httpclient-3.1.jar}:\
${file.reference.commons-io-1.3.2.jar}:\
${file.reference.commons-javaflow-1.0-SNAPSHOT.jar}:\
${file.reference.commons-lang-2.4.jar}:\
${file.reference.commons-logging-1.0.4.jar}:\
${file.reference.commons-math-1.1.jar}:\
${file.reference.commons-pool-1.4.jar}:\
${file.reference.configgy-1.2.jar}:\
${file.reference.google-collect-snapshot-20090211.jar}:\
${file.reference.grizzly-framework-1.8.6.3.jar}:\
${file.reference.grizzly-http-1.8.6.3.jar}:\
${file.reference.grizzly-http-servlet-1.8.6.3.jar}:\
${file.reference.grizzly-http-utils-1.8.6.3.jar}:\
${file.reference.grizzly-portunif-1.8.6.3.jar}:\
${file.reference.grizzly-rcm-1.8.6.3.jar}:\
${file.reference.grizzly-servlet-webserver-1.8.6.3.jar}:\
${file.reference.guice-core-2.0-SNAPSHOT.jar}:\
${file.reference.guice-jsr250-2.0-SNAPSHOT.jar}:\
${file.reference.high-scale-lib.jar}:\
${file.reference.jaxb-api-2.1.jar}:\
${file.reference.jaxb-impl-2.1.jar}:\
${file.reference.jdom-1.0.jar}:\
${file.reference.je-3.3.62.jar}:\
${file.reference.jersey-atom-1.0.1.jar}:\
${file.reference.jersey-core-1.0.1.jar}:\
${file.reference.jersey-json-1.0.1.jar}:\
${file.reference.jersey-server-1.0.1.jar}:\
${file.reference.jettison-1.0.1.jar}:\
${file.reference.jetty-6.1.6rc0.jar}:\
${file.reference.jetty-util-6.1.6rc0.jar}:\
${file.reference.JSAP-2.1.jar}:\
${file.reference.jsr250-api-1.0.jar}:\
${file.reference.jsr311-api-1.0.jar}:\
${file.reference.junit-3.8.2.jar}:\
${file.reference.junit-4.5.jar-1}:\
${file.reference.junit4runner-1.0-SNAPSHOT.jar-1}:\
${file.reference.libfb303.jar}:\
${file.reference.libthrift-20080411p1.jar}:\
${file.reference.libthrift.jar}:\
${file.reference.log4j-1.2.15.jar}:\
${file.reference.lucene-core-2.2.0.jar}:\
${file.reference.mina-core-2.0.0-M2-SNAPSHOT.jar}:\
${file.reference.mina-integration-scala-2.0.0-M2-SNAPSHOT.jar}:\
${file.reference.pcj.jar}:\
${file.reference.protobuf-java-2.0.3.jar}:\
${file.reference.rome-0.9.jar}:\
${file.reference.scala-library-2.7.3.jar}:\
${file.reference.scala-library-2.7.3.zip}:\
${file.reference.scalatest-0.9.5.jar-1}:\
${file.reference.scalatest-0.9.5.zip}:\
${file.reference.servlet-api-2.5.jar}:\
${file.reference.slf4j-api-1.4.3.jar}:\
${file.reference.slf4j-log4j12-1.4.3.jar}:\
${file.reference.stax-api-1.0-2.jar}:\
${file.reference.stringtemplate-3.0.jar}:\
${file.reference.velocity-1.5.jar}:\
${file.reference.voldemort-0.4a.jar}:\
${file.reference.voldemort-contrib-0.4a.jar}:\
${file.reference.xerces.jar}:\
${file.reference.zookeeper-3.1.0.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.source=1.5
javac.target=1.5
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
${file.reference.scalatest-0.9.5.jar}:\
${file.reference.junit-4.5.jar}:\
${file.reference.junit4runner-1.0-SNAPSHOT.jar}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
platform.active=default_platform
project.akka-util-java=../util-java
reference.akka-util-java.jar=${project.akka-util-java}/dist/akka-util-java.jar
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
# or test-sys-prop.name=value to set system properties for unit tests):
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}:\
${file.reference.scalatest-0.9.5.jar}:\
${file.reference.junit-4.5.jar}:\
${file.reference.junit4runner-1.0-SNAPSHOT.jar}
source.encoding=UTF-8
src.dir=${file.reference.main-scala}
test.src.dir=${file.reference.test-scala}

View file

@ -1,17 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.scala.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/scala-project/1">
<name>akka-kernel</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
<references xmlns="http://www.netbeans.org/ns/ant-project-references/1"/>
</configuration>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.scala.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/scala-project/1">
<name>akka-kernel</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
<references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
<reference>
<foreign-project>akka-util-java</foreign-project>
<artifact-type>jar</artifact-type>
<script>build.xml</script>
<target>jar</target>
<clean-target>clean</clean-target>
<id>jar</id>
</reference>
</references>
</configuration>
</project>

View file

@ -60,7 +60,27 @@
<artifactId>jersey-atom</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<dependency>
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
<version>3.1.0.BETA2</version>
</dependency>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>cassandra</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.facebook</groupId>
<artifactId>thrift</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.facebook</groupId>
<artifactId>fb303</artifactId>
<version>1.0</version>
</dependency>
<!--dependency>
<groupId>voldemort</groupId>
<artifactId>voldemort</artifactId>
<version>0.4a</version>
@ -69,14 +89,12 @@
<groupId>voldemort</groupId>
<artifactId>voldemort-contrib</artifactId>
<version>0.4a</version>
</dependency>
<!--
<dependency>
</dependency-->
<!--dependency>
<groupId>org.apache</groupId>
<artifactId>zookeeper</artifactId>
<version>3.1.0</version>
</dependency>
-->
</dependency-->
<dependency>
<groupId>com.assembla.scala.mina</groupId>
<artifactId>mina-core</artifactId>
@ -108,24 +126,18 @@
<version>0.9.5</version>
<scope>test</scope>
</dependency>
<dependency>
<!--dependency>
<groupId>com.jteigen.scalatest</groupId>
<artifactId>junit4runner</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalacheck</groupId>
<artifactId>scalacheck</artifactId>
<version>1.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
</dependency-->
</dependencies>
<build>
@ -177,7 +189,7 @@
</classpathContainers>
</configuration>
</plugin>
<plugin>
<!--plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
@ -186,7 +198,7 @@
</includes>
<junitArtifactName>junit:junit</junitArtifactName>
</configuration>
</plugin>
</plugin-->
</plugins>
<resources>
<resource>

View file

@ -14,7 +14,7 @@ import java.lang.annotation.Annotation
sealed class ActiveObjectException(msg: String) extends RuntimeException(msg)
class ActiveObjectInvocationTimeoutException(msg: String) extends ActiveObjectException(msg)
object Annotation {
object Annotations {
import se.scalablesolutions.akka.annotation._
val transactional = classOf[transactional]
val oneway = classOf[oneway]
@ -84,17 +84,17 @@ class ActiveObjectProxy(val intf: Class[_], val target: Class[_], val timeout: I
private var targetInstance: AnyRef = _
private[kernel] def setTargetInstance(instance: AnyRef) = {
targetInstance = instance
getStateList(targetInstance) match {
case Nil => {}
case states => server.states = states
}
val (maps, vectors, refs) = getTransactionalItemsFor(targetInstance)
server.transactionalMaps = maps
server.transactionalVectors = vectors
server.transactionalRefs = refs
}
private[kernel] val server = new GenericServerContainer(target.getName, () => new Dispatcher(target.getName))
server.setTimeout(timeout)
def invoke(proxy: AnyRef, m: Method, args: Array[AnyRef]): AnyRef = {
if (m.isAnnotationPresent(Annotation.transactional)) {
if (m.isAnnotationPresent(Annotations.transactional)) {
// FIXME: check if we are already in a transaction if so NEST (set parent)
val newTx = new Transaction
newTx.begin(server)
@ -122,7 +122,7 @@ class ActiveObjectProxy(val intf: Class[_], val target: Class[_], val timeout: I
private def invoke(invocation: Invocation): AnyRef = {
val result: AnyRef =
if (invocation.method.isAnnotationPresent(Annotation.oneway)) server ! invocation
if (invocation.method.isAnnotationPresent(Annotations.oneway)) server ! invocation
else {
val result: ErrRef[AnyRef] =
server !!! (invocation, {
@ -150,22 +150,29 @@ class ActiveObjectProxy(val intf: Class[_], val target: Class[_], val timeout: I
threadBoundTx.set(Some(tx))
}
private def getStateList(targetInstance: AnyRef): List[State[_,_]] = {
private def getTransactionalItemsFor(targetInstance: AnyRef):
Tuple3[List[TransactionalMap[_, _]], List[TransactionalVector[_]], List[TransactionalRef[_]]] = {
require(targetInstance != null)
import se.scalablesolutions.akka.kernel.configuration.ConfigurationException
val states: List[State[_,_]] = for {
field <- target.getDeclaredFields.toArray.toList
if field.isAnnotationPresent(Annotation.state)
state = {
var maps: List[TransactionalMap[_, _]] = Nil
var vectors: List[TransactionalVector[_]] = Nil
var refs: List[TransactionalRef[_]] = Nil
for {
field <- target.getDeclaredFields.toArray.toList.asInstanceOf[List[Field]]
fieldType = field.getType
if fieldType == classOf[TransactionalMap[_, _]] ||
fieldType == classOf[TransactionalVector[_]] ||
fieldType == classOf[TransactionalRef[_]]
txItem = {
field.setAccessible(true)
field.get(targetInstance)
}
if state != null
} yield {
if (!state.isInstanceOf[State[_, _]]) throw new ConfigurationException("Fields annotated with [@state] needs to to be a subtype of [se.scalablesolutions.akka.kernel.State[K, V]]")
state.asInstanceOf[State[_,_]]
if txItem != null
} {
if (txItem.isInstanceOf[TransactionalMap[_, _]]) maps ::= txItem.asInstanceOf[TransactionalMap[_, _]]
else if (txItem.isInstanceOf[TransactionalVector[_]]) vectors ::= txItem.asInstanceOf[TransactionalVector[_]]
else if (txItem.isInstanceOf[TransactionalRef[_]]) refs ::= txItem.asInstanceOf[TransactionalRef[_]]
}
states
(maps, vectors, refs)
}
}

View file

@ -6,6 +6,90 @@ package se.scalablesolutions.akka.kernel
import java.io.File
import org.apache.cassandra.config.DatabaseDescriptor
import org.apache.cassandra.service._
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
final object CassandraNode extends Logging {
val TABLE_NAME = "akka"
val ACTOR_KEY_PREFIX = "actor"
val ACTOR_MAP_COLUMN_FAMILY = "map"
// TODO: is this server thread-safe or needed to be wrapped up in an actor?
private[this] val server = new CassandraServer
def start = {
try {
server.start
log.info("Persistent storage has started up successfully");
} catch {
case e =>
log.error("Could not start up persistent storage")
throw e
}
}
def stop = server.shutdown
def insertActorStorageEntry(actorName: String, entry: String, content: String) = {
server.insert(
TABLE_NAME,
ACTOR_KEY_PREFIX + ":" + actorName,
ACTOR_MAP_COLUMN_FAMILY + ":" + entry,
content,
System.currentTimeMillis)
}
def insertActorStorageEntries(actorName: String, entries: List[Tuple2[String, String]]) = {
import java.util.{Map, HashMap, List, ArrayList}
val columns: Map[String, List[column_t]] = new HashMap
for (entry <- entries) {
val cls: List[column_t] = new ArrayList
cls.add(new column_t(entry._1, entry._2, System.currentTimeMillis))
columns.put(ACTOR_MAP_COLUMN_FAMILY, cls)
}
server.batch_insert_blocking(new batch_mutation_t(
TABLE_NAME,
ACTOR_KEY_PREFIX + ":" + actorName,
columns,
new HashMap[String, List[column_t]]))
}
def getActorStorageEntryFor(actorName: String, entry: String): Option[String] = {
try {
val column = server.get_column(TABLE_NAME, ACTOR_KEY_PREFIX + ":" + actorName, ACTOR_MAP_COLUMN_FAMILY + ":" + entry)
Some(column.value)
} catch { case e => None }
}
def getActorStorageFor(actorName: String): List[Tuple2[String, String]] = {
val columns = server.get_columns_since(TABLE_NAME, ACTOR_KEY_PREFIX, ACTOR_MAP_COLUMN_FAMILY, -1)
.toArray.toList.asInstanceOf[List[org.apache.cassandra.service.column_t]]
for {
column <- columns
col = (column.columnName, column.value)
} yield col
}
def getActorStorageSizeFor(actorName: String): Int =
server.get_column_count(TABLE_NAME, ACTOR_KEY_PREFIX + ":" + actorName, ACTOR_MAP_COLUMN_FAMILY)
def removeActorStorageFor(actorName: String) =
server.remove(TABLE_NAME, ACTOR_KEY_PREFIX + ":" + actorName, ACTOR_MAP_COLUMN_FAMILY)
def getActorStorageRange(actorName: String, start: Int, count: Int): List[Tuple2[String, String]] =
server.get_slice(TABLE_NAME, ACTOR_KEY_PREFIX + ":" + actorName, ACTOR_MAP_COLUMN_FAMILY, start, count)
.toArray.toList.asInstanceOf[List[Tuple2[String, String]]]
}
/*
* This code is only for starting up the Cassandra Thrift server, perhaps later
import scala.actors.Actor._
import com.facebook.thrift.protocol.TBinaryProtocol
import com.facebook.thrift.protocol.TProtocolFactory
import com.facebook.thrift.server.TThreadPoolServer
@ -14,24 +98,7 @@ import com.facebook.thrift.transport.TTransportException
import com.facebook.thrift.transport.TTransportFactory
import com.facebook.thrift.TProcessorFactory
import org.apache.cassandra.config.DatabaseDescriptor
import org.apache.cassandra.service._
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
final class CassandraNode extends Logging {
val server = try {
val cassandra = new CassandraServer
cassandra.start
cassandra
} catch {
case e =>
log.error("Could not start up persistent storage node")
throw e
}
private val serverEngine: TThreadPoolServer = try {
private[this] val serverEngine: TThreadPoolServer = try {
val pidFile = System.getProperty("pidfile")
if (pidFile != null) new File(pidFile).deleteOnExit();
val listenPort = DatabaseDescriptor.getThriftPort
@ -54,20 +121,17 @@ final class CassandraNode extends Logging {
log.error("Could not start up persistent storage node.")
throw e
}
def start = {
scala.actors.Actor.actor {
log.info("Persistent storage node starting up...");
serverEngine.serve
private[this] val serverDaemon = actor {
receive {
case Start =>
log.info("Persistent storage node starting up...")
serverEngine.serve
case Stop =>
log.info("Persistent storage node shutting down...")
serverEngine.stop
//case Insert(..) =>
// server.
}
log.info("Persistent storage node starting up 2222...");
server.insert("akka", "TestActor", "hash:data", "some data", System.currentTimeMillis)
val column = server.get_column("akka", "TestActor", "hash:data")
log.info("column: " + column)
}
*/
}
def stop = {
log.info("Persistent storage node shutting down...")
serverEngine.stop
}
}

View file

@ -51,8 +51,8 @@ abstract class Server extends Configuration
// def transform = se.scalablesolutions.akka.kernel.kernelConfig(restartStrategy.transform, servers.toArray.toList.asInstanceOf[List[Server]].map(_.transform))
//}
class Component(@BeanProperty val intf: Class[_],
@BeanProperty val target: Class[_],
@BeanProperty val lifeCycle: LifeCycle,
@BeanProperty val timeout: Int) extends Server {
@BeanProperty val target: Class[_],
@BeanProperty val lifeCycle: LifeCycle,
@BeanProperty val timeout: Int) extends Server {
def newWorker(proxy: ActiveObjectProxy) = se.scalablesolutions.akka.kernel.Worker(proxy.server, lifeCycle.transform)
}

View file

@ -12,8 +12,7 @@ import scala.actors.Actor._
import java.util.concurrent.atomic.AtomicReference
import java.util.concurrent.{ConcurrentLinkedQueue, LinkedBlockingQueue}
object DataFlow {
object DataFlow {
def thread(body: => Unit) = {
val thread = new IsolatedEventBasedThread(body).start
thread ! 'start

View file

@ -86,17 +86,48 @@ class GenericServerContainer(
private[kernel] var serverFactory: () => GenericServer) extends Logging {
require(id != null && id != "")
private[kernel] var lifeCycle: Option[LifeCycle] = None
private[kernel] val lock = new ReadWriteLock
private[kernel] val txItemsLock = new ReadWriteLock
private var server: GenericServer = _
private var currentConfig: Option[AnyRef] = None
private var timeout = 5000
// TODO: see if we can parameterize class and add type safe getActor method
//class GenericServerContainer[T <: GenericServer](var factory: () => T) {
//def getActor: T = server
private[kernel] var lifeCycle: Option[LifeCycle] = None
private[kernel] var states: List[State[_,_]] = Nil
private[kernel] val lock = new ReadWriteLock
private[kernel] def transactionalItems: List[Transactional] = txItemsLock.withReadLock {
_transactionalMaps ::: _transactionalVectors ::: _transactionalRefs
}
// TX Maps
private[this] var _transactionalMaps: List[TransactionalMap[_, _]] = Nil
private[kernel] def transactionalMaps_=(maps: List[TransactionalMap[_, _]]) = txItemsLock.withWriteLock {
_transactionalMaps = maps
}
private[kernel] def transactionalMaps: List[TransactionalMap[_, _]] = txItemsLock.withReadLock {
_transactionalMaps
}
private var server: GenericServer = _
private var currentConfig: Option[AnyRef] = None
private var timeout = 5000
// TX Vectors
private[this] var _transactionalVectors: List[TransactionalVector[_]] = Nil
private[kernel] def transactionalVectors_=(vectors: List[TransactionalVector[_]]) = txItemsLock.withWriteLock {
_transactionalVectors = vectors
}
private[kernel] def transactionalVectors: List[TransactionalVector[_]] = txItemsLock.withReadLock {
_transactionalVectors
}
// TX Refs
private[this] var _transactionalRefs: List[TransactionalRef[_]] = Nil
private[kernel] def transactionalRefs_=(refs: List[TransactionalRef[_]]) = txItemsLock.withWriteLock {
_transactionalRefs = refs
}
private[kernel] def transactionalRefs: List[TransactionalRef[_]] = txItemsLock.withReadLock {
_transactionalRefs
}
/**
* Sends a one way message to the server - alias for <code>cast(message)</code>.

View file

@ -47,7 +47,7 @@ object Helpers extends Logging {
// implicit conversion between regular actor and actor with a type future
implicit def actorWithFuture(a: Actor) = new ActorWithTypedFuture(a)
abstract class FutureWithTimeout[T](ch: InputChannel[Any]) extends Future[T](ch) {
abstract class FutureWithTimeout[T](ch: InputChannel[T]) extends Future[T](ch) {
def receiveWithin(timeout: Int) : Option[T]
override def respond(f: T => Unit): Unit = throw new UnsupportedOperationException("Does not support the Responder API")
}
@ -63,8 +63,8 @@ object Helpers extends Logging {
require(a != null)
def !!![A](msg: Any): FutureWithTimeout[A] = {
val ftch = new Channel[Any](Actor.self)
a.send(msg, ftch)
val ftch = new Channel[A](Actor.self)
a.send(msg, ftch.asInstanceOf[OutputChannel[Any]])
new FutureWithTimeout[A](ftch) {
def apply() =
if (isSet) value.get.asInstanceOf[A]

View file

@ -9,9 +9,9 @@ package se.scalablesolutions.akka.kernel
//import org.apache.zookeeper.server.ServerConfig
//import org.apache.zookeeper.server.NIOServerCnxn
import voldemort.client.{SocketStoreClientFactory, StoreClient, StoreClientFactory}
import voldemort.server.{VoldemortConfig, VoldemortServer}
import voldemort.versioning.Versioned
//import voldemort.client.{SocketStoreClientFactory, StoreClient, StoreClientFactory}
//import voldemort.server.{VoldemortConfig, VoldemortServer}
//import voldemort.versioning.Versioned
import com.sun.grizzly.http.SelectorThread
import com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory
@ -36,29 +36,29 @@ object Kernel extends Logging {
val JERSEY_REST_CLASSES_ROOT_PACKAGE = "se.scalablesolutions.akka.kernel"
val JERSEY_BASE_URI = UriBuilder.fromUri(JERSEY_SERVER_URL).port(getPort(JERSEY_SERVER_PORT)).build()
/*
val VOLDEMORT_SERVER_URL = "tcp://" + SERVER_URL
val VOLDEMORT_SERVER_PORT = 6666
val VOLDEMORT_BOOTSTRAP_URL = VOLDEMORT_SERVER_URL + ":" + VOLDEMORT_SERVER_PORT
val ZOO_KEEPER_SERVER_URL = SERVER_URL
val ZOO_KEEPER_SERVER_PORT = 9898
private[this] var cassandraNode: CassandraNode = _
//private[this] var storageFactory: StoreClientFactory = _
//private[this] var storageServer: VoldemortServer = _
private[this] var storageFactory: StoreClientFactory = _
private[this] var storageServer: VoldemortServer = _
*/
def main(args: Array[String]): Unit = {
log.info("Starting Akka kernel...")
//startZooKeeper
//startVoldemort
startCassandra
cassandraBenchmark
//val threadSelector = startJersey
// TODO: handle shutdown of Jersey in separate thread
// TODO: spawn main in new thread an communicate using socket
//System.in.read
//threadSelector.stopEndpoint
//startZooKeeper
//startVoldemort
}
private[akka] def startJersey: SelectorThread = {
@ -70,10 +70,51 @@ object Kernel extends Logging {
}
private[akka] def startCassandra = {
cassandraNode = new CassandraNode
cassandraNode.start
CassandraNode.start
}
private def cassandraBenchmark = {
val NR_ENTRIES = 1000000
println("=================================================")
var start = System.currentTimeMillis
for (i <- 1 to NR_ENTRIES) CassandraNode.insertActorStorageEntry("test", i.toString, "data")
var end = System.currentTimeMillis
println("Writes per second: " + NR_ENTRIES / ((end - start).toDouble / 1000))
/*
FIXME: batch_insert fails with the following exception:
ERROR - Exception was generated at : 04/27/2009 15:26:35 on thread main
[B cannot be cast to org.apache.cassandra.db.WriteResponse
java.lang.ClassCastException: [B cannot be cast to org.apache.cassandra.db.WriteResponse
at org.apache.cassandra.service.WriteResponseResolver.resolve(WriteResponseResolver.java:50)
at org.apache.cassandra.service.WriteResponseResolver.resolve(WriteResponseResolver.java:31)
at org.apache.cassandra.service.QuorumResponseHandler.get(QuorumResponseHandler.java:101)
at org.apache.cassandra.service.StorageProxy.insertBlocking(StorageProxy.java:135)
at org.apache.cassandra.service.CassandraServer.batch_insert_blocking(CassandraServer.java:489)
at se.scalablesolutions.akka.kernel.CassandraNode$.insertHashEntries(CassandraNode.scala:59)
at se.scalablesolutions.akka.kernel.Kernel$.cassandraBenchmark(Kernel.scala:91)
at se.scalablesolutions.akka.kernel.Kernel$.main(Kernel.scala:52)
at se.scalablesolutions.akka.kernel.Kernel.main(Kernel.scala)
println("=================================================")
var start = System.currentTimeMillis
println(start)
val entries = new scala.collection.mutable.ArrayBuffer[Tuple2[String, String]]
for (i <- 1 to NR_ENTRIES) entries += (i.toString, "data")
CassandraNode.insertHashEntries("test", entries.toList)
var end = System.currentTimeMillis
println("Writes per second - batch: " + NR_ENTRIES / ((end - start).toDouble / 1000))
*/
println("=================================================")
start = System.currentTimeMillis
for (i <- 1 to NR_ENTRIES) CassandraNode.getActorStorageEntryFor("test", i.toString)
end = System.currentTimeMillis
println("Reads per second: " + NR_ENTRIES / ((end - start).toDouble / 1000))
System.exit(0)
}
// private[akka] def startVoldemort = {
// // Start Voldemort server
// val config = VoldemortConfig.loadFromVoldemortHome(Boot.HOME)

View file

@ -1,107 +0,0 @@
package org.apache.mina.example.scala.netcat
import _root_.scala.actors.Actor
import _root_.scala.actors.Actor._
import _root_.scala.actors.Exit
import _root_.scala.collection.immutable
import java.net.InetSocketAddress
import java.nio.charset.Charset
import org.apache.mina.common._
import org.apache.mina.filter.codec.ProtocolCodecFilter
import org.apache.mina.filter.codec.textline.TextLineCodecFactory
import org.apache.mina.integration.scala.common._
import org.apache.mina.integration.scala.common.IoHandlerEvent._
import org.apache.mina.integration.scala.common.IoServiceEvent._
import org.apache.mina.integration.scala.common.IoSessionCall._
import org.apache.mina.integration.scala.common.IoSessionConfigOption._
import org.apache.mina.integration.scala.util._
import org.apache.mina.integration.scala.util.CallableActor._
import org.apache.mina.transport.socket.nio.NioSocketConnector
/**
* (<b>Entry point</b>) NetCat client. NetCat client connects to the specified
* endpoint and prints out received data. NetCat client disconnects
* automatically when no data is read for 10 seconds.
*
* @author The Apache MINA Project (dev@mina.apache.org)
* @version $Rev:$
*/
object NetCat {
def handleSession(session: Actor) = {
loop {
react {
case Opened => {
// Set reader idle time to 10 seconds.
// sessionIdle(...) method will be invoked when no data is read
// for 10 seconds.
val config = immutable.Map.empty[Any, Any] + Tuple2(IdleTime(IdleStatus.READER_IDLE), 10)
session.callReact(SetConfig(config)) {
case OK(_) => ()
case Error(cause) => exit(('setConfigFailed, cause))
}
}
case Closed => {
// Print out total number of bytes read from the remote peer.
session.callReact(GetReadBytes) {
case OK(readBytes) => {
System.err.println
System.err.println("Total " + readBytes + " byte(s)");
exit()
}
case Error(cause) => exit(('getReadBytesFailed, cause))
}
}
case Idle(status) => {
// Close the connection if reader is idle.
if (status == IdleStatus.READER_IDLE) {
session.callReact(CloseOnFlush) {
case OK(_) => exit()
case Error(cause) => exit(('idleCloseFailed, cause))
}
}
}
case MessageReceived(buf: IoBuffer) => {
// Print out read buffer content.
while (buf.hasRemaining) {
System.out.print(buf.get.asInstanceOf[char])
}
System.out.flush()
}
// Consume other IoHandlerEvents, or exit if something goes wrong.
case ExceptionCaught(cause) => exit(('exceptionCaught, cause))
case _: IoHandlerEvent => () // Consume
case unexpected => exit(('unexpectedMessage, unexpected))
}
}
}
def main(args: Array[String]) {
var host = System.getProperty("netcat.host")
var portString = System.getProperty("netcat.port")
if ((host eq null) || (portString eq null)) {
// Read from command line
if (args.length != 2) {
System.out.println(this.getClass().getName() + " <hostname> <port>")
return
}
host = args(0)
portString = args(1)
}
val port = Integer.parseInt(portString)
// Create TCP/IP connector.
val connector = new NioSocketConnector()
connector.setConnectTimeout(30)
// Hook up our code, and start service.
val handlingReference = IoSessionActor.installHandling(connector, handleSession(_))
val cf = connector.connect(new InetSocketAddress(host, port))
cf.awaitUninterruptibly()
cf.getSession().getCloseFuture().awaitUninterruptibly()
handlingReference.removeHandling
connector.dispose()
}
}

View file

@ -13,7 +13,12 @@ trait Transactional {
private[kernel] def rollback
}
sealed trait State[K, V] extends Transactional {
/**
* Base trait for all state implementations (persistent or in-memory).
*
* TODO: Make this class inherit scala.collection.mutable.Map and/or java.util.Map
*/
trait TransactionalMap[K, V] extends Transactional {
def put(key: K, value: V)
def remove(key: K)
def get(key: K): V
@ -24,87 +29,134 @@ sealed trait State[K, V] extends Transactional {
}
/**
* Base class for all persistent state implementations should extend.
* Implements a Unit of Work, records changes into a change set.
*
* Not thread-safe, but should only be using from within an Actor, e.g. one single thread at a time.
*/
sealed class InMemoryState[K, V] extends State[K, V] {
private[kernel] var state = new HashTrie[K, V]
private[kernel] var snapshot = state
abstract class PersistentTransactionalMap[K, V] extends TransactionalMap[K, V] {
protected[kernel] val changeSet = new HashMap[K, V]
private[kernel] override def begin = {
snapshot = state
}
private[kernel] override def commit = {
snapshot = state
}
private[kernel] override def rollback = {
state = snapshot
}
override def put(key: K, value: V) = {
state = state.update(key, value)
}
override def remove(key: K) = {
state = state - key
}
def get(key: K): V = state.get(key).getOrElse { throw new NoSuchElementException("No value for key [" + key + "]") }
def contains(key: K): Boolean = state.contains(key)
def elements: Iterator[(K, V)] = state.elements
def size: Int = state.size
def clear = state = new HashTrie[K, V]
}
//final class InMemoryStringState extends InMemoryState[String, String]
//final class InMemoryObjectState extends InMemoryState[String, AnyRef]
//
/**
* Not thread-safe, but should only be using from within an Actor, e.g. one single thread at a time.
*/
trait UnitOfWork[K, V] extends State[K, V] with Transactional {
this: InMemoryState[K, V] =>
private[kernel] val changeSet = new HashMap[K, V]
abstract override def begin = {
super.begin
override def begin = {
changeSet.clear
}
abstract override def put(key: K, value: V) = {
super.put(key, value)
override def put(key: K, value: V) = {
changeSet += key -> value
}
abstract override def remove(key: K) = {
super.remove(key)
override def remove(key: K) = {
changeSet -= key
}
def getRange(start: Int, count: Int)
}
/**
* Not thread-safe, but should only be using from within an Actor, e.g. one single thread at a time.
*/
class InMemoryTransactionalMap[K, V] extends TransactionalMap[K, V] {
protected[kernel] var state = new HashTrie[K, V]
protected[kernel] var snapshot = state
override def begin = snapshot = state
override def commit = snapshot = state
override def rollback = state = snapshot
override def put(key: K, value: V) = state = state.update(key, value)
override def get(key: K): V = state.get(key).getOrElse(throw new NoSuchElementException("No value for key [" + key + "]"))
override def remove(key: K) = state = state - key
override def contains(key: K): Boolean = state.contains(key)
override def elements: Iterator[(K, V)] = state.elements
override def size: Int = state.size
override def clear = state = new HashTrie[K, V]
}
/**
* Implements a persistent state based on the Cassandra distributed P2P key-value storage.
*/
class CassandraPersistentTransactionalMap(val actorName: String) extends PersistentTransactionalMap[String, String] {
override def begin = {}
override def rollback = {}
override def commit = {
// FIXME: should use batch function once the bug is resolved
for (entry <- changeSet) {
val (key, value) = entry
CassandraNode.insertActorStorageEntry(actorName, key, value)
}
}
override def get(key: String): String = CassandraNode.getActorStorageEntryFor(actorName, key)
.getOrElse(throw new NoSuchElementException("Could not find element for key [" + key + "]"))
override def contains(key: String): Boolean = CassandraNode.getActorStorageEntryFor(actorName, key).isDefined
override def size: Int = CassandraNode.getActorStorageSizeFor(actorName)
override def clear = CassandraNode.removeActorStorageFor(actorName)
override def getRange(start: Int, count: Int) = CassandraNode.getActorStorageRange(actorName, start, count)
override def elements: Iterator[Tuple2[String, String]] = {
new Iterator[Tuple2[String, String]] {
private val originalList: List[Tuple2[String, String]] = CassandraNode.getActorStorageFor(actorName)
private var elements = originalList.reverse
override def next: Tuple2[String, String]= synchronized {
val element = elements.head
elements = elements.tail
element
}
override def hasNext: Boolean = synchronized { !elements.isEmpty }
}
}
}
//class VectorState[T] {
// private[kernel] var state: Vector[T] = EmptyVector
// private[kernel] var snapshot = state
// private[kernel] var unitOfWork: List[T] = Nil
//
// private[kernel] def record = {
// snapshot = state
// unitOfWork = Nil
// }
//
// def add(elem: T): VectorState[T] = {
// state = state + elem
// unitOfWork ::= elem
// }
//
// def get(index: Int): T = state(index)
//
// def size: Int = state.size
//}
//
//
/**
* TODO: extend scala.Seq
* Base for all transactional vector implementations.
*/
abstract class TransactionalVector[T] extends Transactional {
def add(elem: T)
def get(index: Int): T
def size: Int
}
/**
* Implements an in-memory transactional vector.
*
* Not thread-safe, but should only be using from within an Actor, e.g. one single thread at a time.
*/
class InMemoryTransactionalVector[T] extends TransactionalVector[T] {
private[kernel] var state: Vector[T] = EmptyVector
private[kernel] var snapshot = state
override def begin = snapshot = state
override def commit = snapshot = state
override def rollback = state = snapshot
override def add(elem: T) = state = state + elem
override def get(index: Int): T = state(index)
override def size: Int = state.size
}
/**
* Implements a transactional reference.
*
* Not thread-safe, but should only be using from within an Actor, e.g. one single thread at a time.
*/
class TransactionalRef[T] extends Transactional {
private[kernel] var ref: Option[T] = None
private[kernel] var snapshot: Option[T] = None
override def begin = if (ref.isDefined) snapshot = Some(ref.get)
override def commit = if (ref.isDefined) snapshot = Some(ref.get)
override def rollback = if (snapshot.isDefined) ref = Some(snapshot.get)
def swap(elem: T) = ref = Some(elem)
def get: Option[T] = ref
def getOrElse(default: => T): T = ref.getOrElse(default)
def isDefined: Boolean= ref.isDefined
}

View file

@ -47,7 +47,7 @@ class Transaction extends Logging {
if (status == TransactionStatus.New) log.debug("Actor [%s] is starting NEW transaction", server)
else log.debug("Actor [%s] is participating in transaction", server)
println("===== begin 2 " + server)
server.states.foreach(_.begin)
server.transactionalItems.foreach(_.begin)
participants ::= server
status = TransactionStatus.Active
}
@ -80,13 +80,13 @@ class Transaction extends Logging {
ensureIsActiveOrAborted
println("===== rollback " + server)
log.debug("Actor [%s] has initiated transaction rollback, rolling back [%s]" , server, participants)
participants.foreach(_.states.foreach(_.rollback))
participants.foreach(_.transactionalItems.foreach(_.rollback))
status = TransactionStatus.Aborted
}
def join(server: GenericServerContainer) = synchronized {
println("===== joining " + server)
server.states.foreach(_.begin)
server.transactionalItems.foreach(_.begin)
participants ::= server
}

View file

@ -7,11 +7,14 @@ package se.scalablesolutions.akka.kernel
import scala.actors._
import scala.actors.Actor._
import com.jteigen.scalatest.JUnit4Runner
import org.junit.runner.RunWith
import org.scalatest._
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
@RunWith(classOf[JUnit4Runner])
class GenericServerContainerSpec extends Suite {
var inner: GenericServerContainerActor = null

View file

@ -4,6 +4,8 @@
package se.scalablesolutions.akka.kernel
import com.jteigen.scalatest.JUnit4Runner
import org.junit.runner.RunWith
import org.scalatest._
import scala.actors.Actor._
@ -11,6 +13,7 @@ import scala.actors.Actor._
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
@RunWith(classOf[JUnit4Runner])
class GenericServerSpec extends Suite {
def testSendRegularMessage = {

View file

@ -9,11 +9,14 @@ import scala.actors.Actor._
import scala.collection.Map
import scala.collection.mutable.HashMap
import com.jteigen.scalatest.JUnit4Runner
import org.junit.runner.RunWith
import org.scalatest._
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
@RunWith(classOf[JUnit4Runner])
class SupervisorSpec extends Suite {
var messageLog: String = ""

View file

@ -4,6 +4,8 @@
package se.scalablesolutions.akka.kernel
import com.jteigen.scalatest.JUnit4Runner
import org.junit.runner.RunWith
import org.scalatest._
import scala.actors.Actor._
@ -11,6 +13,7 @@ import scala.actors.Actor._
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
@RunWith(classOf[JUnit4Runner])
class SupervisorStateSpec extends Suite {
val dummyActor = new GenericServer { override def body: PartialFunction[Any, Unit] = { case _ => }}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -51,8 +51,17 @@
</repository>
<repository>
<id>java.net</id>
<name>Java.net Legacy Repository for Maven</name>
<url>http://download.java.net/maven/1</url>
<layout>legacy</layout>
</repository>
<repository>
<id>repository.jboss.org</id>
<name>JBoss Repository for Maven</name>
<url>http://repository.jboss.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

View file

View file

View file

View file

View file

View file

@ -1,214 +0,0 @@
--- OVERVIEW ---
Scala Actors Behavior Module
Implements Erlang-style Behaviors for Scala; Supervisor, GenericServer, GenericEvent and GenericFiniteStateMachine allowing creating fault-tolerant actor-based enterprise systems.
The implementation consists of four main abstractions;
* Supervisor -- The Supervisor manages hierarchies of Scala actors and provides fault-tolerance in terms of different restart
semantics. The configuration and semantics is almost a 1-1 port of the Erlang Supervisor implementation, explained
here: http://www.erlang.org/doc/design_principles/sup_princ.html, read this document in order to understand how to
configure the Supervisor properly.
* GenericServer -- The GenericServer (which subclasses Actor) is a trait that forms the base for a server to be managed by a Supervisor.
The GenericServer is wrapped by a GenericServerContainer instance providing a necessary indirection needed to be able to
fully manage the life-cycle of the GenericServer.
* GenericEvent -- TBD
* GenericFiniteStateMachine -- TBD
--- CHECK OUT ---
The SCM system used is Git.
1. Download and install Git (google git).
2. Invoke 'git clone git://github.com/jboner/scala-otp.git'.
--- BUILD ---
The build system used is Maven.
1. Download and install Maven 2.
2. Step into the root dir 'scala-otp'.
3. Invoke 'mvn install'
This will build the project, run all tests, create a jar and upload it to your local Maven repository ready for use.
--- RUNTIME DEPENDENCIES ---
1. Scala 2.7.1-final
2. SLF4J 1.5.2
3. LogBack Classic 0.9.9
--- USAGE ---
Here is a small step-by-step runnable tutorial on how to create a server, configure it, use it, hotswap its
implementation etc. For more details on the API, look at the code or the tests.
You can find this code in the sample.scala file in the root directory. Run it by invoking 'scala -cp
target/scala-behavior-0.1-SNAPSHOT.jar:<path to slf4j and logback jars> sample.scala'
// =============================================
// 1. Import statements and Server messages
import scala.actors._
import scala.actors.Actor._
import scala.actors.behavior._
import scala.actors.behavior.Helpers._
sealed abstract class SampleMessage
case object Ping extends SampleMessage
case object Pong extends SampleMessage
case object OneWay extends SampleMessage
case object Die extends SampleMessage
// =============================================
// 2. Create the GenericServer by extending the GenericServer trait and override the 'body' method
class SampleServer extends GenericServer {
// This method implements the core server logic and naturally has to be overridden
override def body: PartialFunction[Any, Unit] = {
case Ping =>
println("Received Ping"); reply(Pong)
case OneWay =>
println("Received OneWay")
case Die =>
println("Received Die..dying...")
throw new RuntimeException("Received Die message")
}
// GenericServer also has some callback life-cycle methods, such as init(..) and shutdown(..)
}
// =============================================
// 3. Wrap our SampleServer in a GenericServerContainer and give it a name to be able to refer to it later.
object sampleServer1 extends GenericServerContainer("sample1", () => new SampleServer)
object sampleServer2 extends GenericServerContainer("sample2", () => new SampleServer)
// =============================================
// 4. Create a Supervisor configuration (and a SupervisorFactory) that is configuring our SampleServer (takes a list of
'Worker' configurations, one or many)
object factory extends SupervisorFactory {
override protected def getSupervisorConfig: SupervisorConfig = {
SupervisorConfig(
RestartStrategy(AllForOne, 3, 10000),
Worker(
sampleServer1,
LifeCycle(Permanent, 1000)) ::
Worker(
sampleServer2,
LifeCycle(Permanent, 1000)) ::
Nil)
}
}
// =============================================
// 5. Create a new Supervisor with the custom factory
val supervisor = factory.newSupervisor
// =============================================
// 6. Start the Supervisor (which starts the server(s))
supervisor ! Start
// =============================================
// 7. Try to send a one way asyncronous message to our servers
sampleServer1 ! OneWay
// Try to get sampleServer2 from the Supervisor before sending a message
supervisor.getServer("sample2") match {
case Some(server2) => server2 ! OneWay
case None => println("server [sample2] could not be found")
}
// =============================================
// 8. Try to send an asyncronous message - receive a future - wait 100 ms (time-out) for the reply
val future = sampleServer1 !! Ping
val reply1 = future.receiveWithin(100) match {
case Some(reply) =>
println("Received reply: " + reply)
case None =>
println("Did not get a reply witin 100 ms")
}
// =============================================
// 9. Try to send a message (Die) telling the server to kill itself (throw an exception)
sampleServer1 ! Die
// =============================================
// 10. Send an asyncronous message and wait on a future. If it times out -> use error handler (in this case throw an
exception). It is likely that this call will time out since the server is in the middle of recovering from failure.
val reply2 = try {
sampleServer1 !!! (Ping, throw new RuntimeException("Time-out"), 10) // time out is set to 10 ms (very low on purpose)
} catch { case e => println("Expected exception: " + e.toString); Pong }
// =============================================
// 11. Server should be up again. Try the same call again
val reply3 = try {
sampleServer1 !!! (Ping, throw new RuntimeException("Time-out"), 1000)
} catch { case e => println("Expected exception: " + e.toString); Pong }
// Also check server number 2
sampleServer2 ! Ping
// =============================================
// 11. Try to hotswap the server implementation
sampleServer1.hotswap(Some({
case Ping =>
println("Hotswapped Ping")
}))
// =============================================
// 12. Try the hotswapped server out
sampleServer1 ! Ping
// =============================================
// 13. Hotswap again
sampleServer1.hotswap(Some({
case Pong =>
println("Hotswapped again, now doing Pong")
reply(Ping)
}))
// =============================================
// 14. Send an asyncronous message that will wait on a future. Method returns an Option[T] => if Some(result) -> return
result, if None -> print out an info message (or throw an exception or do whatever you like...)
val reply4 = (sampleServer1 !!! Pong).getOrElse({println("Time out when sending Pong"); Ping})
// Same invocation with pattern matching syntax.
val reply5 = sampleServer1 !!! Pong match {
case Some(result) => result
case None => println("Time out when sending Pong"); Ping
}
// =============================================
// 15. Hotswap back to original implementation by passing in None
sampleServer1.hotswap(None)
// =============================================
// 16. Test the final hotswap by sending an async message
sampleServer1 ! Ping
// =============================================
// 17. Shut down the supervisor and its server(s)
supervisor ! Stop

View file

@ -1,164 +0,0 @@
// =============================================
// 1. Import statements and Server messages
import scala.actors._
import scala.actors.Actor._
import scala.actors.behavior._
import scala.actors.behavior.Helpers._
sealed abstract class SampleMessage
case object Ping extends SampleMessage
case object Pong extends SampleMessage
case object OneWay extends SampleMessage
case object Die extends SampleMessage
// =============================================
// 2. Create the GenericServer by extending the GenericServer trait and override the 'body' method
class SampleServer extends GenericServer {
// This method implements the core server logic and naturally has to be overridden
override def body: PartialFunction[Any, Unit] = {
case Ping =>
println("Received Ping"); reply(Pong)
case OneWay =>
println("Received OneWay")
case Die =>
println("Received Die..dying...")
throw new RuntimeException("Received Die message")
}
// GenericServer also has some callback life-cycle methods, such as init(..) and shutdown(..)
}
// =============================================
// 3. Wrap our SampleServer in a GenericServerContainer and give it a name to be able to refer to it later.
object sampleServer1 extends GenericServerContainer("sample1", () => new SampleServer)
object sampleServer2 extends GenericServerContainer("sample2", () => new SampleServer)
// =============================================
// 4. Create a Supervisor configuration (and a SupervisorFactory) that is configuring our SampleServer (takes a list of 'Worker' configurations, one or many)
object factory extends SupervisorFactory {
override protected def getSupervisorConfig: SupervisorConfig = {
SupervisorConfig(
RestartStrategy(AllForOne, 3, 10000),
Worker(
sampleServer1,
LifeCycle(Permanent, 1000)) ::
Worker(
sampleServer2,
LifeCycle(Permanent, 1000)) ::
Nil)
}
}
// =============================================
// 5. Create a new Supervisor with the custom factory
val supervisor = factory.newSupervisor
// =============================================
// 6. Start the Supervisor (which starts the server(s))
supervisor ! Start
// =============================================
// 7. Try to send a one way asyncronous message to our servers
sampleServer1 ! OneWay
// Try to get sampleServer2 from the Supervisor before sending a message
supervisor.getServer("sample2") match {
case Some(server2) => server2 ! OneWay
case None => println("server [sample2] could not be found")
}
// =============================================
// 8. Try to send an asyncronous message - receive a future - wait 100 ms (time-out) for the reply
val future = sampleServer1 !! Ping
val reply1 = future.receiveWithin(100) match {
case Some(reply) =>
println("Received reply: " + reply)
case None =>
println("Did not get a reply witin 100 ms")
}
// =============================================
// 9. Try to send a message (Die) telling the server to kill itself (throw an exception)
sampleServer1 ! Die
// =============================================
// 10. Send an asyncronous message and wait on a future. If it times out -> use error handler (in this case throw an exception). It is likely that this call will time out since the server is in the middle of recovering from failure.
val reply2 = try {
sampleServer1 !!! (Ping, throw new RuntimeException("Time-out"), 10) // time out is set to 10 ms (very low on purpose)
} catch { case e => println("Expected exception: " + e.toString); Pong }
// =============================================
// 11. Server should be up again. Try the same call again
val reply3 = try {
sampleServer1 !!! (Ping, throw new RuntimeException("Time-out"), 1000)
} catch { case e => println("Expected exception: " + e.toString); Pong }
// Also check server number 2
sampleServer2 ! Ping
// =============================================
// 11. Try to hotswap the server implementation
sampleServer1.hotswap(Some({
case Ping =>
println("Hotswapped Ping")
}))
// =============================================
// 12. Try the hotswapped server out
sampleServer1 ! Ping
// =============================================
// 13. Hotswap again
sampleServer1.hotswap(Some({
case Pong =>
println("Hotswapped again, now doing Pong")
reply(Ping)
}))
// =============================================
// 14. Send an asyncronous message that will wait on a future. Method returns an Option[T] => if Some(result) -> return result, if None -> print out an info message (or throw an exception or do whatever you like...)
val reply4 = (sampleServer1 !!! Pong).getOrElse({println("Time out when sending Pong"); Ping})
// Same invocation with pattern matching syntax.
val reply5 = sampleServer1 !!! Pong match {
case Some(result) => result
case None => println("Time out when sending Pong"); Ping
}
// =============================================
// 15. Hotswap back to original implementation by passing in None
sampleServer1.hotswap(None)
// =============================================
// 16. Test the final hotswap by sending an async message
sampleServer1 ! Ping
// =============================================
// 17. Shut down the supervisor and its server(s)
supervisor ! Stop

View file

@ -1,282 +0,0 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package com.scalablesolutions.akka.supervisor
import scala.actors._
import scala.actors.Actor._
import com.scalablesolutions.akka.supervisor.Helpers._
sealed abstract class GenericServerMessage
case class Init(config: AnyRef) extends GenericServerMessage
case class ReInit(config: AnyRef) extends GenericServerMessage
case class Shutdown(reason: AnyRef) extends GenericServerMessage
case class Terminate(reason: AnyRef) extends GenericServerMessage
case class HotSwap(code: Option[PartialFunction[Any, Unit]]) extends GenericServerMessage
/**
* Base trait for all user-defined servers/actors.
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
trait GenericServer extends Actor {
/**
* Template method implementing the server logic.
* To be implemented by subclassing server.
* <p/>
* Example code:
* <pre>
* override def body: PartialFunction[Any, Unit] = {
* case Ping =>
* println("got a ping")
* reply("pong")
*
* case OneWay =>
* println("got a oneway")
* }
* </pre>
*/
def body: PartialFunction[Any, Unit]
/**
* Callback method that is called during initialization.
* To be implemented by subclassing server.
*/
def init(config: AnyRef) {}
/**
* Callback method that is called during reinitialization after a server crash.
* To be implemented by subclassing server.
*/
def reinit(config: AnyRef) {}
/**
* Callback method that is called during termination.
* To be implemented by subclassing server.
*/
def shutdown(reason: AnyRef) {}
def act = loop { react { genericBase orElse actorBase } }
private def actorBase: PartialFunction[Any, Unit] = hotswap getOrElse body
private var hotswap: Option[PartialFunction[Any, Unit]] = None
private val genericBase: PartialFunction[Any, Unit] = {
case Init(config) => init(config)
case ReInit(config) => reinit(config)
case HotSwap(code) => hotswap = code
case Shutdown(reason) => shutdown(reason); reply('success)
case Terminate(reason) => exit(reason)
}
}
/**
* The container (proxy) for GenericServer, responsible for managing the life-cycle of the server;
* such as shutdown, restart, re-initialization etc.
* Each GenericServerContainer manages one GenericServer.
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
class GenericServerContainer(val id: String, var serverFactory: () => GenericServer) extends Logging {
require(id != null && id != "")
// TODO: see if we can parameterize class and add type safe getActor method
//class GenericServerContainer[T <: GenericServer](var factory: () => T) {
//def getActor: T = server
var lifeCycle: Option[LifeCycle] = None
val lock = new ReadWriteLock
private var server: GenericServer = null
private var currentConfig: Option[AnyRef] = None
private var timeout = 5000
/**
* Sends a one way message to the server - alias for <code>cast(message)</code>.
* <p>
* Example:
* <pre>
* server ! Message
* </pre>
*/
def !(message: Any) = {
require(server != null)
lock.withReadLock { server ! message }
}
/**
* Sends a message to the server returns a FutureWithTimeout holding the future reply .
* <p>
* Example:
* <pre>
* val future = server !! Message
* future.receiveWithin(100) match {
* case None => ... // timed out
* case Some(reply) => ... // handle reply
* }
* </pre>
*/
def !![T](message: Any): FutureWithTimeout[T] = {
require(server != null)
lock.withReadLock { server !!! message }
}
/**
* Sends a message to the server and blocks indefinitely (no time out), waiting for the reply.
* <p>
* Example:
* <pre>
* val result: String = server !? Message
* </pre>
*/
def !?[T](message: Any): T = {
require(server != null)
val future: Future[T] = lock.withReadLock { server.!![T](message, {case t => t.asInstanceOf[T]}) }
Actor.receive {
case (future.ch ! arg) => arg.asInstanceOf[T]
}
}
/**
* Sends a message to the server and gets a future back with the reply. Returns
* an Option with either Some(result) if succesful or None if timeout.
* <p>
* Timeout specified by the <code>setTimeout(time: Int)</code> method.
* <p>
* Example:
* <pre>
* (server !!! Message).getOrElse(throw new RuntimeException("time out")
* </pre>
*/
def !!![T](message: Any): Option[T] = {
require(server != null)
val future: FutureWithTimeout[T] = lock.withReadLock { server !!! message }
future.receiveWithin(timeout)
}
/**
* Sends a message to the server and gets a future back with the reply.
* <p>
* Tries to get the reply within the timeout specified in the GenericServerContainer
* and else execute the error handler (which can return a default value, throw an exception
* or whatever is appropriate).
* <p>
* Example:
* <pre>
* server !!! (Message, throw new RuntimeException("time out"))
* // OR
* server !!! (Message, DefaultReturnValue)
* </pre>
*/
def !!![T](message: Any, errorHandler: => T): T = !!!(message, errorHandler, timeout)
/**
* Sends a message to the server and gets a future back with the reply.
* <p>
* Tries to get the reply within the timeout specified as parameter to the method
* and else execute the error handler (which can return a default value, throw an exception
* or whatever is appropriate).
* <p>
* Example:
* <pre>
* server !!! (Message, throw new RuntimeException("time out"), 1000)
* // OR
* server !!! (Message, DefaultReturnValue, 1000)
* </pre>
*/
def !!![T](message: Any, errorHandler: => T, time: Int): T = {
require(server != null)
val future: FutureWithTimeout[T] = lock.withReadLock { server !!! message }
future.receiveWithin(time) match {
case None => errorHandler
case Some(reply) => reply
}
}
/**
* Initializes the server by sending a Init(config) message.
*/
def init(config: AnyRef) = lock.withWriteLock {
currentConfig = Some(config)
server ! Init(config)
}
/**
* Re-initializes the server by sending a ReInit(config) message with the most recent configuration.
*/
def reinit = lock.withWriteLock {
currentConfig match {
case Some(config) => server ! ReInit(config)
case None => {}
}
}
/**
* Hotswaps the server body by sending it a HotSwap(code) with the new code
* block (PartialFunction) to be executed.
*/
def hotswap(code: Option[PartialFunction[Any, Unit]]) = lock.withReadLock { server ! HotSwap(code) }
/**
* Swaps the server factory, enabling creating of a completely new server implementation
* (upon failure and restart).
*/
def swapFactory(newFactory: () => GenericServer) = serverFactory = newFactory
/**
* Sets the timeout for the call(..) method, e.g. the maximum time to wait for a reply
* before bailing out. Sets the timeout on the future return from the call to the server.
*/
def setTimeout(time: Int) = timeout = time
/**
* Returns the next message in the servers mailbox.
*/
def nextMessage = lock.withReadLock { server ? }
/**
* Creates a new actor for the GenericServerContainer, and return the newly created actor.
*/
private[supervisor] def newServer(): GenericServer = lock.withWriteLock {
server = serverFactory()
server
}
/**
* Starts the server.
*/
private[supervisor] def start = lock.withReadLock { server.start }
/**
* Terminates the server with a reason by sending a Terminate(Some(reason)) message.
*/
private[supervisor] def terminate(reason: AnyRef) = lock.withReadLock { server ! Terminate(reason) }
/**
* Terminates the server with a reason by sending a Terminate(Some(reason)) message,
* the shutdownTime defines the maximal time to wait for the server to shutdown before
* killing it.
*/
private[supervisor] def terminate(reason: AnyRef, shutdownTime: Int) = lock.withReadLock {
if (shutdownTime > 0) {
log.debug("Waiting {} milliseconds for the server to shut down before killing it.", shutdownTime)
server !? (shutdownTime, Shutdown(reason)) match {
case Some('success) => log.debug("Server [{}] has been shut down cleanly.", id)
case None => log.warning("Server [{}] was **not able** to complete shutdown cleanly within its configured shutdown time [{}]", id, shutdownTime)
}
}
server ! Terminate(reason)
}
private[supervisor] def reconfigure(reason: AnyRef, restartedServer: GenericServer, supervisor: Supervisor) = lock.withWriteLock {
server = restartedServer
reinit
}
private[supervisor] def getServer: GenericServer = server
}

View file

@ -1,101 +0,0 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package com.scalablesolutions.akka.supervisor
import java.util.concurrent.locks.ReentrantReadWriteLock
import scala.actors._
import scala.actors.Actor._
import net.lag.logging.Logger
class SystemFailure(cause: Throwable) extends RuntimeException(cause)
/**
* Base trait for all classes that wants to be able use the logging infrastructure.
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
trait Logging {
@transient val log = Logger.get(this.getClass.getName)
}
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
object Helpers extends Logging {
// ================================================
class ReadWriteLock {
private val rwl = new ReentrantReadWriteLock
private val readLock = rwl.readLock
private val writeLock = rwl.writeLock
def withWriteLock[T](body: => T): T = {
writeLock.lock
try {
body
} finally {
writeLock.unlock
}
}
def withReadLock[T](body: => T): T = {
readLock.lock
try {
body
} finally {
readLock.unlock
}
}
}
// ================================================
// implicit conversion between regular actor and actor with a type future
implicit def actorWithFuture(a: Actor) = new ActorWithTypedFuture(a)
abstract class FutureWithTimeout[T](ch: InputChannel[Any]) extends Future[T](ch) {
def receiveWithin(timeout: Int) : Option[T]
override def respond(f: T => Unit): Unit = throw new UnsupportedOperationException("Does not support the Responder API")
}
def receiveOrFail[T](future: => FutureWithTimeout[T], timeout: Int, errorHandler: => T): T = {
future.receiveWithin(timeout) match {
case None => errorHandler
case Some(reply) => reply
}
}
class ActorWithTypedFuture(a: Actor) {
require(a != null)
def !!![A](msg: Any): FutureWithTimeout[A] = {
val ftch = new Channel[Any](Actor.self)
a.send(msg, ftch)
new FutureWithTimeout[A](ftch) {
def apply() =
if (isSet) value.get.asInstanceOf[A]
else ch.receive {
case a =>
value = Some(a)
value.get.asInstanceOf[A]
}
def isSet = receiveWithin(0).isDefined
def receiveWithin(timeout: Int): Option[A] = value match {
case None => ch.receiveWithin(timeout) {
case TIMEOUT =>
log.debug("Future timed out while waiting for actor: {}", a)
None
case a =>
value = Some(a)
value.asInstanceOf[Option[A]]
}
case a => a.asInstanceOf[Option[A]]
}
}
}
}
}

View file

@ -1,358 +0,0 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package com.scalablesolutions.akka.supervisor
import scala.actors._
import scala.actors.Actor._
import scala.collection.mutable.HashMap
import com.scalablesolutions.akka.supervisor.Helpers._
//====================================================
/**
* Configuration classes - not to be used as messages.
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
sealed abstract class ConfigElement
abstract class Server extends ConfigElement
abstract class FailOverScheme extends ConfigElement
abstract class Scope extends ConfigElement
case class SupervisorConfig(restartStrategy: RestartStrategy, worker: List[Server]) extends Server
case class Worker(serverContainer: GenericServerContainer, lifeCycle: LifeCycle) extends Server
case class RestartStrategy(scheme: FailOverScheme, maxNrOfRetries: Int, withinTimeRange: Int) extends ConfigElement
case object AllForOne extends FailOverScheme
case object OneForOne extends FailOverScheme
case class LifeCycle(scope: Scope, shutdownTime: Int) extends ConfigElement
case object Permanent extends Scope
case object Transient extends Scope
case object Temporary extends Scope
//====================================================
/**
* Messages that the supervisor responds to and returns.
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
sealed abstract class SupervisorMessage
case object Start extends SupervisorMessage
case object Stop extends SupervisorMessage
case class Configure(config: SupervisorConfig, factory: SupervisorFactory) extends SupervisorMessage
/**
* Abstract base class for all supervisor factories.
* <p>
* Example usage:
* <pre>
* class MySupervisorFactory extends SupervisorFactory {
*
* override protected def getSupervisorConfig: SupervisorConfig = {
* SupervisorConfig(
* RestartStrategy(OneForOne, 3, 10),
* Worker(
* myFirstActorInstance,
* LifeCycle(Permanent, 1000))
* ::
* Worker(
* mySecondActorInstance,
* LifeCycle(Permanent, 1000))
* :: Nil)
* }
* }
* </pre>
*
* Then create a concrete factory in which we mix in support for the specific implementation of the Service we want to use.
*
* <pre>
* object factory extends MySupervisorFactory
* </pre>
*
* Then create a new Supervisor tree with the concrete Services we have defined.
*
* <pre>
* val supervisor = factory.newSupervisor
* supervisor ! Start // start up all managed servers
* </pre>
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
abstract class SupervisorFactory extends Logging {
def newSupervisor: Supervisor = newSupervisorFor(getSupervisorConfig)
def newSupervisorFor(config: SupervisorConfig): Supervisor = config match {
case SupervisorConfig(restartStrategy, _) =>
val supervisor = create(restartStrategy)
supervisor.start
supervisor !? Configure(config, this) match {
case 'success => log.debug("Supervisor successfully configured")
case _ => log.error("Supervisor could not be configured")
}
supervisor
}
/**
* To be overridden by concrete factory.
* Should return the SupervisorConfig for the supervisor.
*/
protected def getSupervisorConfig: SupervisorConfig
protected def create(strategy: RestartStrategy): Supervisor = strategy match {
case RestartStrategy(scheme, maxNrOfRetries, timeRange) =>
scheme match {
case AllForOne => new Supervisor(new AllForOneStrategy(maxNrOfRetries, timeRange))
case OneForOne => new Supervisor(new OneForOneStrategy(maxNrOfRetries, timeRange))
}
}
}
//====================================================
/**
* TODO: document
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
class Supervisor(faultHandler: FaultHandlingStrategy) extends Actor with Logging {
private val state = new SupervisorState(this, faultHandler)
/**
* Returns an Option with the GenericServerContainer for the server with the name specified.
* If the server is found then Some(server) is returned else None.
*/
def getServer(id: String): Option[GenericServerContainer] = state.getServerContainer(id)
/**
* Returns an the GenericServerContainer for the server with the name specified.
* If the server is not found then the error handler is invoked.
*/
def getServerOrElse(id: String, errorHandler: => GenericServerContainer): GenericServerContainer = {
getServer(id) match {
case Some(serverContainer) => serverContainer
case None => errorHandler
}
}
def act = {
self.trapExit = true
loop {
react {
case Configure(config, factory) =>
log.debug("Configuring supervisor:{} ", this)
configure(config, factory)
reply('success)
case Start =>
state.serverContainers.foreach { serverContainer =>
serverContainer.start
log.info("Starting server: {}", serverContainer.getServer)
}
case Stop =>
state.serverContainers.foreach { serverContainer =>
serverContainer.terminate('normal)
log.info("Stopping server: {}", serverContainer)
}
log.info("Stopping supervisor: {}", this)
exit('normal)
case Exit(failedServer, reason) =>
reason match {
case 'forced => {} // do nothing
case _ => state.faultHandler.handleFailure(state, failedServer, reason)
}
case unexpected => log.warning("Unexpected message [{}], ignoring...", unexpected)
}
}
}
private def configure(config: SupervisorConfig, factory: SupervisorFactory) = config match {
case SupervisorConfig(_, servers) =>
servers.map(server =>
server match {
case Worker(serverContainer, lifecycle) =>
serverContainer.lifeCycle = Some(lifecycle)
spawnLink(serverContainer)
case SupervisorConfig(_, _) => // recursive configuration
val supervisor = factory.newSupervisorFor(server.asInstanceOf[SupervisorConfig])
supervisor ! Start
state.addSupervisor(supervisor)
})
}
private[supervisor] def spawnLink(serverContainer: GenericServerContainer): GenericServer = {
val newServer = serverContainer.newServer()
newServer.start
self.link(newServer)
log.debug("Linking actor [{}] to supervisor [{}]", newServer, this)
state.addServerContainer(serverContainer)
newServer
}
}
//====================================================
/**
* TODO: document
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
abstract class FaultHandlingStrategy(val maxNrOfRetries: Int, val withinTimeRange: Int) extends Logging {
private[supervisor] var supervisor: Supervisor = _
private var nrOfRetries = 0
private var retryStartTime = currentTime
private[supervisor] def handleFailure(state: SupervisorState, failedServer: AbstractActor, reason: AnyRef) = {
nrOfRetries += 1
if (timeRangeHasExpired) {
if (hasReachedMaximumNrOfRetries) {
log.info("Maximum of restarts [{}] for server [{}] has been reached - the supervisor including all its servers will now be shut down.", maxNrOfRetries, failedServer)
supervisor ! Stop // execution stops here
} else {
nrOfRetries = 0
retryStartTime = currentTime
}
}
doHandleFailure(state, failedServer, reason)
}
private[supervisor] def restart(serverContainer: GenericServerContainer, reason: AnyRef, state: SupervisorState) = {
preRestart(serverContainer)
serverContainer.lock.withWriteLock {
// TODO: this is the place to fail-over all pending messages in the failing actor's mailbox, if possible to get a hold of them
// e.g. something like 'serverContainer.getServer.getPendingMessages.map(newServer ! _)'
self.unlink(serverContainer.getServer)
serverContainer.lifeCycle match {
case None => throw new IllegalStateException("Server [" + serverContainer.id + "] does not have a life-cycle defined.")
case Some(LifeCycle(scope, shutdownTime)) =>
serverContainer.terminate(reason, shutdownTime)
scope match {
case Permanent =>
log.debug("Restarting server [{}] configured as PERMANENT.", serverContainer.id)
serverContainer.reconfigure(reason, supervisor.spawnLink(serverContainer), state.supervisor)
case Temporary =>
if (reason == 'normal) {
log.debug("Restarting server [{}] configured as TEMPORARY (since exited naturally).", serverContainer.id)
serverContainer.reconfigure(reason, supervisor.spawnLink(serverContainer), state.supervisor)
} else log.info("Server [{}] configured as TEMPORARY will not be restarted (received unnatural exit message).", serverContainer.id)
case Transient =>
log.info("Server [{}] configured as TRANSIENT will not be restarted.", serverContainer.id)
}
}
}
postRestart(serverContainer)
}
/**
* To be overriden by concrete strategies.
*/
protected def doHandleFailure(state: SupervisorState, failedServer: AbstractActor, reason: AnyRef)
/**
* To be overriden by concrete strategies.
*/
protected def preRestart(serverContainer: GenericServerContainer) = {}
/**
* To be overriden by concrete strategies.
*/
protected def postRestart(serverContainer: GenericServerContainer) = {}
private def hasReachedMaximumNrOfRetries: Boolean = nrOfRetries > maxNrOfRetries
private def timeRangeHasExpired: Boolean = (currentTime - retryStartTime) > withinTimeRange
private def currentTime: Long = System.currentTimeMillis
}
//====================================================
/**
* TODO: document
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
class AllForOneStrategy(maxNrOfRetries: Int, withinTimeRange: Int)
extends FaultHandlingStrategy(maxNrOfRetries, withinTimeRange) {
override def doHandleFailure(state: SupervisorState, failedServer: AbstractActor, reason: AnyRef) = {
log.error("Server [{}] has failed due to [{}] - scheduling restart - scheme: ALL_FOR_ONE.", failedServer, reason)
for (serverContainer <- state.serverContainers) restart(serverContainer, reason, state)
state.supervisors.foreach(_ ! Exit(failedServer, reason))
}
}
//====================================================
/**
* TODO: document
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
class OneForOneStrategy(maxNrOfRetries: Int, withinTimeRange: Int)
extends FaultHandlingStrategy(maxNrOfRetries, withinTimeRange) {
override def doHandleFailure(state: SupervisorState, failedServer: AbstractActor, reason: AnyRef) = {
log.error("Server [{}] has failed due to [{}] - scheduling restart - scheme: ONE_FOR_ONE.", failedServer, reason)
var serverContainer: Option[GenericServerContainer] = None
state.serverContainers.foreach {
container => if (container.getServer == failedServer) serverContainer = Some(container)
}
serverContainer match {
case None => throw new RuntimeException("Could not find a generic server for actor: " + failedServer)
case Some(container) => restart(container, reason, state)
}
}
}
//====================================================
/**
* TODO: document
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
private[supervisor] class SupervisorState(val supervisor: Supervisor, val faultHandler: FaultHandlingStrategy) extends Logging {
faultHandler.supervisor = supervisor
private val _lock = new ReadWriteLock
private val _serverContainerRegistry = new HashMap[String, GenericServerContainer]
private var _supervisors: List[Supervisor] = Nil
def supervisors: List[Supervisor] = _lock.withReadLock {
_supervisors
}
def addSupervisor(supervisor: Supervisor) = _lock.withWriteLock {
_supervisors = supervisor :: _supervisors
}
def serverContainers: List[GenericServerContainer] = _lock.withReadLock {
_serverContainerRegistry.values.toList
}
def getServerContainer(id: String): Option[GenericServerContainer] = _lock.withReadLock {
if (_serverContainerRegistry.contains(id)) Some(_serverContainerRegistry(id))
else None
}
def addServerContainer(serverContainer: GenericServerContainer) = _lock.withWriteLock {
_serverContainerRegistry += serverContainer.id -> serverContainer
}
def removeServerContainer(id: String) = _lock.withWriteLock {
getServerContainer(id) match {
case Some(serverContainer) => _serverContainerRegistry - id
case None => {}
}
}
}

View file

@ -1,202 +0,0 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package com.scalablesolutions.akka.supervisor
import org.specs.runner.JUnit4
import org.specs.Specification
import scala.actors._
import scala.actors.Actor._
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
class GenericServerContainerTest extends JUnit4(genericServerContainerSpec) // for JUnit4 and Maven
object genericServerContainerSpec extends Specification {
var inner: GenericServerContainerActor = null
var server: GenericServerContainer = null
def createProxy(f: () => GenericServer) = {
val server = new GenericServerContainer("server", f)
server.setTimeout(100)
server
}
inner = new GenericServerContainerActor
server = createProxy(() => inner)
server.newServer
server.start
"server should be initialized" in {
server.init("testInit")
Thread.sleep(100)
expect("initializing: testInit") {
inner.log
}
}
"server should terminate with a reason " in {
server.terminate("testTerminateWithReason", 100)
Thread.sleep(100)
expect("terminating: testTerminateWithReason") {
inner.log
}
}
"server respond to async oneway message" in {
server ! OneWay
Thread.sleep(100)
expect("got a oneway") {
inner.log
}
}
"server respond to async ping message" in {
server ! Ping
Thread.sleep(100)
expect("got a ping") {
inner.log
}
}
"server respond to !!!" in {
expect("pong") {
(server !!! Ping).getOrElse("nil")
}
expect("got a ping") {
inner.log
}
}
"server respond to !?" in {
expect("pong") {
val res: String = server !? Ping
res
}
expect("got a ping") {
inner.log
}
}
"server respond to !!! with timeout" in {
expect("pong") {
(server !!! Ping).getOrElse("nil")
}
expect("got a ping") {
inner.log
}
}
"server respond to !!! with timeout" in {
expect("error handler") {
server !!! (OneWay, "error handler")
}
expect("got a oneway") {
inner.log
}
}
"server respond to !!! and return future with timeout" in {
val future = server !! Ping
future.receiveWithin(100) match {
case None => fail("timed out") // timed out
case Some(reply) =>
expect("got a ping") {
inner.log
}
assert("pong" === reply)
}
}
"server respond to !!! and return future with timeout" in {
val future = server !! OneWay
future.receiveWithin(100) match {
case None =>
expect("got a oneway") {
inner.log
}
case Some(reply) =>
fail("expected a timeout, got Some(reply)")
}
}
"server respond do hotswap" in {
// using base
expect("pong") {
(server !!! Ping).getOrElse("nil")
}
// hotswapping
server.hotswap(Some({
case Ping => reply("hotswapped pong")
}))
expect("hotswapped pong") {
(server !!! Ping).getOrElse("nil")
}
}
"server respond do double hotswap" in {
// using base
expect("pong") {
(server !!! Ping).getOrElse("nil")
}
// hotswapping
server.hotswap(Some({
case Ping => reply("hotswapped pong")
}))
expect("hotswapped pong") {
(server !!! Ping).getOrElse("nil")
}
// hotswapping again
server.hotswap(Some({
case Ping => reply("hotswapped pong again")
}))
expect("hotswapped pong again") {
(server !!! Ping).getOrElse("nil")
}
}
"server respond do hotswap and then revert" in {
// using base
expect("pong") {
(server !!! Ping).getOrElse("nil")
}
// hotswapping
server.hotswap(Some({
case Ping => reply("hotswapped pong")
}))
expect("hotswapped pong") {
(server !!! Ping).getOrElse("nil")
}
// restoring original base
server.hotswap(None)
expect("pong") {
(server !!! Ping).getOrElse("nil")
}
}
}
class GenericServerContainerActor extends GenericServer {
var log = ""
override def body: PartialFunction[Any, Unit] = {
case Ping =>
log = "got a ping"
reply("pong")
case OneWay =>
log = "got a oneway"
}
override def init(config: AnyRef) = log = "initializing: " + config
override def shutdown(reason: AnyRef) = log = "terminating: " + reason
}

View file

@ -1,40 +0,0 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package com.scalablesolutions.akka.supervisor
import org.specs.runner.JUnit4
import org.specs.Specification
import scala.actors._
import scala.actors.Actor._
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
class GenericServerTest extends JUnit4(genericServerSpec) // for JUnit4 and Maven
object genericServerSpec extends Specification {
"server should respond to a regular message" in {
val server = new TestGenericServerActor
server.start
server !? Ping match {
case reply: String =>
assert("got a ping" === server.log)
assert("pong" === reply)
case _ => fail()
}
}
}
class TestGenericServerActor extends GenericServer {
var log: String = ""
override def body: PartialFunction[Any, Unit] = {
case Ping =>
log = "got a ping"
reply("pong")
}
}

View file

@ -1,12 +0,0 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package com.scalablesolutions.akka.supervisor
sealed abstract class TestMessage
case object Ping extends TestMessage
case object Pong extends TestMessage
case object OneWay extends TestMessage
case object Die extends TestMessage
case object NotifySupervisorExit extends TestMessage

View file

@ -1,77 +0,0 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package com.scalablesolutions.akka.supervisor
import org.specs.runner.JUnit4
import org.specs.Specification
import scala.actors._
import scala.actors.Actor._
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
class SupervisorStateTest extends JUnit4(supervisorStateSpec) // for JUnit4 and Maven
object supervisorStateSpec extends Specification {
val dummyActor = new GenericServer { override def body: PartialFunction[Any, Unit] = { case _ => }}
val newDummyActor = () => dummyActor
var state: SupervisorState = _
var proxy: GenericServerContainer = _
var supervisor: Supervisor = _
proxy = new GenericServerContainer("server1", newDummyActor)
object factory extends SupervisorFactory {
override def getSupervisorConfig: SupervisorConfig = {
SupervisorConfig(
RestartStrategy(AllForOne, 3, 100),
Worker(
proxy,
LifeCycle(Permanent, 100))
:: Nil)
}
}
supervisor = factory.newSupervisor
state = new SupervisorState(supervisor, new AllForOneStrategy(3, 100))
"supervisor state should return added server" in {
state.addServerContainer(proxy)
state.getServerContainer("server1") match {
case None => fail("should have returned server")
case Some(server) =>
assert(server != null)
assert(server.isInstanceOf[GenericServerContainer])
assert(proxy === server)
}
}
"supervisor state should remove added server" in {
state.addServerContainer(proxy)
state.removeServerContainer("server1")
state.getServerContainer("server1") match {
case Some(_) => fail("should have returned None")
case None =>
}
state.getServerContainer("dummyActor") match {
case Some(_) => fail("should have returned None")
case None =>
}
}
"supervisor state should fail getting non-existent server by symbol" in {
state.getServerContainer("server2") match {
case Some(_) => fail("should have returned None")
case None =>
}
}
"supervisor state should fail getting non-existent server by actor" in {
state.getServerContainer("dummyActor") match {
case Some(_) => fail("should have returned None")
case None =>
}
}
}

View file

@ -1,434 +0,0 @@
/**
* Copyright (C) 2009 Scalable Solutions.
*/
package com.scalablesolutions.akka.supervisor
import org.specs.runner.JUnit4
import org.specs.Specification
import scala.actors._
import scala.actors.Actor._
import scala.collection.Map
import scala.collection.mutable.HashMap
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
class SupervisorTest extends JUnit4(supervisorSpec) // for JUnit4 and Maven
object supervisorSpec extends Specification {
var messageLog: String = ""
val pingpong1 = new GenericServerContainer("pingpong1", () => new PingPong1Actor)
val pingpong2 = new GenericServerContainer("pingpong2", () => new PingPong2Actor)
val pingpong3 = new GenericServerContainer("pingpong3", () => new PingPong3Actor)
pingpong1.setTimeout(100)
pingpong2.setTimeout(100)
pingpong3.setTimeout(100)
@BeforeMethod
def setup = messageLog = ""
// ===========================================
"starting supervisor should start the servers" in {
val sup = getSingleActorAllForOneSupervisor
sup ! Start
expect("pong") {
(pingpong1 !!! Ping).getOrElse("nil")
}
}
// ===========================================
"started supervisor should be able to return started servers" in {
val sup = getSingleActorAllForOneSupervisor
sup ! Start
val server = sup.getServerOrElse("pingpong1", throw new RuntimeException("server not found"))
assert(server.isInstanceOf[GenericServerContainer])
assert(server === pingpong1)
}
// ===========================================
"started supervisor should fail returning non-existing server" in {
val sup = getSingleActorAllForOneSupervisor
sup ! Start
intercept(classOf[RuntimeException]) {
sup.getServerOrElse("wrong_name", throw new RuntimeException("server not found"))
}
}
// ===========================================
"supervisor should restart killed server with restart strategy one_for_one" in {
val sup = getSingleActorOneForOneSupervisor
sup ! Start
intercept(classOf[RuntimeException]) {
pingpong1 !!! (Die, throw new RuntimeException("TIME OUT"))
}
Thread.sleep(100)
expect("oneforone") {
messageLog
}
}
// ===========================================
"supervisor should restart used killed server with restart strategy one_for_one" in {
val sup = getSingleActorOneForOneSupervisor
sup ! Start
expect("pong") {
(pingpong1 !!! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("ping") {
messageLog
}
intercept(classOf[RuntimeException]) {
pingpong1 !!! (Die, throw new RuntimeException("TIME OUT"))
}
Thread.sleep(100)
expect("pingoneforone") {
messageLog
}
expect("pong") {
(pingpong1 !!! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("pingoneforoneping") {
messageLog
}
}
// ===========================================
"supervisor should restart killed server with restart strategy all_for_one" in {
val sup = getSingleActorAllForOneSupervisor
sup ! Start
intercept(classOf[RuntimeException]) {
pingpong1 !!! (Die, throw new RuntimeException("TIME OUT"))
}
Thread.sleep(100)
expect("allforone") {
messageLog
}
}
// ===========================================
"supervisor should restart used killed server with restart strategy all_for_one" in {
val sup = getSingleActorAllForOneSupervisor
sup ! Start
expect("pong") {
(pingpong1 !!! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("ping") {
messageLog
}
intercept(classOf[RuntimeException]) {
pingpong1 !!! (Die, throw new RuntimeException("TIME OUT"))
}
Thread.sleep(100)
expect("pingallforone") {
messageLog
}
expect("pong") {
(pingpong1 !!! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("pingallforoneping") {
messageLog
}
}
// ===========================================
"supervisor should restart killed multiple servers with restart strategy one_for_one" in {
val sup = getMultipleActorsOneForOneConf
sup ! Start
intercept(classOf[RuntimeException]) {
pingpong3 !!! (Die, throw new RuntimeException("TIME OUT"))
}
Thread.sleep(100)
expect("oneforone") {
messageLog
}
}
// ===========================================
"supervisor should restart killed multiple servers with restart strategy one_for_one" in {
val sup = getMultipleActorsOneForOneConf
sup ! Start
expect("pong") {
(pingpong1 !!! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("pong") {
(pingpong2 !!! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("pong") {
(pingpong3 !!! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("pingpingping") {
messageLog
}
intercept(classOf[RuntimeException]) {
pingpong2 !!! (Die, throw new RuntimeException("TIME OUT"))
}
Thread.sleep(100)
expect("pingpingpingoneforone") {
messageLog
}
expect("pong") {
(pingpong1 !!! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("pong") {
(pingpong2 !!! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("pong") {
(pingpong3 !!! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("pingpingpingoneforonepingpingping") {
messageLog
}
}
// ===========================================
"supervisor should restart killed muliple servers with restart strategy all_for_one" in {
val sup = getMultipleActorsAllForOneConf
sup ! Start
intercept(classOf[RuntimeException]) {
pingpong2 !!! (Die, throw new RuntimeException("TIME OUT"))
}
Thread.sleep(100)
expect("allforoneallforoneallforone") {
messageLog
}
}
// ===========================================
"supervisor should restart killed muliple servers with restart strategy all_for_one" in {
val sup = getMultipleActorsAllForOneConf
sup ! Start
expect("pong") {
(pingpong1 !!! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("pong") {
(pingpong2 !!! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("pong") {
(pingpong3 !!! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("pingpingping") {
messageLog
}
intercept(classOf[RuntimeException]) {
pingpong2 !!! (Die, throw new RuntimeException("TIME OUT"))
}
Thread.sleep(100)
expect("pingpingpingallforoneallforoneallforone") {
messageLog
}
expect("pong") {
(pingpong1 !!! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("pong") {
(pingpong2 !!! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("pong") {
(pingpong3 !!! Ping).getOrElse("nil")
}
Thread.sleep(100)
expect("pingpingpingallforoneallforoneallforonepingpingping") {
messageLog
}
}
"supervisor should restart killed first-level server with restart strategy all_for_one" in {
val sup = getNestedSupervisorsAllForOneConf
sup ! Start
intercept(classOf[RuntimeException]) {
pingpong1 !!! (Die, throw new RuntimeException("TIME OUT"))
}
Thread.sleep(100)
expect("allforoneallforoneallforone") {
messageLog
}
}
// =============================================
// Creat some supervisors with different configurations
def getSingleActorAllForOneSupervisor: Supervisor = {
// Create an abstract SupervisorContainer that works for all implementations
// of the different Actors (Services).
//
// Then create a concrete container in which we mix in support for the specific
// implementation of the Actors we want to use.
object factory extends TestSupervisorFactory {
override def getSupervisorConfig: SupervisorConfig = {
SupervisorConfig(
RestartStrategy(AllForOne, 3, 100),
Worker(
pingpong1,
LifeCycle(Permanent, 100))
:: Nil)
}
}
factory.newSupervisor
}
def getSingleActorOneForOneSupervisor: Supervisor = {
object factory extends TestSupervisorFactory {
override def getSupervisorConfig: SupervisorConfig = {
SupervisorConfig(
RestartStrategy(OneForOne, 3, 100),
Worker(
pingpong1,
LifeCycle(Permanent, 100))
:: Nil)
}
}
factory.newSupervisor
}
def getMultipleActorsAllForOneConf: Supervisor = {
object factory extends TestSupervisorFactory {
override def getSupervisorConfig: SupervisorConfig = {
SupervisorConfig(
RestartStrategy(AllForOne, 3, 100),
Worker(
pingpong1,
LifeCycle(Permanent, 100))
::
Worker(
pingpong2,
LifeCycle(Permanent, 100))
::
Worker(
pingpong3,
LifeCycle(Permanent, 100))
:: Nil)
}
}
factory.newSupervisor
}
def getMultipleActorsOneForOneConf: Supervisor = {
object factory extends TestSupervisorFactory {
override def getSupervisorConfig: SupervisorConfig = {
SupervisorConfig(
RestartStrategy(OneForOne, 3, 100),
Worker(
pingpong1,
LifeCycle(Permanent, 100))
::
Worker(
pingpong2,
LifeCycle(Permanent, 100))
::
Worker(
pingpong3,
LifeCycle(Permanent, 100))
:: Nil)
}
}
factory.newSupervisor
}
def getNestedSupervisorsAllForOneConf: Supervisor = {
object factory extends TestSupervisorFactory {
override def getSupervisorConfig: SupervisorConfig = {
SupervisorConfig(
RestartStrategy(AllForOne, 3, 100),
Worker(
pingpong1,
LifeCycle(Permanent, 100))
::
SupervisorConfig(
RestartStrategy(AllForOne, 3, 100),
Worker(
pingpong2,
LifeCycle(Permanent, 100))
::
Worker(
pingpong3,
LifeCycle(Permanent, 100))
:: Nil)
:: Nil)
}
}
factory.newSupervisor
}
class PingPong1Actor extends GenericServer {
override def body: PartialFunction[Any, Unit] = {
case Ping =>
messageLog += "ping"
reply("pong")
case Die =>
throw new RuntimeException("Recieved Die message")
}
}
class PingPong2Actor extends GenericServer {
override def body: PartialFunction[Any, Unit] = {
case Ping =>
messageLog += "ping"
reply("pong")
case Die =>
throw new RuntimeException("Recieved Die message")
}
}
class PingPong3Actor extends GenericServer {
override def body: PartialFunction[Any, Unit] = {
case Ping =>
messageLog += "ping"
reply("pong")
case Die =>
throw new RuntimeException("Recieved Die message")
}
}
// =============================================
class TestAllForOneStrategy(maxNrOfRetries: Int, withinTimeRange: Int) extends AllForOneStrategy(maxNrOfRetries, withinTimeRange) {
override def postRestart(serverContainer: GenericServerContainer) = {
messageLog += "allforone"
}
}
class TestOneForOneStrategy(maxNrOfRetries: Int, withinTimeRange: Int) extends OneForOneStrategy(maxNrOfRetries, withinTimeRange) {
override def postRestart(serverContainer: GenericServerContainer) = {
messageLog += "oneforone"
}
}
abstract class TestSupervisorFactory extends SupervisorFactory {
override def create(strategy: RestartStrategy): Supervisor = strategy match {
case RestartStrategy(scheme, maxNrOfRetries, timeRange) =>
scheme match {
case AllForOne => new Supervisor(new TestAllForOneStrategy(maxNrOfRetries, timeRange))
case OneForOne => new Supervisor(new TestOneForOneStrategy(maxNrOfRetries, timeRange))
}
}
}
}

View file

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module relativePaths="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
<?xml version="1.0" encoding="UTF-8"?>
<module relativePaths="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>