Started work on OSGi sample
This commit is contained in:
parent
c0361de80b
commit
157956eeeb
3 changed files with 50 additions and 0 deletions
26
akka-samples/akka-sample-osgi/src/main/scala/Activator.scala
Normal file
26
akka-samples/akka-sample-osgi/src/main/scala/Activator.scala
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
* 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"
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
def stop(context: BundleContext) {
|
||||
println("stop")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
12
akka-samples/akka-sample-osgi/src/main/scala/Actor.scala
Normal file
12
akka-samples/akka-sample-osgi/src/main/scala/Actor.scala
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
package sample.osgi
|
||||
|
||||
import se.scalablesolutions.akka.actor.Actor
|
||||
|
||||
|
||||
class OSGiActor extends Actor {
|
||||
def receive = {
|
||||
case msg: String =>
|
||||
println("Got message: " + msg)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -436,6 +436,16 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) {
|
|||
val commons_codec = "commons-codec" % "commons-codec" % "1.3" % "compile"
|
||||
}
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
class AkkaSamplesParentProject(info: ProjectInfo) extends ParentProject(info) {
|
||||
lazy val akka_sample_ants = project("akka-sample-ants", "akka-sample-ants",
|
||||
new AkkaSampleAntsProject(_), akka_core)
|
||||
|
|
@ -455,6 +465,8 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) {
|
|||
new AkkaSampleSecurityProject(_), akka_kernel)
|
||||
lazy val akka_sample_remote = project("akka-sample-remote", "akka-sample-remote",
|
||||
new AkkaSampleRemoteProject(_), akka_kernel)
|
||||
lazy val akka_sample_osgi = project("akka-sample-osgi", "akka-sample-osgi",
|
||||
new AkkaSampleOSGiProject(_), akka_core)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue