title: Solution for "UntypedActor" deprecated in Akka (Java) Tutorial
body: <h2>Original Code</h2>
  
  <p>Akka tutorial has the following code: <a href="http://doc.akka.io/docs/akka/2.0.2/intro/getting-started-first-java.html">http://doc.akka.io/docs/akka/2.0.2/intro/getting-started-first-java.html</a></p>
  
  <pre><code>public void calculate (final int nrOfWorkers, final int nrOfElements, final int nrOfMessages){
      ActorSystem system = ActorSystem.create("PiSystem");
      final ActorRef listener = system.actorOf(Props.create(Listener.class), "listener");
      ActorRef master = system.actorOf(new Props(new UntypedActorFactory() {
              public UntypedActor create() {
                  return new Master(nrOfWorkers, nrOfMessages, nrOfElements, listener);
              }
      }), "master");
      master.tell(new Calculate(), ActorRef.noSender());
  }
  </code></pre>
  
  <p>in which, <code>UntypedActorFactory</code> is deprecated.  </p>
  
  <h2>My Mod</h2>
  
  <p>So I tried to use <code>Props.create</code> such as</p>
  
  <pre><code>ActorRef master = system.actorOf( Props.create(
              new Creator&lt;Master&gt;(){
                  public Master create(){
                      return new Master(nrOfWorkers, nrOfMessages, nrOfElements, listener);
              }
      }), "master");
  </code></pre>
  
  <p>And there is Exception saying </p>
  
  <blockquote>
    <p>cannot use non-static local Creator to create actors; make it static
    or top-level</p>
  </blockquote>
  
  <p>so I start to write a static class, which has parameters needed to be passed. </p>
  
  <pre><code>static class LocalCreator implements Creator&lt;Master&gt;{
      public Master create(){
          return new Master(nrOfWorkers, nrOfMessages, nrOfElements, listener);
      }
  }
  </code></pre>
  
  <h2>Question</h2>
  
  <p>How to pass the parameters nrOfWorkers and etc. into the <code>create()</code> function elegantly?</p>