Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
spray/examples/spray-servlet/simple-spray-servlet-server/src/main/scala/spray/examples/Boot.scala
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
23 lines (18 sloc)
689 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package spray.examples | |
import akka.actor.{Props, ActorSystem} | |
import spray.servlet.WebBoot | |
// This class is instantiated by the servlet initializer. | |
// It can either define a constructor with a single | |
// `javax.servlet.ServletContext` parameter or a | |
// default constructor. | |
// It must mplement the spray.servlet.WebBoot trait. | |
class Boot extends WebBoot { | |
// we need an ActorSystem to host our application in | |
val system = ActorSystem("example") | |
// the service actor replies to incoming HttpRequests | |
val serviceActor = system.actorOf(Props[DemoService]) | |
system.registerOnTermination { | |
// put additional cleanup code here | |
system.log.info("Application shut down") | |
} | |
} |