2013-12-19 102 views
0

我是Akka的新手。我正在尝试Akka Java Doc中的第一个集群示例。代码如下:Akka简单群集示例

import akka.actor.ActorRef; 
import akka.actor.ActorSystem; 
import akka.actor.Props; 
import akka.actor.UntypedActor; 
import akka.cluster.Cluster; 
import akka.cluster.ClusterEvent.ClusterDomainEvent; 

public class SimpleClusterApp { 
    public static void main(String[] args) { 
    // Override the configuration of the port 
    // when specified as program argument 
    if (args.length > 0) 
     System.setProperty("akka.remote.netty.tcp.port", args[0]); 

    // Create an Akka system 
    ActorSystem system = ActorSystem.create("ClusterSystem"); 

    // Create an actor that handles cluster domain events 
    ActorRef clusterListener = system.actorOf(Props.create(SimpleClusterListener.class), "clusterListener"); 

    // Add subscription of cluster events 
    Cluster.get(system).subscribe(clusterListener, ClusterDomainEvent.class); 
} 
} 

但它不能工作。 Eclipse抱怨SimpleClusterListener.class无法解析。有谁能告诉我,我怎么能找到这个班? 非常感谢您

回答