Merge branch '341-hseeberger'
This commit is contained in:
commit
39337ddd89
4 changed files with 38 additions and 43 deletions
|
|
@ -1,24 +0,0 @@
|
|||
/**
|
||||
* Copyright (C) 2009-2010 Scalable Solutions AB <http://scalablesolutions.se>
|
||||
*/
|
||||
|
||||
package sample.osgi
|
||||
|
||||
import org.osgi.framework.{BundleActivator, BundleContext}
|
||||
|
||||
|
||||
class Activator extends BundleActivator {
|
||||
|
||||
def start(context: BundleContext) {
|
||||
println("Start")
|
||||
val osgiActor = new OSGiActor
|
||||
//osgiActor ! "Hello"
|
||||
Unit
|
||||
}
|
||||
|
||||
def stop(context: BundleContext) {
|
||||
println("stop")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
package sample.osgi
|
||||
|
||||
import se.scalablesolutions.akka.actor.Actor
|
||||
|
||||
|
||||
class OSGiActor extends Actor {
|
||||
def receive = {
|
||||
case msg: String =>
|
||||
println("Got message: " + msg)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
/**
|
||||
* Copyright (C) 2009-2010 Scalable Solutions AB <http://scalablesolutions.se>
|
||||
*/
|
||||
|
||||
package se.scalablesolutions.akka
|
||||
package sample.osgi
|
||||
|
||||
import actor.{ Actor, ActorRegistry }
|
||||
import actor.Actor._
|
||||
|
||||
import org.osgi.framework.{ BundleActivator, BundleContext }
|
||||
|
||||
class Activator extends BundleActivator {
|
||||
|
||||
def start(context: BundleContext) {
|
||||
println("Starting the OSGi example ...")
|
||||
val echo = actorOf[EchoActor].start
|
||||
val answer = (echo !! "OSGi example")
|
||||
println(answer getOrElse "No answer!")
|
||||
}
|
||||
|
||||
def stop(context: BundleContext) {
|
||||
ActorRegistry.shutdownAll()
|
||||
println("Stopped the OSGi example.")
|
||||
}
|
||||
}
|
||||
|
||||
class EchoActor extends Actor {
|
||||
|
||||
override def receive = {
|
||||
case x => self reply x
|
||||
}
|
||||
}
|
||||
|
|
@ -170,6 +170,8 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
|
|||
|
||||
lazy val protobuf = "com.google.protobuf" % "protobuf-java" % "2.3.0" % "compile"
|
||||
|
||||
lazy val osgi_core = "org.osgi" % "org.osgi.core" % "4.2.0"
|
||||
|
||||
lazy val rabbit = "com.rabbitmq" % "amqp-client" % "1.8.1" % "compile"
|
||||
|
||||
lazy val redis = "com.redis" % "redisclient" % "2.8.0-1.4" % "compile"
|
||||
|
|
@ -646,13 +648,9 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
|
|||
}
|
||||
|
||||
class AkkaSampleOSGiProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with BNDPlugin {
|
||||
override def bndClasspath = compileClasspath
|
||||
|
||||
val osgi_core = "org.osgi" % "org.osgi.core" % "4.2.0"
|
||||
|
||||
override def bndBundleActivator = Some("sample.osgi.Activator")
|
||||
override def bndPrivatePackage = Nil
|
||||
override def bndExportPackage = Seq("sample.osgi.*;version=0.9")
|
||||
val osgi_core = Dependencies.osgi_core
|
||||
override lazy val bndBundleActivator = Some("se.scalablesolutions.akka.sample.osgi.Activator")
|
||||
override lazy val bndExportPackage = Nil // Necessary because of mixing-in AkkaDefaultProject which exports all ...akka.* packages!
|
||||
}
|
||||
|
||||
class AkkaSamplesParentProject(info: ProjectInfo) extends ParentProject(info) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue