Package org.akka.essentials.clientserver.sample

Source Code of org.akka.essentials.clientserver.sample.ServerActorSystem

package org.akka.essentials.clientserver.sample;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;
import akka.event.Logging;
import akka.event.LoggingAdapter;
import akka.kernel.Bootable;

import com.typesafe.config.ConfigFactory;

public class ServerActorSystem implements Bootable {

  private LoggingAdapter log = null;
  private ActorSystem system;

  /*
   * default constructor
   */
  public ServerActorSystem() {
    // load the configuration
    system = ActorSystem.create("ServerSys", ConfigFactory.load()
        .getConfig("ServerSys"));
    log = Logging.getLogger(system, this);
    // create the actor
    @SuppressWarnings("unused")
    ActorRef actor = system.actorOf(new Props(ServerActor.class),
        "serverActor");
  }

  public void shutdown() {
    log.info("Shutting down the ServerActorSystem");

  }

  public void startup() {
    // TODO Auto-generated method stub

  }

  public static void main(String[] args) {

    new ServerActorSystem();

  }

}
TOP

Related Classes of org.akka.essentials.clientserver.sample.ServerActorSystem

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.