first pass at moving modules over, sbt project compiles properly

This commit is contained in:
sclasen 2011-05-23 11:37:56 -04:00
parent 1f5a04c678
commit 5e8f844545
126 changed files with 9447 additions and 2 deletions

View file

@ -0,0 +1,74 @@
package akka.spring.foo;
import static akka.actor.Actors.*;
import akka.actor.ActorRef;
import akka.actor.UntypedActor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import java.util.concurrent.CountDownLatch;
/**
* test class
*/
public class PingActor extends UntypedActor implements ApplicationContextAware {
private String stringFromVal;
private String stringFromRef;
public static String lastMessage = null;
public static CountDownLatch latch = new CountDownLatch(1);
private boolean gotApplicationContext = false;
public void setApplicationContext(ApplicationContext context) {
gotApplicationContext = true;
}
public boolean gotApplicationContext() {
return gotApplicationContext;
}
public String getStringFromVal() {
return stringFromVal;
}
public void setStringFromVal(String s) {
stringFromVal = s;
}
public String getStringFromRef() {
return stringFromRef;
}
public void setStringFromRef(String s) {
stringFromRef = s;
}
private String longRunning() {
try {
Thread.sleep(6000);
} catch (InterruptedException e) {
}
return "this took long";
}
public void onReceive(Object message) throws Exception {
if (message instanceof String) {
lastMessage = (String) message;
if (message.equals("longRunning")) {
ActorRef pongActor = actorOf(PongActor.class).start();
pongActor.sendRequestReply("longRunning", getContext());
}
latch.countDown();
} else {
throw new IllegalArgumentException("Unknown message: " + message);
}
}
}