Permalink
Browse files

Manifests

  • Loading branch information...
janm committed Oct 25, 2012
1 parent 3ff0ef5 commit 022790ab87e97a45714d9b0c4f9e6d01555e2273
@@ -1,7 +0,0 @@
-<aspectj>
-
- <weaver options="-XnoInline -Xreweavable ">
- <include within="org.cakesolutions.akkapatterns..*"/>
- </weaver>
-
-</aspectj>
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:neo4j="http://www.springframework.org/schema/data/neo4j"
- xmlns:mongo="http://www.springframework.org/schema/data/mongo"
- xmlns:repository="http://www.springframework.org/schema/data/repository"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/data/neo4j http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd
- http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
- http://www.springframework.org/schema/data/repository http://www.springframework.org/schema/data/repository/spring-repository-1.0.xsd">
-
-
-
-</beans>
@@ -0,0 +1,3 @@
+Implementation-Title: Akka Paterns
+Implementation-Version: 1.0
+Implementation-Build: 100
@@ -6,8 +6,10 @@ import akka.pattern.ask
import spray.httpx.marshalling.MetaMarshallers
import spray.routing.Directives
import org.cakesolutions.akkapatterns.core.application.{ PoisonPill, GetImplementation, Implementation }
+import java.util.Date
+import scala.concurrent.ExecutionContext.Implicits._
-case class SystemInfo(implementation: Implementation, host: String)
+case class SystemInfo(implementation: Implementation, host: String, timestamp: Long)
class HomeService(implicit val actorSystem: ActorSystem) extends Directives with Marshalling with MetaMarshallers with DefaultTimeout {
@@ -17,9 +19,8 @@ class HomeService(implicit val actorSystem: ActorSystem) extends Directives with
path(Slash) {
get {
complete {
- import scala.concurrent.ExecutionContext.Implicits._
(applicationActor ? GetImplementation()).mapTo[Implementation].map {
- SystemInfo(_, InetAddress.getLocalHost.getCanonicalHostName)
+ SystemInfo(_, InetAddress.getLocalHost.getCanonicalHostName, new Date().getTime)
}
}
}
@@ -30,5 +30,5 @@ trait Marshalling extends DefaultJsonProtocol with UuidMarshalling with SprayJso
implicit val RegisteredCustomerFormat = jsonFormat2(RegisteredCustomer)
implicit val ImplementationFormat = jsonFormat3(Implementation)
- implicit val SystemInfoFormat = jsonFormat2(SystemInfo)
+ implicit val SystemInfoFormat = jsonFormat3(SystemInfo)
}
@@ -15,9 +15,9 @@ class ApplicationActor extends Actor {
case GetImplementation() =>
val manifestStream = getClass.getResourceAsStream("/META-INF/MANIFEST.MF")
val manifest = new java.util.jar.Manifest(manifestStream)
- val title = manifest.getMainAttributes.getValue("Implementation-Title")
- val version = manifest.getMainAttributes.getValue("Implementation-Version")
- val build = manifest.getMainAttributes.getValue("Implementation-Build")
+ val title = "Akka-Patterns" // manifest.getMainAttributes.getValue("Implementation-Title")
+ val version = "1.0" // manifest.getMainAttributes.getValue("Implementation-Version")
+ val build = "1.0" //manifest.getMainAttributes.getValue("Implementation-Build")
manifestStream.close()
sender ! Implementation(title, version, build)

0 comments on commit 022790a

Please sign in to comment.