Merge remote branch 'origin/master'
This commit is contained in:
commit
63dbdd6c3e
5 changed files with 444 additions and 604 deletions
|
|
@ -55,8 +55,8 @@ trait BootableActorLoaderService extends Bootable with Logging {
|
|||
protected def createApplicationClassLoader : Option[ClassLoader] = {
|
||||
Some(
|
||||
if (HOME.isDefined) {
|
||||
val CONFIG = HOME.get + "/config"
|
||||
val DEPLOY = HOME.get + "/deploy"
|
||||
val CONFIG = HOME.getOrElse(throwNoAkkaHomeException) + "/config"
|
||||
val DEPLOY = HOME.getOrElse(throwNoAkkaHomeException) + "/deploy"
|
||||
val DEPLOY_DIR = new File(DEPLOY)
|
||||
if (!DEPLOY_DIR.exists) {
|
||||
log.error("Could not find a deploy directory at [%s]", DEPLOY)
|
||||
|
|
|
|||
|
|
@ -64,9 +64,12 @@ object Config {
|
|||
Configgy.config
|
||||
} else if (HOME.isDefined) {
|
||||
try {
|
||||
val configFile = HOME.get + "/config/akka.conf"
|
||||
val configFile = HOME.getOrElse(throwNoAkkaHomeException) + "/config/akka.conf"
|
||||
Configgy.configure(configFile)
|
||||
ConfigLogger.log.info("AKKA_HOME is defined as [%s], config loaded from [%s].", HOME.get, configFile)
|
||||
ConfigLogger.log.info(
|
||||
"AKKA_HOME is defined as [%s], config loaded from [%s].",
|
||||
HOME.getOrElse(throwNoAkkaHomeException),
|
||||
configFile)
|
||||
} catch {
|
||||
case e: ParseException => throw new ConfigurationException(
|
||||
"AKKA_HOME is defined as [" + HOME.get + "] " +
|
||||
|
|
@ -86,7 +89,7 @@ object Config {
|
|||
CConfig.fromString("<akka></akka>") // default empty config
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
val CONFIG_VERSION = config.getString("akka.version", VERSION)
|
||||
if (VERSION != CONFIG_VERSION) throw new ConfigurationException(
|
||||
"Akka JAR version [" + VERSION + "] is different than the provided config ('akka.conf') version [" + CONFIG_VERSION + "]")
|
||||
|
|
@ -95,4 +98,9 @@ object Config {
|
|||
|
||||
val startTime = System.currentTimeMillis
|
||||
def uptime = (System.currentTimeMillis - startTime) / 1000
|
||||
|
||||
def throwNoAkkaHomeException = throw new ConfigurationException(
|
||||
"Akka home is not defined. Either:" +
|
||||
"\n\t1. Define 'AKKA_HOME' environment variable pointing to the root of the Akka distribution." +
|
||||
"\n\t2. Add the '-Dakka.home=...' option pointing to the root of the Akka distribution.")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@ package se.scalablesolutions.akka.kernel
|
|||
|
||||
import javax.ws.rs.core.UriBuilder
|
||||
import javax.servlet.ServletConfig
|
||||
import java.io.File
|
||||
|
||||
import se.scalablesolutions.akka.actor.BootableActorLoaderService
|
||||
import se.scalablesolutions.akka.util.{Bootable, Logging}
|
||||
import se.scalablesolutions.akka.comet.{ AkkaServlet }
|
||||
import se.scalablesolutions.akka.comet.AkkaServlet
|
||||
|
||||
import org.eclipse.jetty.xml.XmlConfiguration
|
||||
import java.io.File
|
||||
import org.eclipse.jetty.server.{Handler, Server}
|
||||
import org.eclipse.jetty.server.handler.{HandlerList, HandlerCollection, ContextHandler}
|
||||
|
||||
|
|
@ -28,16 +29,17 @@ trait EmbeddedAppServer extends Bootable with Logging {
|
|||
|
||||
protected var server: Option[Server] = None
|
||||
|
||||
abstract override def onLoad = {
|
||||
abstract override def onLoad = {
|
||||
super.onLoad
|
||||
if (config.getBool("akka.rest.service", true)) {
|
||||
log.info("Attempting to start Akka REST service (Jersey)")
|
||||
|
||||
System.setProperty("jetty.port",REST_PORT.toString)
|
||||
System.setProperty("jetty.host",REST_HOSTNAME)
|
||||
System.setProperty("jetty.home",HOME.get + "/deploy/root")
|
||||
System.setProperty("jetty.home",HOME.getOrElse(throwNoAkkaHomeException) + "/deploy/root")
|
||||
|
||||
val configuration = new XmlConfiguration(new File(HOME.get + "/config/microkernel-server.xml").toURI.toURL)
|
||||
val configuration = new XmlConfiguration(
|
||||
new File(HOME.getOrElse(throwNoAkkaHomeException) + "/config/microkernel-server.xml").toURI.toURL)
|
||||
|
||||
server = Option(configuration.configure.asInstanceOf[Server]) map { s => //Set the correct classloader to our contexts
|
||||
applicationLoader foreach { loader =>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -154,4 +154,4 @@ message AddressProtocol {
|
|||
message ExceptionProtocol {
|
||||
required string classname = 1;
|
||||
required string message = 2;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue