Skip to content

Commit

Permalink
Manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
janm committed Oct 25, 2012
1 parent 3ff0ef5 commit 022790a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 32 deletions.
7 changes: 0 additions & 7 deletions sbt/src/main/META-INF/aop.xml

This file was deleted.

18 changes: 0 additions & 18 deletions sbt/src/main/META-INF/spring/module-context.xml

This file was deleted.

3 changes: 3 additions & 0 deletions sbt/src/main/resources/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Implementation-Title: Akka Paterns
Implementation-Version: 1.0
Implementation-Build: 100
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 022790a

Please sign in to comment.