[armedbear-devel] Diffs for chemicalamba (Akka bridge in ABCL)
Mark Evenson
evenson at panix.com
Wed Aug 21 18:11:10 UTC 2013
On 8/21/13 2:56 AM, ubikation _ wrote:
> I have been trying to create a static function that allows me to create
> an Akka Actor so I can try to play with it from within slime, but I am
> running into a very odd issue.
Attached please find a patch of the build instructions for
chemicalambda. I haven't quite gotten around to testing your problems
with the invocation of static method, but anticipate getting to that it
the next round of hacking.
--
"A screaming comes across the sky. It has happened before, but there
is nothing to compare to it now."
-------------- next part --------------
# HG changeset patch
# Parent 86dc9ccc54f91772e5cad015b930a327c4f8afc7
Initial patches to get chemicalambda to work.
Declare dependency on org.armedbear.lisp:abcl:1.0.0 or better.
Correct ASDF description to refer to Akka via MVN coordiate, but the
Maven artifact directly on the filesystem.
Move Java source to standard location where Maven can build it.
Start to refactor Java Akka classes.
diff --git a/.hgignore b/.hgignore
new file mode 100644
--- /dev/null
+++ b/.hgignore
@@ -0,0 +1,2 @@
+.hgignore
+target
diff --git a/chemicalambda.asd b/chemicalambda.asd
--- a/chemicalambda.asd
+++ b/chemicalambda.asd
@@ -1,21 +1,23 @@
;;;; chemicalambda.asd
+#+abcl
(eval-when (:compile-toplevel :load-toplevel :execute)
- (cl:require 'abcl-contrib)
- (cl:require 'abcl-asdf)
- (cl:require 'extensible-sequences)
- (cl:require 'java-collections)
- (require :abcl-contrib)
- (require :jfli))
+ (loop :for requirable :in '(:abcl-contrib :extensible-sequences :java-collections)
+ :doing (require requirable)))
(asdf:defsystem #:chemicalambda
:name "chemicalambda"
:serial t
:license "Apache License Version 2.0"
+ :desystem-depends-on (:abcl-asdf :jfli)
:depends-on (#:alexandria
#:optima)
:default-component-class asdf:cl-source-file
- :components
- ((:mvn "com.typesafe.akka/akka" :version "2.2")
- (:file "package")
- (:file "utilities")
- (:file "chemicalambda")))
+ :components ((:module akka
+ :components ((:mvn "com.typesafe.akka/akka/2.2")))
+ (:module source :pathname ""
+ :components ((:file "package")
+ (:file "utilities")
+ (:file "chemicalambda")))
+ (:module chemicalambda.jar :pathname "target/"
+ :components ((:jar-file "chemicalambda-0.1")))))
+
diff --git a/pom.xml b/pom.xml
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
<dependency>
<groupId>org.armedbear.lisp</groupId>
<artifactId>abcl</artifactId>
- <version>0.25.0</version>
+ <version>[1.0.0,)</version>
</dependency>
</dependencies>
<repositories>
diff --git a/src/main/java/org/abcl/akka/AkkaActorUntyped.java b/src/main/java/org/abcl/akka/AkkaActorUntyped.java
new file mode 100644
--- /dev/null
+++ b/src/main/java/org/abcl/akka/AkkaActorUntyped.java
@@ -0,0 +1,8 @@
+package org.abcl.akka;
+
+import akka.actor.Props;
+
+public interface AkkaActorUntyped {
+ // marker type for implementors of AkkaActor
+ public Props mkProps(String name);
+}
diff --git a/AkkaApi.java b/src/main/java/org/abcl/akka/AkkaApi.java
rename from AkkaApi.java
rename to src/main/java/org/abcl/akka/AkkaApi.java
--- a/AkkaApi.java
+++ b/src/main/java/org/abcl/akka/AkkaApi.java
@@ -1,3 +1,5 @@
+package org.abcl.akka;
+
import java.util.Map;
import org.armedbear.lisp.JavaObject;
@@ -8,7 +10,6 @@
import akka.event.Logging;
import akka.event.LoggingAdapter;
import akka.actor.Props;
-import akka.japi.Creator;
import akka.actor.ActorSystem;
public class AkkaApi {
@@ -23,7 +24,6 @@
ActorRef toReturn = system.actorOf(Props.create(AkkaActorUntyped.class));
return toReturn;
}
-}
class AkkaActorUntyped extends UntypedActor {
protected Class<?> objectType;
@@ -70,5 +70,6 @@
protected Object createInstance() throws Exception {
return closure.execute(JavaObject.getInstance(this)).javaInstance();
}
+ }
}
diff --git a/AkkaApiSimple.java b/src/main/java/org/abcl/akka/AkkaApiSimple.java
rename from AkkaApiSimple.java
rename to src/main/java/org/abcl/akka/AkkaApiSimple.java
--- a/AkkaApiSimple.java
+++ b/src/main/java/org/abcl/akka/AkkaApiSimple.java
@@ -1,3 +1,5 @@
+package org.abcl.akka;
+
import java.util.Map;
import org.armedbear.lisp.JavaObject;
@@ -8,10 +10,8 @@
import akka.event.Logging;
import akka.event.LoggingAdapter;
import akka.actor.Props;
-import akka.japi.Creator;
import akka.actor.ActorSystem;
-
public class AkkaApiSimple {
public static void main(String[] args) {
@@ -27,10 +27,9 @@
AkkaSingleton.stop();
System.out.println("< AkkaApiSimple.test");
}
-
}
-class AkkaActorUntyped extends UntypedActor {
+class AkkaActorUntypedApiSimple extends UntypedActor {
protected Class<?> objectType;
protected LispObject closure;
protected Map<Object, Object> dependencies;
@@ -100,6 +99,6 @@
public static ActorRef createActor() {
AkkaSingleton as = getInstance();
- return as.system.actorOf(AkkaActorUntyped.mkProps());
+ return as.system.actorOf(AkkaActorUntypedApiSimple.mkProps());
}
}
More information about the armedbear-devel
mailing list