From e6c942a30df9aefadb5e25e49ece634b80db4926 Mon Sep 17 00:00:00 2001 From: Roman Roelofsen Date: Thu, 4 Mar 2010 22:53:05 +0100 Subject: [PATCH 01/23] Added OSGi proof of concept Very basic example Starting point to kick of discussions --- akka-core/pom.xml | 16 ++ akka-osgi/akka-dependencies-bundle/pom.xml | 56 +++++ akka-osgi/akka-sample-osgi/pom.xml | 49 +++++ .../src/main/scala/Activator.scala | 36 +++ .../src/main/scala/Actors.scala | 18 ++ akka-osgi/deployer/pom.xml | 54 +++++ .../akka/osgi/deployer/Activator.java | 43 ++++ .../akka/osgi/deployer/DirWatcher.java | 207 ++++++++++++++++++ akka-osgi/karaf/pom.xml | 127 +++++++++++ akka-osgi/karaf/src/main/assembly/runtime.xml | 37 ++++ akka-osgi/pom.xml | 45 ++++ 11 files changed, 688 insertions(+) create mode 100644 akka-osgi/akka-dependencies-bundle/pom.xml create mode 100644 akka-osgi/akka-sample-osgi/pom.xml create mode 100644 akka-osgi/akka-sample-osgi/src/main/scala/Activator.scala create mode 100644 akka-osgi/akka-sample-osgi/src/main/scala/Actors.scala create mode 100644 akka-osgi/deployer/pom.xml create mode 100644 akka-osgi/deployer/src/main/java/se/scalablesolutions/akka/osgi/deployer/Activator.java create mode 100644 akka-osgi/deployer/src/main/java/se/scalablesolutions/akka/osgi/deployer/DirWatcher.java create mode 100644 akka-osgi/karaf/pom.xml create mode 100644 akka-osgi/karaf/src/main/assembly/runtime.xml create mode 100644 akka-osgi/pom.xml diff --git a/akka-core/pom.xml b/akka-core/pom.xml index d6ca57ebfe..b9753200c8 100644 --- a/akka-core/pom.xml +++ b/akka-core/pom.xml @@ -108,4 +108,20 @@ test + + + + + org.apache.felix + maven-bundle-plugin + + + + se.scalablesolutions.akka.*;version=${project.version};-split-package:=merge-first + + + + + + diff --git a/akka-osgi/akka-dependencies-bundle/pom.xml b/akka-osgi/akka-dependencies-bundle/pom.xml new file mode 100644 index 0000000000..74d1792be4 --- /dev/null +++ b/akka-osgi/akka-dependencies-bundle/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + + + se.scalablesolutions.akka + akka-osgi-parent + 0.7-SNAPSHOT + + + akka-dependencies-bundle + Akka Dependencies Bundle + + + + akka-kernel + se.scalablesolutions.akka + ${project.version} + + + + + + + org.apache.felix + maven-bundle-plugin + + + + *;resolution:=optional + + + + !test.*, + + + !scala.*, + !org.apache.commons.io.*, + !org.codehaus.jackson.*, + !org.codehaus.jettison.*, + !org.jboss.netty.*, + + + !se.scalablesolutions.akka.*, + + + *;-split-package:=merge-first + + + + + + + + diff --git a/akka-osgi/akka-sample-osgi/pom.xml b/akka-osgi/akka-sample-osgi/pom.xml new file mode 100644 index 0000000000..bd48ca2392 --- /dev/null +++ b/akka-osgi/akka-sample-osgi/pom.xml @@ -0,0 +1,49 @@ + + 4.0.0 + + akka-sample-osgi + Akka OSGi Sample Module + + jar + + + akka-osgi-parent + se.scalablesolutions.akka + 0.7-SNAPSHOT + + + + + akka-core + se.scalablesolutions.akka + ${project.version} + + + org.osgi + org.osgi.core + + + org.osgi + org.osgi.compendium + + + + + + + org.apache.felix + maven-bundle-plugin + + + se.scalablesolutions.akka.osgi.sample.Activator + + se.scalablesolutions.akka.osgi.sample + + + + + + + + diff --git a/akka-osgi/akka-sample-osgi/src/main/scala/Activator.scala b/akka-osgi/akka-sample-osgi/src/main/scala/Activator.scala new file mode 100644 index 0000000000..7925a2705f --- /dev/null +++ b/akka-osgi/akka-sample-osgi/src/main/scala/Activator.scala @@ -0,0 +1,36 @@ + +package se.scalablesolutions.akka.osgi.sample + +import org.osgi.framework.{BundleContext, BundleActivator} +import se.scalablesolutions.akka.config.ScalaConfig._ +import se.scalablesolutions.akka.actor.{Supervisor, SupervisorFactory} + +class Activator extends BundleActivator { + + var supervisor: Supervisor = _ + + val ping = new Ping + + def start(context: BundleContext) { + println("Starting Akka OSGi sample") + + supervisor = SupervisorFactory( + SupervisorConfig( + RestartStrategy(OneForOne, 3, 100, List(classOf[Exception])), + Supervise(ping, LifeCycle(Permanent)) :: Nil)).newInstance + + supervisor.start + println("Supervisor: " + supervisor) + + println("Sending ping") + ping send CounterMessage(0) + + } + + def stop(context: BundleContext) { + println("Stopping Akka OSGi sample") + + supervisor.stop + } + +} \ No newline at end of file diff --git a/akka-osgi/akka-sample-osgi/src/main/scala/Actors.scala b/akka-osgi/akka-sample-osgi/src/main/scala/Actors.scala new file mode 100644 index 0000000000..008ea98ef1 --- /dev/null +++ b/akka-osgi/akka-sample-osgi/src/main/scala/Actors.scala @@ -0,0 +1,18 @@ + +package se.scalablesolutions.akka.osgi.sample + +import se.scalablesolutions.akka.actor.Actor + +case class CounterMessage(counter: Int) + +class Ping extends Actor { + def receive = { + case CounterMessage(i) => println("Got message " + i) + } +} + +class Pong extends Actor { + def receive = { + case _ => + } +} diff --git a/akka-osgi/deployer/pom.xml b/akka-osgi/deployer/pom.xml new file mode 100644 index 0000000000..e94aa441f3 --- /dev/null +++ b/akka-osgi/deployer/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + + + se.scalablesolutions.akka + akka-osgi-parent + 0.7-SNAPSHOT + + + akka-deployer + Akka Deployer + + + + org.osgi + org.osgi.core + + + org.osgi + org.osgi.compendium + + + + + src/main/java + src/test/java + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.5 + 1.5 + + **/* + + + + + org.apache.felix + maven-bundle-plugin + + + se.scalablesolutions.akka.osgi.deployer.Activator + se.scalablesolutions.akka.osgi.deployer.* + + + + + + + diff --git a/akka-osgi/deployer/src/main/java/se/scalablesolutions/akka/osgi/deployer/Activator.java b/akka-osgi/deployer/src/main/java/se/scalablesolutions/akka/osgi/deployer/Activator.java new file mode 100644 index 0000000000..8cc1dca792 --- /dev/null +++ b/akka-osgi/deployer/src/main/java/se/scalablesolutions/akka/osgi/deployer/Activator.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2010 Roman Roelofsen + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package se.scalablesolutions.akka.osgi.deployer; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + + private static final String DIRINSTALLER_POLL = "dirinstaller.poll"; + private static final String DIRINSTALLER_DIR = "dirinstaller.dir"; + + private DirWatcher watcher; + + public void start(BundleContext context) throws Exception { + String bundlesDir = context.getProperty(DIRINSTALLER_DIR); + bundlesDir = bundlesDir == null ? "akka" : bundlesDir; + + String intervalStr = context.getProperty(DIRINSTALLER_POLL); + Integer interval = intervalStr == null ? 2000 : Integer.valueOf(intervalStr); + + watcher = new DirWatcher(context, bundlesDir, interval); + watcher.startWatching(); + } + + public void stop(BundleContext context) throws Exception { + watcher.stopWatching(); + } + +} diff --git a/akka-osgi/deployer/src/main/java/se/scalablesolutions/akka/osgi/deployer/DirWatcher.java b/akka-osgi/deployer/src/main/java/se/scalablesolutions/akka/osgi/deployer/DirWatcher.java new file mode 100644 index 0000000000..37d65e4c53 --- /dev/null +++ b/akka-osgi/deployer/src/main/java/se/scalablesolutions/akka/osgi/deployer/DirWatcher.java @@ -0,0 +1,207 @@ +/* + * Copyright (C) 2010 Roman Roelofsen + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package se.scalablesolutions.akka.osgi.deployer; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.BundleException; +import org.osgi.service.packageadmin.PackageAdmin; +import org.osgi.util.tracker.ServiceTracker; + +public class DirWatcher { + + private Thread thread; + + private ServiceTracker packageAdminTracker; + + private final BundleContext context; + private final String bundlesDir; + private final int interval; + + private final Map timestamps = new HashMap(); + private boolean modifiedSinceLastRun = false; + + private boolean warningMissingLoadDirPresented = false; + + public DirWatcher(BundleContext context, String bundlesDir, int interval) { + this.packageAdminTracker = new ServiceTracker(context, PackageAdmin.class.getName(), null); + this.packageAdminTracker.open(); + + this.context = context; + this.bundlesDir = bundlesDir; + this.interval = interval; + } + + public void startWatching() { + thread = new Thread() { + @Override + public void run() { + try { + while (!Thread.interrupted()) { + modifiedSinceLastRun = false; + List found = new ArrayList(); + getAllFiles(found, bundlesDir); + analyseNewState(found); + Thread.sleep(interval); + } + } catch (InterruptedException e) { + } + } + }; + thread.start(); + } + + public void stopWatching() { + thread.interrupt(); + } + + private void getAllFiles(List found, String dirName) { + File dir = new File(dirName); + File[] files = dir.listFiles(); + if (files == null) { + if (!warningMissingLoadDirPresented) { + System.out.println("DirInstaller WARNING: Directory '" + dirName + "' does not exist!"); + warningMissingLoadDirPresented = true; + } + return; + } + + for (File f : files) { + try { + if (f.isFile()) + if (f.getName().endsWith(".cfg")) { + found.add(0, f); + } else { + found.add(f); + } + else + getAllFiles(found, f.getCanonicalPath()); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + private void analyseNewState(List found) { + // check for new or updated bundles + for (File file : found) { + try { + String string = file.getCanonicalPath(); + Long time = timestamps.get(string); + + // time == null: system startup + // time < lastModified: updated file + if (time == null || time < file.lastModified()) { + timestamps.put(string, file.lastModified()); + modifiedSinceLastRun = true; + + if (string.endsWith(".jar")) + installOrUpdateBundle(string, time == null); + } + } catch (IOException e) { + System.out.println("DirInstaller: Problems accessing file " + file.getName()); + e.printStackTrace(); + } catch (BundleException e) { + System.out.println("DirInstaller: Problems installing or updating bundle. File: " + + file.getName()); + e.printStackTrace(); + } + } + + // check removed bundles + Iterator it = timestamps.keySet().iterator(); + while (it.hasNext()) { + String s = it.next(); + try { + if (!containsFilename(s, found)) { + for (Bundle b : context.getBundles()) { + if (b.getLocation().equals("file:" + s)) { + System.out.println("Removing bundle '" + b.getSymbolicName() + "'"); + b.uninstall(); + modifiedSinceLastRun = true; + } + } + it.remove(); + timestamps.remove(s); + } + } catch (BundleException e) { + System.out.println("DirInstaller: Problems uninstalling bundle: " + s); + } catch (IOException e) { + System.out.println("DirInstaller: Problems processing file: " + e); + } + } + + if (modifiedSinceLastRun) + startAllAndRefresh(); + } + + private boolean containsFilename(String string, List fileList) throws IOException { + for (File f : fileList) { + if (f.getCanonicalPath().equals(string)) + return true; + } + return false; + } + + private void startAllAndRefresh() { + for (Bundle b : context.getBundles()) { + try { + if (b.getState() != Bundle.ACTIVE && !isFragment(b)) { + b.start(); + } + } catch (BundleException e) { + System.out.println("Problems starting bundle: " + b); + e.printStackTrace(); + } + } + PackageAdmin admin = (PackageAdmin) this.packageAdminTracker.getService(); + System.out.println("DirInstaller: Refreshing packages"); + admin.refreshPackages(null); + } + + private boolean isFragment(Bundle b) { + PackageAdmin admin = (PackageAdmin) this.packageAdminTracker.getService(); + return admin.getBundleType(b) == PackageAdmin.BUNDLE_TYPE_FRAGMENT; + } + + private void installOrUpdateBundle(String s, boolean startup) throws BundleException { + // Check if bundle is already installed + // Perform bundle update in this case + for (Bundle b : context.getBundles()) { + if (b.getLocation().endsWith(s)) { + if (startup) // Don't update bundles on startup + return; + + System.out.println("DirInstaller: Updating bundle [" + b.getSymbolicName() + "]"); + b.stop(); + b.update(); + return; + } + } + // If the bundle is not installed, perform bundle install + System.out.println("DirInstaller: Installing bundle [" + s + "]"); + context.installBundle("file:" + s); + } + +} diff --git a/akka-osgi/karaf/pom.xml b/akka-osgi/karaf/pom.xml new file mode 100644 index 0000000000..ffc9dc8697 --- /dev/null +++ b/akka-osgi/karaf/pom.xml @@ -0,0 +1,127 @@ + + + + 4.0.0 + + + akka-osgi-parent + se.scalablesolutions.akka + 0.7-SNAPSHOT + + + akka-karaf + Akka OSGi Karaf Distribution + pom + + + http://www.apache.org/dist/felix/apache-felix-karaf-1.2.0.tar.gz + apache-felix-karaf-1.2.0 + + + + + + akka-dependencies-bundle + se.scalablesolutions.akka + ${project.version} + + + + + scala-library + org.scala-lang-osgi + 2.7.7 + + + commons-io + commons-io + 1.4 + + + org.codehaus.jackson + jackson-core-asl + 1.2.1 + + + org.codehaus.jackson + jackson-mapper-asl + 1.2.1 + + + org.jboss.netty + netty + 3.2.0.ALPHA3 + + + + + akka-core + se.scalablesolutions.akka + ${project.version} + + + akka-deployer + se.scalablesolutions.akka + ${project.version} + + + akka-sample-osgi + se.scalablesolutions.akka + ${project.version} + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + generate-resources + generate-resources + + + + + + + + + run + + + + + + maven-assembly-plugin + + + src/main/assembly/runtime.xml + + + + + make-distribution-dir + package + + directory-single + + + + make-distribution-zip + package + + single + + + + + + + + diff --git a/akka-osgi/karaf/src/main/assembly/runtime.xml b/akka-osgi/karaf/src/main/assembly/runtime.xml new file mode 100644 index 0000000000..2fe4ef12cd --- /dev/null +++ b/akka-osgi/karaf/src/main/assembly/runtime.xml @@ -0,0 +1,37 @@ + + runtime + + zip + + false + + + src/main/resources/runtime + + + + target/generated/runtime + + + + + + + se.scalablesolutions.akka:akka-deployer + + ${karaf.root.dir}/akka + false + false + false + + + + se.scalablesolutions.akka:akka-deployer + + ${karaf.root.dir}/deploy + false + false + false + + + diff --git a/akka-osgi/pom.xml b/akka-osgi/pom.xml new file mode 100644 index 0000000000..9748335c9b --- /dev/null +++ b/akka-osgi/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + + se.scalablesolutions.akka + akka + 0.7-SNAPSHOT + + + akka-osgi-parent + Akka OSGi Parent + + pom + + + 4.2.0 + + + + deployer + akka-dependencies-bundle + akka-sample-osgi + karaf + + + + + + org.osgi + org.osgi.core + ${osgi.version} + provided + + + org.osgi + org.osgi.compendium + ${osgi.version} + provided + + + + + From c09d64abf9869686324b2d3ff2d041d159e0dfb3 Mon Sep 17 00:00:00 2001 From: Roman Roelofsen Date: Fri, 5 Mar 2010 11:51:23 +0100 Subject: [PATCH 02/23] added akka-osgi module to parent pom --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 3cfc2839a8..ea7edf729e 100644 --- a/pom.xml +++ b/pom.xml @@ -59,6 +59,7 @@ akka-security akka-patterns akka-kernel + akka-osgi akka-fun-test-java akka-samples From f12484b1b40e007e0243354e638c4c82a1bf27f1 Mon Sep 17 00:00:00 2001 From: Roman Roelofsen Date: Fri, 12 Mar 2010 12:28:53 +0100 Subject: [PATCH 03/23] rewriting deployer in scala ... work in progress! --- akka-osgi/deployer/pom.xml | 18 +- .../akka/osgi/deployer/Activator.java | 43 ---- .../akka/osgi/deployer/DirWatcher.java | 207 ------------------ .../deployer/src/main/scala/Activator.scala | 36 +++ .../deployer/src/main/scala/DirWatcher.scala | 112 ++++++++++ 5 files changed, 153 insertions(+), 263 deletions(-) delete mode 100644 akka-osgi/deployer/src/main/java/se/scalablesolutions/akka/osgi/deployer/Activator.java delete mode 100644 akka-osgi/deployer/src/main/java/se/scalablesolutions/akka/osgi/deployer/DirWatcher.java create mode 100644 akka-osgi/deployer/src/main/scala/Activator.scala create mode 100644 akka-osgi/deployer/src/main/scala/DirWatcher.scala diff --git a/akka-osgi/deployer/pom.xml b/akka-osgi/deployer/pom.xml index e94aa441f3..db35d10dc1 100644 --- a/akka-osgi/deployer/pom.xml +++ b/akka-osgi/deployer/pom.xml @@ -13,6 +13,11 @@ Akka Deployer + + org.scala-lang + scala-library + ${scala.version} + org.osgi org.osgi.core @@ -24,20 +29,7 @@ - src/main/java - src/test/java - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - **/* - - - org.apache.felix maven-bundle-plugin diff --git a/akka-osgi/deployer/src/main/java/se/scalablesolutions/akka/osgi/deployer/Activator.java b/akka-osgi/deployer/src/main/java/se/scalablesolutions/akka/osgi/deployer/Activator.java deleted file mode 100644 index 8cc1dca792..0000000000 --- a/akka-osgi/deployer/src/main/java/se/scalablesolutions/akka/osgi/deployer/Activator.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2010 Roman Roelofsen - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package se.scalablesolutions.akka.osgi.deployer; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - private static final String DIRINSTALLER_POLL = "dirinstaller.poll"; - private static final String DIRINSTALLER_DIR = "dirinstaller.dir"; - - private DirWatcher watcher; - - public void start(BundleContext context) throws Exception { - String bundlesDir = context.getProperty(DIRINSTALLER_DIR); - bundlesDir = bundlesDir == null ? "akka" : bundlesDir; - - String intervalStr = context.getProperty(DIRINSTALLER_POLL); - Integer interval = intervalStr == null ? 2000 : Integer.valueOf(intervalStr); - - watcher = new DirWatcher(context, bundlesDir, interval); - watcher.startWatching(); - } - - public void stop(BundleContext context) throws Exception { - watcher.stopWatching(); - } - -} diff --git a/akka-osgi/deployer/src/main/java/se/scalablesolutions/akka/osgi/deployer/DirWatcher.java b/akka-osgi/deployer/src/main/java/se/scalablesolutions/akka/osgi/deployer/DirWatcher.java deleted file mode 100644 index 37d65e4c53..0000000000 --- a/akka-osgi/deployer/src/main/java/se/scalablesolutions/akka/osgi/deployer/DirWatcher.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (C) 2010 Roman Roelofsen - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package se.scalablesolutions.akka.osgi.deployer; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.BundleException; -import org.osgi.service.packageadmin.PackageAdmin; -import org.osgi.util.tracker.ServiceTracker; - -public class DirWatcher { - - private Thread thread; - - private ServiceTracker packageAdminTracker; - - private final BundleContext context; - private final String bundlesDir; - private final int interval; - - private final Map timestamps = new HashMap(); - private boolean modifiedSinceLastRun = false; - - private boolean warningMissingLoadDirPresented = false; - - public DirWatcher(BundleContext context, String bundlesDir, int interval) { - this.packageAdminTracker = new ServiceTracker(context, PackageAdmin.class.getName(), null); - this.packageAdminTracker.open(); - - this.context = context; - this.bundlesDir = bundlesDir; - this.interval = interval; - } - - public void startWatching() { - thread = new Thread() { - @Override - public void run() { - try { - while (!Thread.interrupted()) { - modifiedSinceLastRun = false; - List found = new ArrayList(); - getAllFiles(found, bundlesDir); - analyseNewState(found); - Thread.sleep(interval); - } - } catch (InterruptedException e) { - } - } - }; - thread.start(); - } - - public void stopWatching() { - thread.interrupt(); - } - - private void getAllFiles(List found, String dirName) { - File dir = new File(dirName); - File[] files = dir.listFiles(); - if (files == null) { - if (!warningMissingLoadDirPresented) { - System.out.println("DirInstaller WARNING: Directory '" + dirName + "' does not exist!"); - warningMissingLoadDirPresented = true; - } - return; - } - - for (File f : files) { - try { - if (f.isFile()) - if (f.getName().endsWith(".cfg")) { - found.add(0, f); - } else { - found.add(f); - } - else - getAllFiles(found, f.getCanonicalPath()); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - private void analyseNewState(List found) { - // check for new or updated bundles - for (File file : found) { - try { - String string = file.getCanonicalPath(); - Long time = timestamps.get(string); - - // time == null: system startup - // time < lastModified: updated file - if (time == null || time < file.lastModified()) { - timestamps.put(string, file.lastModified()); - modifiedSinceLastRun = true; - - if (string.endsWith(".jar")) - installOrUpdateBundle(string, time == null); - } - } catch (IOException e) { - System.out.println("DirInstaller: Problems accessing file " + file.getName()); - e.printStackTrace(); - } catch (BundleException e) { - System.out.println("DirInstaller: Problems installing or updating bundle. File: " - + file.getName()); - e.printStackTrace(); - } - } - - // check removed bundles - Iterator it = timestamps.keySet().iterator(); - while (it.hasNext()) { - String s = it.next(); - try { - if (!containsFilename(s, found)) { - for (Bundle b : context.getBundles()) { - if (b.getLocation().equals("file:" + s)) { - System.out.println("Removing bundle '" + b.getSymbolicName() + "'"); - b.uninstall(); - modifiedSinceLastRun = true; - } - } - it.remove(); - timestamps.remove(s); - } - } catch (BundleException e) { - System.out.println("DirInstaller: Problems uninstalling bundle: " + s); - } catch (IOException e) { - System.out.println("DirInstaller: Problems processing file: " + e); - } - } - - if (modifiedSinceLastRun) - startAllAndRefresh(); - } - - private boolean containsFilename(String string, List fileList) throws IOException { - for (File f : fileList) { - if (f.getCanonicalPath().equals(string)) - return true; - } - return false; - } - - private void startAllAndRefresh() { - for (Bundle b : context.getBundles()) { - try { - if (b.getState() != Bundle.ACTIVE && !isFragment(b)) { - b.start(); - } - } catch (BundleException e) { - System.out.println("Problems starting bundle: " + b); - e.printStackTrace(); - } - } - PackageAdmin admin = (PackageAdmin) this.packageAdminTracker.getService(); - System.out.println("DirInstaller: Refreshing packages"); - admin.refreshPackages(null); - } - - private boolean isFragment(Bundle b) { - PackageAdmin admin = (PackageAdmin) this.packageAdminTracker.getService(); - return admin.getBundleType(b) == PackageAdmin.BUNDLE_TYPE_FRAGMENT; - } - - private void installOrUpdateBundle(String s, boolean startup) throws BundleException { - // Check if bundle is already installed - // Perform bundle update in this case - for (Bundle b : context.getBundles()) { - if (b.getLocation().endsWith(s)) { - if (startup) // Don't update bundles on startup - return; - - System.out.println("DirInstaller: Updating bundle [" + b.getSymbolicName() + "]"); - b.stop(); - b.update(); - return; - } - } - // If the bundle is not installed, perform bundle install - System.out.println("DirInstaller: Installing bundle [" + s + "]"); - context.installBundle("file:" + s); - } - -} diff --git a/akka-osgi/deployer/src/main/scala/Activator.scala b/akka-osgi/deployer/src/main/scala/Activator.scala new file mode 100644 index 0000000000..d12b63ba16 --- /dev/null +++ b/akka-osgi/deployer/src/main/scala/Activator.scala @@ -0,0 +1,36 @@ + +package se.scalablesolutions.akka.osgi.deployer + +import org.osgi.framework.{BundleContext, BundleActivator} +import java.io.File + +class Activator extends BundleActivator { + + private val AKKA_DEPLOYER_DIR = "akka.deployer.dir" + private val AKKA_DEPLOYER_POLL = "akka.deployer.poll" + + private var watcher: DirWatcher = _ + + def start(context: BundleContext) { + var bundlesDir = context.getProperty(AKKA_DEPLOYER_DIR) + bundlesDir = if (bundlesDir == null) "akka" else bundlesDir + + // check dir exists + if (new File(bundlesDir).listFiles == null) { + System.out.println("DirInstaller WARNING: Directory '" + bundlesDir + "' does not exist!") + return + } + + var interval = context.getProperty(AKKA_DEPLOYER_POLL) + interval = if (interval == null) "2000" else interval + + watcher = new DirWatcher(context, bundlesDir, interval.toInt) + watcher.startWatching + } + + def stop(context: BundleContext) { + if (watcher != null) + watcher.stopWatching + } + +} diff --git a/akka-osgi/deployer/src/main/scala/DirWatcher.scala b/akka-osgi/deployer/src/main/scala/DirWatcher.scala new file mode 100644 index 0000000000..4d4292604c --- /dev/null +++ b/akka-osgi/deployer/src/main/scala/DirWatcher.scala @@ -0,0 +1,112 @@ + +package se.scalablesolutions.akka.osgi.deployer + +import org.osgi.util.tracker.ServiceTracker +import java.io.File +import org.osgi.service.packageadmin.PackageAdmin +import org.osgi.framework.{Bundle, BundleContext} + +class DirWatcher(context: BundleContext, bundlesDir: String, interval: Int) { + + private var running = false + + private final var timestamps = Map[String, Long]() + + private val packageAdminTracker = new ServiceTracker(context, classOf[PackageAdmin].getName, null) + packageAdminTracker.open + + def startWatching { + if (running) return + running = true + new Thread { + override def run { + try { + while (running) { + val found = getAllFiles(bundlesDir) + analyseNewState(found) + Thread.sleep(interval) + } + } + catch { + case e: InterruptedException => + } + } + }.start() + } + + def stopWatching { + running = false + } + + private def getAllFiles(dirName: String): List[File] = { + val content = new File(dirName).listFiles + val files = content.filter(_.isFile).toList + val childs = content.filter(_.isDirectory).toList.flatMap(d => getAllFiles(d.getCanonicalPath)) + files ::: childs + } + + private def analyseNewState(found: List[File]) { + println("FOUND:" + found) + + // new or updated + val changed = found.filter(f => timestamps.getOrElse(f.getCanonicalPath, -1L) < f.lastModified) + changed.foreach {f => + val name = f.getCanonicalPath + timestamps += (name -> f.lastModified) + if (name.endsWith(".jar")) installOrUpdateBundle(name) + } + println("CHANGED:" + changed) + + // removed + val removed = timestamps.filter(f => !found.map(_.getCanonicalPath).contains(f._1)) + removed.foreach {f => + context.getBundles.filter(b => b.getLocation.equals("file:" + f._1)).foreach(_.uninstall) + timestamps -= f._1 + } + println("REMOVED:" + removed) + + if (changed.size + removed.size > 0) + startAllAndRefresh() + + println("") + } + + private def startAllAndRefresh() { + context.getBundles.filter(b => b.getState != Bundle.ACTIVE && !isFragment(b)).foreach {b => + try { + b.start + } catch { + case e: Exception => { + System.out.println("Problems starting bundle: " + b) + e.printStackTrace + } + } + } + + val admin = this.packageAdminTracker.getService.asInstanceOf[PackageAdmin] + System.out.println("DirInstaller: Refreshing packages") + admin.refreshPackages(null) + } + + + private def isFragment(b: Bundle): Boolean = { + var admin: PackageAdmin = this.packageAdminTracker.getService.asInstanceOf[PackageAdmin] + return admin.getBundleType(b) == PackageAdmin.BUNDLE_TYPE_FRAGMENT + } + + + private def installOrUpdateBundle(s: String) { + for (b <- context.getBundles) { + if (b.getLocation.endsWith(s)) { + System.out.println("DirInstaller: Updating bundle [" + b.getSymbolicName + "]") + b.stop + b.update + return + } + } + System.out.println("DirInstaller: Installing bundle [" + s + "]") + context.installBundle("file:" + s) + } + + +} \ No newline at end of file From c16c6ba7e103117638988d53e6a1d9bcbc92b56e Mon Sep 17 00:00:00 2001 From: Roman Roelofsen Date: Tue, 25 May 2010 15:19:06 +0200 Subject: [PATCH 04/23] changed karaf url --- akka-osgi/karaf/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/akka-osgi/karaf/pom.xml b/akka-osgi/karaf/pom.xml index ffc9dc8697..aaf297a82c 100644 --- a/akka-osgi/karaf/pom.xml +++ b/akka-osgi/karaf/pom.xml @@ -15,8 +15,8 @@ pom - http://www.apache.org/dist/felix/apache-felix-karaf-1.2.0.tar.gz - apache-felix-karaf-1.2.0 + http://www.apache.org/dist/felix/apache-felix-karaf-1.4.0.tar.gz + apache-felix-karaf-1.4.0 From 6911c7629c1757b23ea0fad9744c9b056bf47745 Mon Sep 17 00:00:00 2001 From: Andreas Kollegger Date: Sun, 6 Jun 2010 14:33:10 -0400 Subject: [PATCH 05/23] initial changes for OSGification: added bnd4sbt plugin, changed artifact naming to include _osgi --- project/build/AkkaProject.scala | 42 ++++++++++++++++++++------------ project/build/lib/bnd4sbt.jar | Bin 0 -> 8092 bytes project/plugins/Plugins.scala | 3 ++- 3 files changed, 29 insertions(+), 16 deletions(-) create mode 100644 project/build/lib/bnd4sbt.jar diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 4ad4858d09..3aa43b196d 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -10,6 +10,8 @@ import java.util.jar.Attributes import java.util.jar.Attributes.Name._ import java.io.File +import com.weiglewilczek.bnd4sbt._ + class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------ @@ -25,6 +27,8 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { lazy val deployPath = info.projectPath / "deploy" lazy val distPath = info.projectPath / "dist" + val artifactQualifier = buildScalaVersion + "_osgi" + override def compileOptions = super.compileOptions ++ Seq("-deprecation", "-Xmigration", @@ -36,7 +40,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { override def javaCompileOptions = JavaCompileOption("-Xlint:unchecked") :: super.javaCompileOptions.toList - def distName = "%s_%s-%s.zip".format(name, buildScalaVersion, version) + def distName = "%s_%s-%s.zip".format(name, artifactQualifier, version) lazy val dist = zipTask(allArtifacts, "dist", distName) dependsOn (`package`) describedAs("Zips up the distribution.") @@ -109,20 +113,20 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { override def manifestClassPath = Some(allArtifacts.getFiles .filter(_.getName.endsWith(".jar")) .filter(!_.getName.contains("scala-library")) - .map("lib_managed/scala_%s/compile/".format(buildScalaVersion) + _.getName) + .map("lib_managed/scala_%s/compile/".format(artifactQualifier) + _.getName) .mkString(" ") + " scala-library.jar" + - " dist/akka-core_%s-%s.jar".format(buildScalaVersion, version) + - " dist/akka-http_%s-%s.jar".format(buildScalaVersion, version) + - " dist/akka-camel_%s-%s.jar".format(buildScalaVersion, version) + - " dist/akka-amqp_%s-%s.jar".format(buildScalaVersion, version) + - " dist/akka-persistence-common_%s-%s.jar".format(buildScalaVersion, version) + - " dist/akka-persistence-redis_%s-%s.jar".format(buildScalaVersion, version) + - " dist/akka-persistence-mongo_%s-%s.jar".format(buildScalaVersion, version) + - " dist/akka-persistence-cassandra_%s-%s.jar".format(buildScalaVersion, version) + - " dist/akka-kernel_%s-%s.jar".format(buildScalaVersion, version) + - " dist/akka-spring_%s-%s.jar".format(buildScalaVersion, version) + - " dist/akka-jta_%s-%s.jar".format(buildScalaVersion, version) + " dist/akka-core_%s-%s.jar".format(artifactQualifier, version) + + " dist/akka-http_%s-%s.jar".format(artifactQualifier, version) + + " dist/akka-camel_%s-%s.jar".format(artifactQualifier, version) + + " dist/akka-amqp_%s-%s.jar".format(artifactQualifier, version) + + " dist/akka-persistence-common_%s-%s.jar".format(artifactQualifier, version) + + " dist/akka-persistence-redis_%s-%s.jar".format(artifactQualifier, version) + + " dist/akka-persistence-mongo_%s-%s.jar".format(artifactQualifier, version) + + " dist/akka-persistence-cassandra_%s-%s.jar".format(artifactQualifier, version) + + " dist/akka-kernel_%s-%s.jar".format(artifactQualifier, version) + + " dist/akka-spring_%s-%s.jar".format(artifactQualifier, version) + + " dist/akka-jta_%s-%s.jar".format(artifactQualifier, version) ) //Exclude slf4j1.5.11 from the classpath, it's conflicting... @@ -398,12 +402,14 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { } def akkaArtifacts = { - descendents(info.projectPath / "dist", "*" + buildScalaVersion + "-" + version + ".jar") + descendents(info.projectPath / "dist", "*" + artifactQualifier + "-" + version + ".jar") } // ------------------------------------------------------------ - class AkkaDefaultProject(info: ProjectInfo, val deployPath: Path) extends DefaultProject(info) with DeployProject + class AkkaDefaultProject(info: ProjectInfo, val deployPath: Path) extends DefaultProject(info) with DeployProject with OSGiProject + + trait DeployProject extends DefaultProject { // defines where the deployTask copies jars to @@ -424,4 +430,10 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { FileUtilities.copyFile(jar, toDir / jar.name, log) } else None } + + trait OSGiProject extends DefaultProject with BNDPlugin { + override def bndExportPackage = Set("*") + } + + } diff --git a/project/build/lib/bnd4sbt.jar b/project/build/lib/bnd4sbt.jar new file mode 100644 index 0000000000000000000000000000000000000000..5906b493003a67283602179ffdf24d15acdeb0b4 GIT binary patch literal 8092 zcmWIWW@Zs#;9%fj5Sn$=h5-qPFt9NAx`sIFdiuHP`#So0y1532==r++JH^28+4sz8 zA8%c~i@e^tTIbH3-yCFc#rVO~M^Bj;0=(HdHq|q|lV)IGkYr$B2!LA<5wRb|0v-ki zhSY)_-7-T1y^NCFoTE{Z#gBJvt>dd_T_=C(tybi_c_*Ko+cABL+p^nhPE1lhwb#Z; zB_(lIciWORVL{*bKeuLQU=1otU-iyeZrSlk4b7YD(i!jldmBBkQ$6(RE}eUG_sZ?F z5?)vrr`e02Kn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g{Cp-RSvyvd|)1<=Uk;_Vxbhyt%@( z;rYD0bA9hc%+H-)rDD77N>IS`evXalm;ZUh9q&@GE_6Q}7GH9v&Y&TB*W<7iyg3u{ z{6l-ofA8`8`!8n)$8qz6$A27tTTo>z+4?WH;NnuYDGrTF^ z4Qm%%IQTaH%Y5PDlE=pjpPc`{Z^doL@crl8y3!_F*UQ!P{JCiVFFw?1(JGzAyWDN0 zwJYR((?2V(c(D1e)6dK$C*PWTOnx(c!ZG<3=hPOzXXyKGdAj10NM5M(Ht9*~U;b~H z@~7;}%A`;3#jiK7JuCKVkL7{nRUFnG_BOjF7nE$4xb4-wy!&Q{%Z2INbV8e|^x7>> z3I{H`;_2_1!532NqFjC9`|{4~>DHTaA30Yq`oZRGuSrS4(1)?g8GcY#;?J3@i-485kJ4 Date: Sun, 6 Jun 2010 20:05:26 -0400 Subject: [PATCH 06/23] initial implementation of OSGiWrapperProject, applied to jgroups dependency to make it OSGi-friendly --- .../src/main/resources/features.xml | 7 +++ project/build/AkkaProject.scala | 51 +++++++++++++++++- project/plugins/.Plugins.scala.swp | Bin 12288 -> 0 bytes 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 akka-karaf/akka-features/src/main/resources/features.xml delete mode 100644 project/plugins/.Plugins.scala.swp diff --git a/akka-karaf/akka-features/src/main/resources/features.xml b/akka-karaf/akka-features/src/main/resources/features.xml new file mode 100644 index 0000000000..9176437f46 --- /dev/null +++ b/akka-karaf/akka-features/src/main/resources/features.xml @@ -0,0 +1,7 @@ + + + + mvn:se.scalablesolutions.akka.akka-wrap/jgroups-wrapper_2.8.0.RC3_osgi/2.9.0.GA + mvn:se.scalablesolutions.akka/akka-core_2.8.0.RC3_osgi/0.9 + + diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 47559ad865..2b96abb597 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -86,6 +86,9 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { // examples lazy val akka_samples = project("akka-samples", "akka-samples", new AkkaSamplesParentProject(_)) + // OSGi wrappers + lazy val akka_wrappers = project("akka-wrap", "akka-wrap", new AkkaWrappersParentProject(_)) + // ------------------------------------------------------------ // Run Akka microkernel using 'sbt run' + use for packaging executable JAR override def mainClass = Some("se.scalablesolutions.akka.kernel.Main") @@ -169,9 +172,28 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { " -Dpackaging=jar -DgeneratePom=true" command ! log } - None + None } dependsOn(dist) describedAs("Run mvn install for artifacts in dist.") + lazy val publishLocalMvnWrapped = runMvnInstallWrapped + def runMvnInstallWrapped = task { + for (absPath <- wrappedArtifacts.getPaths) { + val artifactRE = """.*/([^/]+)-([^-]+).jar""".r + val artifactRE(artifactId, artifactVersion) = absPath + val command = "mvn install:install-file" + + " -Dfile=" + absPath + + " -DgroupId=se.scalablesolutions.akka.akka-wrap" + + " -DartifactId=" + artifactId + + " -Dversion=" + artifactVersion + + " -Dpackaging=jar -DgeneratePom=true" + command ! log + } + None + } dependsOn(`package`) describedAs("Run mvn install for wrapped artifacts in akka-wrap.") + + + + // ------------------------------------------------------------ // subprojects class AkkaCoreProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { @@ -362,6 +384,23 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { new AkkaSampleRemoteProject(_), akka_kernel) } + + // ================= OSGi Wrappers ================== + class JgroupsWrapperProject(info: ProjectInfo) extends OSGiWrapperProject(info) { + override def wrappedVersion = "2.9.0.GA" + override def bndImportPackage = Set("org.testng.*;resolution:=optional", + "org.bouncycastle.jce.provider;resolution:=optional", + "bsh;resolution:=optional", + "*") + + val jgroups = "jgroups" % "jgroups" % wrappedVersion % "compile" + } + + class AkkaWrappersParentProject(info: ProjectInfo) extends ParentProject(info) { + lazy val jgroups_wrapper = project("jgroups-wrapper", "jgroups-wrapper", + new JgroupsWrapperProject(_)) + } + // ------------------------------------------------------------ // helper functions def removeDupEntries(paths: PathFinder) = @@ -390,6 +429,8 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { def akkaArtifacts = descendents(info.projectPath / "dist", "*" + buildScalaVersion + "_osgi-" + version + ".jar") + def wrappedArtifacts = descendents(info.projectPath / "akka-wrap", "*" + buildScalaVersion + "_osgi-" + "*.jar") + // ------------------------------------------------------------ class AkkaDefaultProject(info: ProjectInfo, val deployPath: Path) extends DefaultProject(info) with DeployProject with OSGiProject @@ -419,5 +460,13 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { } + abstract class OSGiWrapperProject(info: ProjectInfo) extends DefaultProject(info) with BNDPlugin { + def wrappedVersion:String + override def version = OpaqueVersion(wrappedVersion) + override def artifactID = moduleID + "_osgi" + override def bndEmbedDependencies = true + override def bndExportPackage = Set("*") + } + } diff --git a/project/plugins/.Plugins.scala.swp b/project/plugins/.Plugins.scala.swp deleted file mode 100644 index 39709506fa92639a4034a394fdcff22edf268002..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmYc?2=nw+FxN9;U|?VnU|?{5&Fv#s_Kdkeijg5PJ3l8UH9bAG2qcLcyCs&CRO3s$Q}1xG_*Gz5@CptK}S*MgV9*vQa8SxHerSSS=( zc9cCD0;3@?8UmvsFd71*Aut*OqaiRF0;3@?0z#mqfRW)p0|NsS0|Nsm0|Nsi6psL} zk9u)51V%$(Gz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E0qOb8^VFffSoF);Y^LFWHK zV*sD|85lnCGcau6XJAO=XJC-!XJEL-$H36d$G{K>RV&BGz#zuQz`)7Jz`z00J7Pj? z)T5&zFd71*Aut*OqaiRF0;3@?8UmvsFd71*Auz;4pq9Z70u+oal3*MdZ3hxGHAzV{ zPqR!iGq$uyOR-EeO*A$)u`n<*F*Zz0GO;u_H8nM>Wl&HkOUzM7%1bdRPAXBbRZvRK z&($kW%}mcpEzitJu1d{TQczV;f+_&B4fITu6ciZr^&xsQQ&JOQ8q+gNGD?&5atl&( zO7ink^T6thlS*_!igY3C!NFn%dWO2eevSdb9{wRpaHEP+3-UomxqIjqB&MepD}V%) z6cS4mlrl<63as??;U?=rtxC?%)z3{VOU=_)g8HSnASE>z;+N85y^_@AjJ(X`#GIT; zJ&+98b`V1s Date: Mon, 7 Jun 2010 15:59:47 +0200 Subject: [PATCH 07/23] Removed Maven projects and added bnd4sbt --- akka-osgi/akka-dependencies-bundle/pom.xml | 56 -------- akka-osgi/akka-sample-osgi/pom.xml | 49 ------- .../src/main/scala/Activator.scala | 36 ----- .../src/main/scala/Actors.scala | 18 --- akka-osgi/deployer/pom.xml | 46 ------- .../deployer/src/main/scala/Activator.scala | 36 ----- .../deployer/src/main/scala/DirWatcher.scala | 112 --------------- akka-osgi/karaf/pom.xml | 127 ------------------ akka-osgi/karaf/src/main/assembly/runtime.xml | 37 ----- akka-osgi/pom.xml | 45 ------- project/build/AkkaProject.scala | 26 ++++ project/plugins/Plugins.scala | 4 +- 12 files changed, 29 insertions(+), 563 deletions(-) delete mode 100644 akka-osgi/akka-dependencies-bundle/pom.xml delete mode 100644 akka-osgi/akka-sample-osgi/pom.xml delete mode 100644 akka-osgi/akka-sample-osgi/src/main/scala/Activator.scala delete mode 100644 akka-osgi/akka-sample-osgi/src/main/scala/Actors.scala delete mode 100644 akka-osgi/deployer/pom.xml delete mode 100644 akka-osgi/deployer/src/main/scala/Activator.scala delete mode 100644 akka-osgi/deployer/src/main/scala/DirWatcher.scala delete mode 100644 akka-osgi/karaf/pom.xml delete mode 100644 akka-osgi/karaf/src/main/assembly/runtime.xml delete mode 100644 akka-osgi/pom.xml diff --git a/akka-osgi/akka-dependencies-bundle/pom.xml b/akka-osgi/akka-dependencies-bundle/pom.xml deleted file mode 100644 index 74d1792be4..0000000000 --- a/akka-osgi/akka-dependencies-bundle/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - 4.0.0 - - - se.scalablesolutions.akka - akka-osgi-parent - 0.7-SNAPSHOT - - - akka-dependencies-bundle - Akka Dependencies Bundle - - - - akka-kernel - se.scalablesolutions.akka - ${project.version} - - - - - - - org.apache.felix - maven-bundle-plugin - - - - *;resolution:=optional - - - - !test.*, - - - !scala.*, - !org.apache.commons.io.*, - !org.codehaus.jackson.*, - !org.codehaus.jettison.*, - !org.jboss.netty.*, - - - !se.scalablesolutions.akka.*, - - - *;-split-package:=merge-first - - - - - - - - diff --git a/akka-osgi/akka-sample-osgi/pom.xml b/akka-osgi/akka-sample-osgi/pom.xml deleted file mode 100644 index bd48ca2392..0000000000 --- a/akka-osgi/akka-sample-osgi/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - 4.0.0 - - akka-sample-osgi - Akka OSGi Sample Module - - jar - - - akka-osgi-parent - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - - - akka-core - se.scalablesolutions.akka - ${project.version} - - - org.osgi - org.osgi.core - - - org.osgi - org.osgi.compendium - - - - - - - org.apache.felix - maven-bundle-plugin - - - se.scalablesolutions.akka.osgi.sample.Activator - - se.scalablesolutions.akka.osgi.sample - - - - - - - - diff --git a/akka-osgi/akka-sample-osgi/src/main/scala/Activator.scala b/akka-osgi/akka-sample-osgi/src/main/scala/Activator.scala deleted file mode 100644 index 7925a2705f..0000000000 --- a/akka-osgi/akka-sample-osgi/src/main/scala/Activator.scala +++ /dev/null @@ -1,36 +0,0 @@ - -package se.scalablesolutions.akka.osgi.sample - -import org.osgi.framework.{BundleContext, BundleActivator} -import se.scalablesolutions.akka.config.ScalaConfig._ -import se.scalablesolutions.akka.actor.{Supervisor, SupervisorFactory} - -class Activator extends BundleActivator { - - var supervisor: Supervisor = _ - - val ping = new Ping - - def start(context: BundleContext) { - println("Starting Akka OSGi sample") - - supervisor = SupervisorFactory( - SupervisorConfig( - RestartStrategy(OneForOne, 3, 100, List(classOf[Exception])), - Supervise(ping, LifeCycle(Permanent)) :: Nil)).newInstance - - supervisor.start - println("Supervisor: " + supervisor) - - println("Sending ping") - ping send CounterMessage(0) - - } - - def stop(context: BundleContext) { - println("Stopping Akka OSGi sample") - - supervisor.stop - } - -} \ No newline at end of file diff --git a/akka-osgi/akka-sample-osgi/src/main/scala/Actors.scala b/akka-osgi/akka-sample-osgi/src/main/scala/Actors.scala deleted file mode 100644 index 008ea98ef1..0000000000 --- a/akka-osgi/akka-sample-osgi/src/main/scala/Actors.scala +++ /dev/null @@ -1,18 +0,0 @@ - -package se.scalablesolutions.akka.osgi.sample - -import se.scalablesolutions.akka.actor.Actor - -case class CounterMessage(counter: Int) - -class Ping extends Actor { - def receive = { - case CounterMessage(i) => println("Got message " + i) - } -} - -class Pong extends Actor { - def receive = { - case _ => - } -} diff --git a/akka-osgi/deployer/pom.xml b/akka-osgi/deployer/pom.xml deleted file mode 100644 index db35d10dc1..0000000000 --- a/akka-osgi/deployer/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - 4.0.0 - - - se.scalablesolutions.akka - akka-osgi-parent - 0.7-SNAPSHOT - - - akka-deployer - Akka Deployer - - - - org.scala-lang - scala-library - ${scala.version} - - - org.osgi - org.osgi.core - - - org.osgi - org.osgi.compendium - - - - - - - org.apache.felix - maven-bundle-plugin - - - se.scalablesolutions.akka.osgi.deployer.Activator - se.scalablesolutions.akka.osgi.deployer.* - - - - - - - diff --git a/akka-osgi/deployer/src/main/scala/Activator.scala b/akka-osgi/deployer/src/main/scala/Activator.scala deleted file mode 100644 index d12b63ba16..0000000000 --- a/akka-osgi/deployer/src/main/scala/Activator.scala +++ /dev/null @@ -1,36 +0,0 @@ - -package se.scalablesolutions.akka.osgi.deployer - -import org.osgi.framework.{BundleContext, BundleActivator} -import java.io.File - -class Activator extends BundleActivator { - - private val AKKA_DEPLOYER_DIR = "akka.deployer.dir" - private val AKKA_DEPLOYER_POLL = "akka.deployer.poll" - - private var watcher: DirWatcher = _ - - def start(context: BundleContext) { - var bundlesDir = context.getProperty(AKKA_DEPLOYER_DIR) - bundlesDir = if (bundlesDir == null) "akka" else bundlesDir - - // check dir exists - if (new File(bundlesDir).listFiles == null) { - System.out.println("DirInstaller WARNING: Directory '" + bundlesDir + "' does not exist!") - return - } - - var interval = context.getProperty(AKKA_DEPLOYER_POLL) - interval = if (interval == null) "2000" else interval - - watcher = new DirWatcher(context, bundlesDir, interval.toInt) - watcher.startWatching - } - - def stop(context: BundleContext) { - if (watcher != null) - watcher.stopWatching - } - -} diff --git a/akka-osgi/deployer/src/main/scala/DirWatcher.scala b/akka-osgi/deployer/src/main/scala/DirWatcher.scala deleted file mode 100644 index 4d4292604c..0000000000 --- a/akka-osgi/deployer/src/main/scala/DirWatcher.scala +++ /dev/null @@ -1,112 +0,0 @@ - -package se.scalablesolutions.akka.osgi.deployer - -import org.osgi.util.tracker.ServiceTracker -import java.io.File -import org.osgi.service.packageadmin.PackageAdmin -import org.osgi.framework.{Bundle, BundleContext} - -class DirWatcher(context: BundleContext, bundlesDir: String, interval: Int) { - - private var running = false - - private final var timestamps = Map[String, Long]() - - private val packageAdminTracker = new ServiceTracker(context, classOf[PackageAdmin].getName, null) - packageAdminTracker.open - - def startWatching { - if (running) return - running = true - new Thread { - override def run { - try { - while (running) { - val found = getAllFiles(bundlesDir) - analyseNewState(found) - Thread.sleep(interval) - } - } - catch { - case e: InterruptedException => - } - } - }.start() - } - - def stopWatching { - running = false - } - - private def getAllFiles(dirName: String): List[File] = { - val content = new File(dirName).listFiles - val files = content.filter(_.isFile).toList - val childs = content.filter(_.isDirectory).toList.flatMap(d => getAllFiles(d.getCanonicalPath)) - files ::: childs - } - - private def analyseNewState(found: List[File]) { - println("FOUND:" + found) - - // new or updated - val changed = found.filter(f => timestamps.getOrElse(f.getCanonicalPath, -1L) < f.lastModified) - changed.foreach {f => - val name = f.getCanonicalPath - timestamps += (name -> f.lastModified) - if (name.endsWith(".jar")) installOrUpdateBundle(name) - } - println("CHANGED:" + changed) - - // removed - val removed = timestamps.filter(f => !found.map(_.getCanonicalPath).contains(f._1)) - removed.foreach {f => - context.getBundles.filter(b => b.getLocation.equals("file:" + f._1)).foreach(_.uninstall) - timestamps -= f._1 - } - println("REMOVED:" + removed) - - if (changed.size + removed.size > 0) - startAllAndRefresh() - - println("") - } - - private def startAllAndRefresh() { - context.getBundles.filter(b => b.getState != Bundle.ACTIVE && !isFragment(b)).foreach {b => - try { - b.start - } catch { - case e: Exception => { - System.out.println("Problems starting bundle: " + b) - e.printStackTrace - } - } - } - - val admin = this.packageAdminTracker.getService.asInstanceOf[PackageAdmin] - System.out.println("DirInstaller: Refreshing packages") - admin.refreshPackages(null) - } - - - private def isFragment(b: Bundle): Boolean = { - var admin: PackageAdmin = this.packageAdminTracker.getService.asInstanceOf[PackageAdmin] - return admin.getBundleType(b) == PackageAdmin.BUNDLE_TYPE_FRAGMENT - } - - - private def installOrUpdateBundle(s: String) { - for (b <- context.getBundles) { - if (b.getLocation.endsWith(s)) { - System.out.println("DirInstaller: Updating bundle [" + b.getSymbolicName + "]") - b.stop - b.update - return - } - } - System.out.println("DirInstaller: Installing bundle [" + s + "]") - context.installBundle("file:" + s) - } - - -} \ No newline at end of file diff --git a/akka-osgi/karaf/pom.xml b/akka-osgi/karaf/pom.xml deleted file mode 100644 index aaf297a82c..0000000000 --- a/akka-osgi/karaf/pom.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - 4.0.0 - - - akka-osgi-parent - se.scalablesolutions.akka - 0.7-SNAPSHOT - - - akka-karaf - Akka OSGi Karaf Distribution - pom - - - http://www.apache.org/dist/felix/apache-felix-karaf-1.4.0.tar.gz - apache-felix-karaf-1.4.0 - - - - - - akka-dependencies-bundle - se.scalablesolutions.akka - ${project.version} - - - - - scala-library - org.scala-lang-osgi - 2.7.7 - - - commons-io - commons-io - 1.4 - - - org.codehaus.jackson - jackson-core-asl - 1.2.1 - - - org.codehaus.jackson - jackson-mapper-asl - 1.2.1 - - - org.jboss.netty - netty - 3.2.0.ALPHA3 - - - - - akka-core - se.scalablesolutions.akka - ${project.version} - - - akka-deployer - se.scalablesolutions.akka - ${project.version} - - - akka-sample-osgi - se.scalablesolutions.akka - ${project.version} - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - generate-resources - generate-resources - - - - - - - - - run - - - - - - maven-assembly-plugin - - - src/main/assembly/runtime.xml - - - - - make-distribution-dir - package - - directory-single - - - - make-distribution-zip - package - - single - - - - - - - - diff --git a/akka-osgi/karaf/src/main/assembly/runtime.xml b/akka-osgi/karaf/src/main/assembly/runtime.xml deleted file mode 100644 index 2fe4ef12cd..0000000000 --- a/akka-osgi/karaf/src/main/assembly/runtime.xml +++ /dev/null @@ -1,37 +0,0 @@ - - runtime - - zip - - false - - - src/main/resources/runtime - - - - target/generated/runtime - - - - - - - se.scalablesolutions.akka:akka-deployer - - ${karaf.root.dir}/akka - false - false - false - - - - se.scalablesolutions.akka:akka-deployer - - ${karaf.root.dir}/deploy - false - false - false - - - diff --git a/akka-osgi/pom.xml b/akka-osgi/pom.xml deleted file mode 100644 index 9748335c9b..0000000000 --- a/akka-osgi/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - - se.scalablesolutions.akka - akka - 0.7-SNAPSHOT - - - akka-osgi-parent - Akka OSGi Parent - - pom - - - 4.2.0 - - - - deployer - akka-dependencies-bundle - akka-sample-osgi - karaf - - - - - - org.osgi - org.osgi.core - ${osgi.version} - provided - - - org.osgi - org.osgi.compendium - ${osgi.version} - provided - - - - - diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index a26396c8e8..d3491f6a3f 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -10,6 +10,8 @@ import java.util.jar.Attributes import java.util.jar.Attributes.Name._ import java.io.File +import com.weiglewilczek.bnd4sbt.BNDPlugin + class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------ @@ -65,6 +67,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { lazy val akka_jta = project("akka-jta", "akka-jta", new AkkaJTAProject(_), akka_core) lazy val akka_kernel = project("akka-kernel", "akka-kernel", new AkkaKernelProject(_), akka_core, akka_http, akka_spring, akka_camel, akka_persistence, akka_amqp) + lazy val akka_osgi = project("akka-osgi", "akka-osgi", new AkkaOSGiParentProject(_)) // functional tests in java lazy val akka_fun_test = project("akka-fun-test-java", "akka-fun-test-java", new AkkaFunTestProject(_), akka_kernel) @@ -273,6 +276,29 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { val jta_spec = "org.apache.geronimo.specs" % "geronimo-jta_1.1_spec" % "1.1.1" % "compile" } + // ================= OSGi Packaging ================== + class AkkaOSGiBundleProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with BNDPlugin { + override def bndClasspath = compileClasspath + override def bndPrivatePackage = Set("") + override def bndExportPackage = Set("se.scalablesolutions.akka.*;version=0.9") + } + + class AkkaOSGiAssemblyProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { + // FIXME: Find out how to replace mvn-assembly within SBT + + //override def packageAction = task { + //FileUtilities.copy(info.dependencies.map(_.outputPath), "XXX", true, true, log) + //None + //} dependsOn(compile) describedAs("Creates the OSGi distribution.") + } + + class AkkaOSGiParentProject(info: ProjectInfo) extends ParentProject(info) { + lazy val akka_osgi_bundle = project("akka-osgi-bundle", "akka-osgi-bundle", + new AkkaOSGiBundleProject(_), akka_kernel) + lazy val akka_osgi_assembly = project("akka-osgi-assembly", "akka-osgi-assembly", + new AkkaOSGiAssemblyProject(_), akka_osgi_bundle) + } + // ================= TEST ================== class AkkaFunTestProject(info: ProjectInfo) extends DefaultProject(info) { val jackson_core_asl = "org.codehaus.jackson" % "jackson-core-asl" % "1.2.1" % "compile" diff --git a/project/plugins/Plugins.scala b/project/plugins/Plugins.scala index f36c65ed13..895df56970 100644 --- a/project/plugins/Plugins.scala +++ b/project/plugins/Plugins.scala @@ -5,4 +5,6 @@ class Plugins(info: ProjectInfo) extends PluginDefinition(info) { val spdeSbt = "us.technically.spde" % "spde-sbt-plugin" % "0.4.1" // val repo = "GH-pages repo" at "http://mpeltonen.github.com/maven/" // val idea = "com.github.mpeltonen" % "sbt-idea-plugin" % "0.1-SNAPSHOT" -} \ No newline at end of file + + lazy val bnd4sbt = "com.weiglewilczek" % "bnd4sbt" % "0.4" +} From c7c54559662531524ae025630fe25ed9aecf18fc Mon Sep 17 00:00:00 2001 From: Roman Roelofsen Date: Mon, 7 Jun 2010 16:28:19 +0200 Subject: [PATCH 08/23] Added dependencies-bundle. --- project/build/AkkaProject.scala | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index c5dbec2f30..945cd2491f 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -302,6 +302,13 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { override def bndExportPackage = Set("se.scalablesolutions.akka.*;version=0.9") } + class AkkaOSGiDependenciesBundleProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with BNDPlugin { + override def bndClasspath = compileClasspath + override def bndPrivatePackage = Set("") + override def bndImportPackage = Set("*;resolution:=optional") + override def bndExportPackage = Set("!se.scalablesolutions.akka.*", "*") + } + class AkkaOSGiAssemblyProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { // FIXME: Find out how to replace mvn-assembly within SBT @@ -314,6 +321,8 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { class AkkaOSGiParentProject(info: ProjectInfo) extends ParentProject(info) { lazy val akka_osgi_bundle = project("akka-osgi-bundle", "akka-osgi-bundle", new AkkaOSGiBundleProject(_), akka_kernel) + lazy val akka_osgi_dependencies_bundle = project("akka-osgi-dependencies-bundle", "akka-osgi-dependencies-bundle", + new AkkaOSGiDependenciesBundleProject(_), akka_kernel) lazy val akka_osgi_assembly = project("akka-osgi-assembly", "akka-osgi-assembly", new AkkaOSGiAssemblyProject(_), akka_osgi_bundle) } From db2dd5735044f9eb18c3ec86d9888ec957bd2a8e Mon Sep 17 00:00:00 2001 From: Roman Roelofsen Date: Mon, 7 Jun 2010 16:46:49 +0200 Subject: [PATCH 09/23] Removed some dependencies since they will be provided by their own bundles --- project/build/AkkaProject.scala | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 945cd2491f..3b8bdf44da 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -306,7 +306,18 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { override def bndClasspath = compileClasspath override def bndPrivatePackage = Set("") override def bndImportPackage = Set("*;resolution:=optional") - override def bndExportPackage = Set("!se.scalablesolutions.akka.*", "*") + override def bndExportPackage = Set( + // Provided by Akka bundle + "!se.scalablesolutions.akka.*", + + // Provided by other bundles + "!org.apache.commons.io.*", + "!org.codehaus.jackson.*", + "!org.codehaus.jettison.*", + "!org.jboss.netty.*", + + // Export the rest + "*") } class AkkaOSGiAssemblyProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { From 1a4267612d0272962094b67e775b88eb8db1eba2 Mon Sep 17 00:00:00 2001 From: Roman Roelofsen Date: Mon, 7 Jun 2010 17:36:11 +0200 Subject: [PATCH 10/23] Work in progress! Trying to find an alternative to mvn assembly --- project/build/AkkaProject.scala | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 3b8bdf44da..706e0573ac 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -323,19 +323,24 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { class AkkaOSGiAssemblyProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { // FIXME: Find out how to replace mvn-assembly within SBT - //override def packageAction = task { - //FileUtilities.copy(info.dependencies.map(_.outputPath), "XXX", true, true, log) - //None - //} dependsOn(compile) describedAs("Creates the OSGi distribution.") + override def packageAction = task { + + println("----------------------------") + println("2" + unmanagedClasspath) + + + //FileUtilities.copy(info.dependencies.map(_.outputPath), "bundles", true, true, log) + None + } //dependsOn(compile) describedAs("Creates the OSGi distribution.") } class AkkaOSGiParentProject(info: ProjectInfo) extends ParentProject(info) { lazy val akka_osgi_bundle = project("akka-osgi-bundle", "akka-osgi-bundle", new AkkaOSGiBundleProject(_), akka_kernel) lazy val akka_osgi_dependencies_bundle = project("akka-osgi-dependencies-bundle", "akka-osgi-dependencies-bundle", - new AkkaOSGiDependenciesBundleProject(_), akka_kernel) + new AkkaOSGiDependenciesBundleProject(_), akka_osgi_bundle) lazy val akka_osgi_assembly = project("akka-osgi-assembly", "akka-osgi-assembly", - new AkkaOSGiAssemblyProject(_), akka_osgi_bundle) + new AkkaOSGiAssemblyProject(_), akka_osgi_bundle, akka_osgi_dependencies_bundle) } // ================= TEST ================== From 94b87cff58b52c51b94e0f293fe3eb32df2f301a Mon Sep 17 00:00:00 2001 From: Roman Roelofsen Date: Tue, 8 Jun 2010 10:36:41 +0200 Subject: [PATCH 11/23] Use more idiomatic way to add the assembly task --- project/build/AkkaProject.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 706e0573ac..98441a44e1 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -323,15 +323,17 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { class AkkaOSGiAssemblyProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { // FIXME: Find out how to replace mvn-assembly within SBT - override def packageAction = task { + lazy val assemblyAction = task { println("----------------------------") println("2" + unmanagedClasspath) - //FileUtilities.copy(info.dependencies.map(_.outputPath), "bundles", true, true, log) None - } //dependsOn(compile) describedAs("Creates the OSGi distribution.") + } + + override def packageAction = super.packageAction dependsOn(assemblyAction) + } class AkkaOSGiParentProject(info: ProjectInfo) extends ParentProject(info) { From f8240a24364486527040639a03e3142098fee0a6 Mon Sep 17 00:00:00 2001 From: Andreas Kollegger Date: Tue, 8 Jun 2010 22:57:55 -0400 Subject: [PATCH 12/23] pulled wrappers into AkkaWrapperProject trait file; sjson, objenesis, dispatch-json, netty ok; multiverse is next --- .../src/main/resources/features.xml | 15 ++++ project/build/AkkaProject.scala | 52 +----------- project/build/AkkaWrappersProject.scala | 81 +++++++++++++++++++ 3 files changed, 97 insertions(+), 51 deletions(-) create mode 100644 project/build/AkkaWrappersProject.scala diff --git a/akka-karaf/akka-features/src/main/resources/features.xml b/akka-karaf/akka-features/src/main/resources/features.xml index 9176437f46..7506820024 100644 --- a/akka-karaf/akka-features/src/main/resources/features.xml +++ b/akka-karaf/akka-features/src/main/resources/features.xml @@ -1,7 +1,22 @@ + + + mvn:com.weiglewilczek.scala-lang-osgi/scala-library/2.8.0.RC2 + mvn:org.eclipse.scalamodules/scalamodules-core/2.0-M2 + + + + + mvn:se.scalablesolutions.akka.akka-wrap/dispatch-json_2.8.0.RC3_osgi/0.7.4 + mvn:org.objenesis/objenesis/1.2 + mvn:sjson.json/sjson/0.6-SNAPSHOT + + + sjson mvn:se.scalablesolutions.akka.akka-wrap/jgroups-wrapper_2.8.0.RC3_osgi/2.9.0.GA + mvn:org.jboss.netty/netty/3.2.0.CR1 mvn:se.scalablesolutions.akka/akka-core_2.8.0.RC3_osgi/0.9 diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 2b96abb597..90e9a3124e 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -12,7 +12,7 @@ import java.io.File import com.weiglewilczek.bnd4sbt._ -class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { +class AkkaParent(info: ProjectInfo) extends DefaultProject(info) with AkkaWrappersProject { // ------------------------------------------------------------ // project versions @@ -86,9 +86,6 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { // examples lazy val akka_samples = project("akka-samples", "akka-samples", new AkkaSamplesParentProject(_)) - // OSGi wrappers - lazy val akka_wrappers = project("akka-wrap", "akka-wrap", new AkkaWrappersParentProject(_)) - // ------------------------------------------------------------ // Run Akka microkernel using 'sbt run' + use for packaging executable JAR override def mainClass = Some("se.scalablesolutions.akka.kernel.Main") @@ -175,25 +172,6 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { None } dependsOn(dist) describedAs("Run mvn install for artifacts in dist.") - lazy val publishLocalMvnWrapped = runMvnInstallWrapped - def runMvnInstallWrapped = task { - for (absPath <- wrappedArtifacts.getPaths) { - val artifactRE = """.*/([^/]+)-([^-]+).jar""".r - val artifactRE(artifactId, artifactVersion) = absPath - val command = "mvn install:install-file" + - " -Dfile=" + absPath + - " -DgroupId=se.scalablesolutions.akka.akka-wrap" + - " -DartifactId=" + artifactId + - " -Dversion=" + artifactVersion + - " -Dpackaging=jar -DgeneratePom=true" - command ! log - } - None - } dependsOn(`package`) describedAs("Run mvn install for wrapped artifacts in akka-wrap.") - - - - // ------------------------------------------------------------ // subprojects class AkkaCoreProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { @@ -384,23 +362,6 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { new AkkaSampleRemoteProject(_), akka_kernel) } - - // ================= OSGi Wrappers ================== - class JgroupsWrapperProject(info: ProjectInfo) extends OSGiWrapperProject(info) { - override def wrappedVersion = "2.9.0.GA" - override def bndImportPackage = Set("org.testng.*;resolution:=optional", - "org.bouncycastle.jce.provider;resolution:=optional", - "bsh;resolution:=optional", - "*") - - val jgroups = "jgroups" % "jgroups" % wrappedVersion % "compile" - } - - class AkkaWrappersParentProject(info: ProjectInfo) extends ParentProject(info) { - lazy val jgroups_wrapper = project("jgroups-wrapper", "jgroups-wrapper", - new JgroupsWrapperProject(_)) - } - // ------------------------------------------------------------ // helper functions def removeDupEntries(paths: PathFinder) = @@ -429,8 +390,6 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { def akkaArtifacts = descendents(info.projectPath / "dist", "*" + buildScalaVersion + "_osgi-" + version + ".jar") - def wrappedArtifacts = descendents(info.projectPath / "akka-wrap", "*" + buildScalaVersion + "_osgi-" + "*.jar") - // ------------------------------------------------------------ class AkkaDefaultProject(info: ProjectInfo, val deployPath: Path) extends DefaultProject(info) with DeployProject with OSGiProject @@ -460,13 +419,4 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { } - abstract class OSGiWrapperProject(info: ProjectInfo) extends DefaultProject(info) with BNDPlugin { - def wrappedVersion:String - override def version = OpaqueVersion(wrappedVersion) - override def artifactID = moduleID + "_osgi" - override def bndEmbedDependencies = true - override def bndExportPackage = Set("*") - } - - } diff --git a/project/build/AkkaWrappersProject.scala b/project/build/AkkaWrappersProject.scala new file mode 100644 index 0000000000..5826ee4d55 --- /dev/null +++ b/project/build/AkkaWrappersProject.scala @@ -0,0 +1,81 @@ + /*---------------------------------------------------------------------------\ +| Copyright (C) 2009-2010 Scalable Solutions AB | +\---------------------------------------------------------------------------*/ + +import sbt._ +import sbt.CompileOrder._ +import spde._ + +import java.util.jar.Attributes +import java.util.jar.Attributes.Name._ +import java.io.File + +import com.weiglewilczek.bnd4sbt._ + +trait AkkaWrappersProject extends DefaultProject { + + // ------------------------------------------------------------ + // project versions + val JERSEY_VERSION:String + val ATMO_VERSION:String + val CASSANDRA_VERSION:String + val LIFT_VERSION:String + val SCALATEST_VERSION:String + val MULTIVERSE_VERSION:String + + // OSGi wrappers + lazy val akka_wrappers = project("akka-wrap", "akka-wrap", new AkkaWrappersParentProject(_)) + + import Process._ + lazy val publishLocalMvnWrapped = runMvnInstallWrapped + def runMvnInstallWrapped = task { + for (absPath <- wrappedArtifacts.getPaths) { + val artifactRE = """.*/([^/]+)-([^-]+).jar""".r + val artifactRE(artifactId, artifactVersion) = absPath + val command = "mvn install:install-file" + + " -Dfile=" + absPath + + " -DgroupId=se.scalablesolutions.akka.akka-wrap" + + " -DartifactId=" + artifactId + + " -Dversion=" + artifactVersion + + " -Dpackaging=jar -DgeneratePom=true" + command ! log + } + None + } dependsOn(`package`) describedAs("Run mvn install for wrapped artifacts in akka-wrap.") + + // ================= OSGi Wrappers ================== + class JgroupsWrapperProject(info: ProjectInfo) extends OSGiWrapperProject(info) { + override def wrappedVersion = "2.9.0.GA" + override def bndImportPackage = Set("org.testng.*;resolution:=optional", + "org.bouncycastle.jce.provider;resolution:=optional", + "bsh;resolution:=optional", + "*") + + val jgroups = "jgroups" % "jgroups" % wrappedVersion % "compile" + } + + class DispatchJsonWrapperProject(info: ProjectInfo) extends OSGiWrapperProject(info) { + override def wrappedVersion = "0.7.4" + + val dispatch_json = "net.databinder" % "dispatch-json_2.8.0.RC3" % wrappedVersion % "compile" + } + + class AkkaWrappersParentProject(info: ProjectInfo) extends ParentProject(info) { + lazy val jgroups_wrapper = project("jgroups-wrapper", "jgroups-wrapper", + new JgroupsWrapperProject(_)) + lazy val dispath_json = project("dispatch-json", "dispatch-json", + new DispatchJsonWrapperProject(_)) + } + + def wrappedArtifacts = descendents(info.projectPath / "akka-wrap", "*" + buildScalaVersion + "_osgi-" + "*.jar") + + abstract class OSGiWrapperProject(info: ProjectInfo) extends DefaultProject(info) with BNDPlugin { + def wrappedVersion:String + override def version = OpaqueVersion(wrappedVersion) + override def artifactID = moduleID + "_osgi" + override def bndEmbedDependencies = true + override def bndExportPackage = Set("*") + } + + +} From a3baa7b95b1432b5306000c97764f4c325c19c27 Mon Sep 17 00:00:00 2001 From: Roman Roelofsen Date: Wed, 16 Jun 2010 00:50:52 +0200 Subject: [PATCH 13/23] Basic OSGi stuff working. Need to exclude transitive dependencies from the bundle list. --- project/build/AkkaProject.scala | 39 +++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 98441a44e1..6f5002d543 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -311,29 +311,46 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { "!se.scalablesolutions.akka.*", // Provided by other bundles + "!com.google.inject.*", + "!javax.transaction.*", + "!javax.ws.rs.*", + "!net.liftweb.common.*", + "!net.liftweb.util.*", + "!org.apache.camel.*", "!org.apache.commons.io.*", + "!org.apache.commons.pool.*", "!org.codehaus.jackson.*", - "!org.codehaus.jettison.*", "!org.jboss.netty.*", + "!org.springframework.*", // Export the rest "*") } - class AkkaOSGiAssemblyProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { - // FIXME: Find out how to replace mvn-assembly within SBT + class AkkaOSGiAssemblyProject(info: ProjectInfo) extends DefaultProject(info) { - lazy val assemblyAction = task { - - println("----------------------------") - println("2" + unmanagedClasspath) + // FIXME: Transitive dependencies should not be included, we should list every bundle individually - //FileUtilities.copy(info.dependencies.map(_.outputPath), "bundles", true, true, log) + val guicey = "org.guiceyfruit" % "guice-all" % "2.0" % "compile" + val commons_io = "commons-io" % "commons-io" % "1.4" % "compile" + val jta_1_1 = "org.apache.geronimo.specs" % "geronimo-jta_1.1_spec" % "1.1.1" % "compile" + val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" + val lift_common = "net.liftweb" % "lift-common" % LIFT_VERSION % "compile" + val lift_util = "net.liftweb" % "lift-util" % LIFT_VERSION % "compile" + val camel_core = "org.apache.camel" % "camel-core" % "2.3.0" % "compile" + val commons_pool = "commons-pool" % "commons-pool" % "1.5.4" % "compile" + val jackson = "org.codehaus.jackson" % "jackson-mapper-asl" % "1.2.1" % "compile" + val netty = "org.jboss.netty" % "netty" % "3.2.0.CR1" % "compile" + val spring_beans = "org.springframework" % "spring-beans" % "3.0.1.RELEASE" % "compile" + val spring_context = "org.springframework" % "spring-context" % "3.0.1.RELEASE" % "compile" + + override def packageAction = task { + val libs: Seq[Path] = managedClasspath(config("compile")).get.toSeq + val prjs: Seq[Path] = info.dependencies.toSeq.asInstanceOf[Seq[DefaultProject]].map(_.jarPath) + val all = libs ++ prjs + FileUtilities.copyFlat(all, outputPath / "bundles", log) None } - - override def packageAction = super.packageAction dependsOn(assemblyAction) - } class AkkaOSGiParentProject(info: ProjectInfo) extends ParentProject(info) { From 6410473bd93b66c956b2853bd4a6b28d9439b3de Mon Sep 17 00:00:00 2001 From: Roman Roelofsen Date: Wed, 16 Jun 2010 11:55:25 +0200 Subject: [PATCH 14/23] Updated bnd4sbt plugin --- project/plugins/Plugins.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins/Plugins.scala b/project/plugins/Plugins.scala index 895df56970..a133f55757 100644 --- a/project/plugins/Plugins.scala +++ b/project/plugins/Plugins.scala @@ -6,5 +6,5 @@ class Plugins(info: ProjectInfo) extends PluginDefinition(info) { // val repo = "GH-pages repo" at "http://mpeltonen.github.com/maven/" // val idea = "com.github.mpeltonen" % "sbt-idea-plugin" % "0.1-SNAPSHOT" - lazy val bnd4sbt = "com.weiglewilczek" % "bnd4sbt" % "0.4" + lazy val bnd4sbt = "com.weiglewilczek.bnd4sbt" % "bnd4sbt" % "1.0.0.RC1" } From 1936695a9f0ea43eddc45addafd34e66fb5b4afa Mon Sep 17 00:00:00 2001 From: Roman Roelofsen Date: Wed, 16 Jun 2010 11:55:57 +0200 Subject: [PATCH 15/23] Exclude transitive dependencies Ongoing work on finding the bundle list --- project/build/AkkaProject.scala | 50 ++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 3eba7ef4a5..3ddc872cc6 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -67,6 +67,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { val grizzlyModuleConfig = ModuleConfiguration("com.sun.grizzly", javaNetRepo) // val atmosphereModuleConfig = ModuleConfiguration("org.atmosphere", sonatypeSnapshotRepo) val liftModuleConfig = ModuleConfiguration("net.liftweb", ScalaToolsSnapshots) + val scalaBundleConfig = ModuleConfiguration("com.weiglewilczek.scala-lang-osgi", ScalaToolsReleases) // ------------------------------------------------------------ // project defintions @@ -308,42 +309,51 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { override def bndPrivatePackage = Set("") override def bndImportPackage = Set("*;resolution:=optional") override def bndExportPackage = Set( - // Provided by Akka bundle - "!se.scalablesolutions.akka.*", + "org.aopalliance.*;version=1.0.0", // Provided by other bundles + "!se.scalablesolutions.akka.*", "!com.google.inject.*", "!javax.transaction.*", "!javax.ws.rs.*", - "!net.liftweb.common.*", - "!net.liftweb.util.*", - "!org.apache.camel.*", "!org.apache.commons.io.*", "!org.apache.commons.pool.*", "!org.codehaus.jackson.*", "!org.jboss.netty.*", "!org.springframework.*", + "!org.apache.camel.*", + "!org.fusesource.commons.management.*", - // Export the rest - "*") + "*;version=0.0.0") } class AkkaOSGiAssemblyProject(info: ProjectInfo) extends DefaultProject(info) { - // FIXME: Transitive dependencies should not be included, we should list every bundle individually + // Scala bundle + val scala_bundle = "com.weiglewilczek.scala-lang-osgi" % "scala-library_2.8.0.RC3" % "1.0" % "compile" intransitive() - val guicey = "org.guiceyfruit" % "guice-all" % "2.0" % "compile" - val commons_io = "commons-io" % "commons-io" % "1.4" % "compile" - val jta_1_1 = "org.apache.geronimo.specs" % "geronimo-jta_1.1_spec" % "1.1.1" % "compile" - val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" - val lift_common = "net.liftweb" % "lift-common" % LIFT_VERSION % "compile" - val lift_util = "net.liftweb" % "lift-util" % LIFT_VERSION % "compile" - val camel_core = "org.apache.camel" % "camel-core" % "2.3.0" % "compile" - val commons_pool = "commons-pool" % "commons-pool" % "1.5.4" % "compile" - val jackson = "org.codehaus.jackson" % "jackson-mapper-asl" % "1.2.1" % "compile" - val netty = "org.jboss.netty" % "netty" % "3.2.0.CR1" % "compile" - val spring_beans = "org.springframework" % "spring-beans" % "3.0.1.RELEASE" % "compile" - val spring_context = "org.springframework" % "spring-context" % "3.0.1.RELEASE" % "compile" + // Camel bundles + val camel_core = "org.apache.camel" % "camel-core" % "2.3.0" % "compile" intransitive() + val fusesource_commonman = "org.fusesource.commonman" % "commons-management" % "1.0" intransitive() + + // Spring bundles + val spring_beans = "org.springframework" % "spring-beans" % "3.0.1.RELEASE" % "compile" intransitive() + val spring_context = "org.springframework" % "spring-context" % "3.0.1.RELEASE" % "compile" intransitive() + val spring_jms = "org.springframework" % "spring-jms" % "3.0.1.RELEASE" % "compile" intransitive() + val spring_aop = "org.springframework" % "spring-aop" % "3.0.1.RELEASE" % "compile" intransitive() + val spring_asm = "org.springframework" % "spring-asm" % "3.0.1.RELEASE" % "compile" intransitive() + val spring_core = "org.springframework" % "spring-core" % "3.0.1.RELEASE" % "compile" intransitive() + val spring_expression = "org.springframework" % "spring-expression" % "3.0.1.RELEASE" % "compile" intransitive() + val spring_tx = "org.springframework" % "spring-tx" % "3.0.1.RELEASE" % "compile" intransitive() + + val commons_io = "commons-io" % "commons-io" % "1.4" % "compile" intransitive() + val commons_pool = "commons-pool" % "commons-pool" % "1.5.4" % "compile" intransitive() + val jackson_core = "org.codehaus.jackson" % "jackson-core-asl" % "1.2.1" % "compile" intransitive() + val jackson = "org.codehaus.jackson" % "jackson-mapper-asl" % "1.2.1" % "compile" intransitive() + val netty = "org.jboss.netty" % "netty" % "3.2.0.CR1" % "compile" intransitive() + val guicey = "org.guiceyfruit" % "guice-all" % "2.0" % "compile" intransitive() + val jta_1_1 = "org.apache.geronimo.specs" % "geronimo-jta_1.1_spec" % "1.1.1" % "compile" intransitive() + val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" intransitive() override def packageAction = task { val libs: Seq[Path] = managedClasspath(config("compile")).get.toSeq From 36c830ccfc07f99a72249cb80b52c41491219ecd Mon Sep 17 00:00:00 2001 From: Roman Roelofsen Date: Thu, 17 Jun 2010 14:19:33 +0200 Subject: [PATCH 16/23] All bundles resolve! --- project/build/AkkaProject.scala | 42 +++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 3ddc872cc6..1c7170a078 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -300,22 +300,25 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { // ================= OSGi Packaging ================== class AkkaOSGiBundleProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with BNDPlugin { override def bndClasspath = compileClasspath - override def bndPrivatePackage = Set("") - override def bndExportPackage = Set("se.scalablesolutions.akka.*;version=0.9") + override def bndPrivatePackage = Seq("") + override def bndExportPackage = Seq("se.scalablesolutions.akka.*;version=0.9") } class AkkaOSGiDependenciesBundleProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with BNDPlugin { override def bndClasspath = compileClasspath - override def bndPrivatePackage = Set("") - override def bndImportPackage = Set("*;resolution:=optional") - override def bndExportPackage = Set( + override def bndPrivatePackage = Seq("") + override def bndImportPackage = Seq("*;resolution:=optional") + override def bndExportPackage = Seq( "org.aopalliance.*;version=1.0.0", // Provided by other bundles "!se.scalablesolutions.akka.*", + "!net.liftweb.*", "!com.google.inject.*", "!javax.transaction.*", "!javax.ws.rs.*", + "!javax.jms.*", + "!javax.transaction,*", "!org.apache.commons.io.*", "!org.apache.commons.pool.*", "!org.codehaus.jackson.*", @@ -332,27 +335,40 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { // Scala bundle val scala_bundle = "com.weiglewilczek.scala-lang-osgi" % "scala-library_2.8.0.RC3" % "1.0" % "compile" intransitive() + // Lift bundles + val lift_actor = "net.liftweb" % "lift-actor" % LIFT_VERSION % "compile" intransitive() + val lift_common = "net.liftweb" % "lift-common" % LIFT_VERSION % "compile" intransitive() + val lift_json = "net.liftweb" % "lift-json" % LIFT_VERSION % "compile" intransitive() + val lift_util = "net.liftweb" % "lift-util" % LIFT_VERSION % "compile" intransitive() + //val lift_webkit = "net.liftweb" % "lift-webkit" % LIFT_VERSION % "compile" intransitive() + //val lift_testkit = "net.liftweb" % "lift-testkit" % LIFT_VERSION % "compile" intransitive() + // Camel bundles val camel_core = "org.apache.camel" % "camel-core" % "2.3.0" % "compile" intransitive() val fusesource_commonman = "org.fusesource.commonman" % "commons-management" % "1.0" intransitive() // Spring bundles - val spring_beans = "org.springframework" % "spring-beans" % "3.0.1.RELEASE" % "compile" intransitive() - val spring_context = "org.springframework" % "spring-context" % "3.0.1.RELEASE" % "compile" intransitive() - val spring_jms = "org.springframework" % "spring-jms" % "3.0.1.RELEASE" % "compile" intransitive() - val spring_aop = "org.springframework" % "spring-aop" % "3.0.1.RELEASE" % "compile" intransitive() - val spring_asm = "org.springframework" % "spring-asm" % "3.0.1.RELEASE" % "compile" intransitive() - val spring_core = "org.springframework" % "spring-core" % "3.0.1.RELEASE" % "compile" intransitive() - val spring_expression = "org.springframework" % "spring-expression" % "3.0.1.RELEASE" % "compile" intransitive() - val spring_tx = "org.springframework" % "spring-tx" % "3.0.1.RELEASE" % "compile" intransitive() + val spring_beans = "org.springframework" % "spring-beans" % "3.0.2.RELEASE" % "compile" intransitive() + val spring_context = "org.springframework" % "spring-context" % "3.0.2.RELEASE" % "compile" intransitive() + val spring_jms = "org.springframework" % "spring-jms" % "3.0.2.RELEASE" % "compile" intransitive() + val spring_aop = "org.springframework" % "spring-aop" % "3.0.2.RELEASE" % "compile" intransitive() + val spring_asm = "org.springframework" % "spring-asm" % "3.0.2.RELEASE" % "compile" intransitive() + val spring_core = "org.springframework" % "spring-core" % "3.0.2.RELEASE" % "compile" intransitive() + val spring_expression = "org.springframework" % "spring-expression" % "3.0.2.RELEASE" % "compile" intransitive() + val spring_tx = "org.springframework" % "spring-tx" % "3.0.2.RELEASE" % "compile" intransitive() val commons_io = "commons-io" % "commons-io" % "1.4" % "compile" intransitive() val commons_pool = "commons-pool" % "commons-pool" % "1.5.4" % "compile" intransitive() + val commons_codec = "commons-codec" % "commons-codec" % "1.4" % "compile" intransitive() + val commons_fileupload = "commons-fileupload" % "commons-fileupload" % "1.2.1" % "compile" intransitive() val jackson_core = "org.codehaus.jackson" % "jackson-core-asl" % "1.2.1" % "compile" intransitive() val jackson = "org.codehaus.jackson" % "jackson-mapper-asl" % "1.2.1" % "compile" intransitive() val netty = "org.jboss.netty" % "netty" % "3.2.0.CR1" % "compile" intransitive() val guicey = "org.guiceyfruit" % "guice-all" % "2.0" % "compile" intransitive() + val joda = "joda-time" % "joda-time" % "1.6" intransitive() + val jta_1_1 = "org.apache.geronimo.specs" % "geronimo-jta_1.1_spec" % "1.1.1" % "compile" intransitive() + val jms_1_1 = "org.apache.geronimo.specs" % "geronimo-jms_1.1_spec" % "1.1.1" % "compile" intransitive() val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" intransitive() override def packageAction = task { From 8d6642f0d57d1b39d84d802b332baefdf5596453 Mon Sep 17 00:00:00 2001 From: Roman Roelofsen Date: Thu, 17 Jun 2010 15:10:39 +0200 Subject: [PATCH 17/23] Started work on OSGi sample --- .../src/main/scala/Activator.scala | 26 +++++++++++++++++++ .../src/main/scala/Actor.scala | 12 +++++++++ project/build/AkkaProject.scala | 12 +++++++++ 3 files changed, 50 insertions(+) create mode 100644 akka-samples/akka-sample-osgi/src/main/scala/Activator.scala create mode 100644 akka-samples/akka-sample-osgi/src/main/scala/Actor.scala diff --git a/akka-samples/akka-sample-osgi/src/main/scala/Activator.scala b/akka-samples/akka-sample-osgi/src/main/scala/Activator.scala new file mode 100644 index 0000000000..81e2d25d97 --- /dev/null +++ b/akka-samples/akka-sample-osgi/src/main/scala/Activator.scala @@ -0,0 +1,26 @@ +/** + * Copyright (C) 2009-2010 Scalable Solutions AB + */ + +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") + } + +} + diff --git a/akka-samples/akka-sample-osgi/src/main/scala/Actor.scala b/akka-samples/akka-sample-osgi/src/main/scala/Actor.scala new file mode 100644 index 0000000000..90bd521d7b --- /dev/null +++ b/akka-samples/akka-sample-osgi/src/main/scala/Actor.scala @@ -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) + } +} + diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 1c7170a078..3742089c55 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -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) } // ------------------------------------------------------------ From b0f12f2b9f9b83faf4019ef1ee4e027551e31aca Mon Sep 17 00:00:00 2001 From: Andreas Kollegger Date: Thu, 17 Jun 2010 12:12:42 -0400 Subject: [PATCH 18/23] synced with jboner/master; decoupled AkkaWrapperProject; bumped bnd4sbt to 1.0.0.RC2 --- project/build/AkkaProject.scala | 9 +++++---- project/build/AkkaWrappersProject.scala | 13 ++++++++++--- project/plugins/Plugins.scala | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 0745dcb08a..ca0da80ee3 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -12,7 +12,7 @@ import java.io.File import com.weiglewilczek.bnd4sbt._ -class AkkaParent(info: ProjectInfo) extends DefaultProject(info) with AkkaWrappersProject { +class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------ // project versions @@ -22,6 +22,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) with AkkaWrappe val LIFT_VERSION = "2.0-scala280-SNAPSHOT" val SCALATEST_VERSION = "1.2-for-scala-2.8.0.RC3-SNAPSHOT" val MULTIVERSE_VERSION = "0.5.2" + val COMMONS_CODEC_VERSION = "1.4" // ------------------------------------------------------------ lazy val deployPath = info.projectPath / "deploy" @@ -243,7 +244,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) with AkkaWrappe class AkkaRedisProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { val redis = "com.redis" % "redisclient" % "2.8.0.RC3-1.4-SNAPSHOT" % "compile" - val commons_codec = "commons-codec" % "commons-codec" % "1.4" % "compile" + val commons_codec = "commons-codec" % "commons-codec" % COMMONS_CODEC_VERSION % "compile" override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil } @@ -339,7 +340,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) with AkkaWrappe class AkkaSampleSecurityProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath) { val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1.1" % "compile" val jsr250 = "javax.annotation" % "jsr250-api" % "1.0" % "compile" - val commons_codec = "commons-codec" % "commons-codec" % "1.3" % "compile" + val commons_codec = "commons-codec" % "commons-codec" % COMMONS_CODEC_VERSION % "compile" } class AkkaSamplesParentProject(info: ProjectInfo) extends ParentProject(info) { @@ -416,7 +417,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) with AkkaWrappe trait OSGiProject extends DefaultProject with BNDPlugin { override def artifactID = moduleID + "_osgi" - override def bndExportPackage = Set("*") + override def bndExportPackage = Seq("se.scalablesolutions.akka.*;version=0.9") } diff --git a/project/build/AkkaWrappersProject.scala b/project/build/AkkaWrappersProject.scala index 5826ee4d55..f92e91d191 100644 --- a/project/build/AkkaWrappersProject.scala +++ b/project/build/AkkaWrappersProject.scala @@ -46,7 +46,7 @@ trait AkkaWrappersProject extends DefaultProject { // ================= OSGi Wrappers ================== class JgroupsWrapperProject(info: ProjectInfo) extends OSGiWrapperProject(info) { override def wrappedVersion = "2.9.0.GA" - override def bndImportPackage = Set("org.testng.*;resolution:=optional", + override def bndImportPackage = Seq("org.testng.*;resolution:=optional", "org.bouncycastle.jce.provider;resolution:=optional", "bsh;resolution:=optional", "*") @@ -60,11 +60,19 @@ trait AkkaWrappersProject extends DefaultProject { val dispatch_json = "net.databinder" % "dispatch-json_2.8.0.RC3" % wrappedVersion % "compile" } + class MultiverseWrapperProject(info: ProjectInfo) extends OSGiWrapperProject(info) { + override def wrappedVersion = "0.5.2" + + val multiverse = "org.multiverse" % "multiverse-alpha" % wrappedVersion % "compile" + } + class AkkaWrappersParentProject(info: ProjectInfo) extends ParentProject(info) { lazy val jgroups_wrapper = project("jgroups-wrapper", "jgroups-wrapper", new JgroupsWrapperProject(_)) lazy val dispath_json = project("dispatch-json", "dispatch-json", new DispatchJsonWrapperProject(_)) + lazy val multiverse_wrapper = project("multiverse-wrapper", "multiverse-wrapper", + new MultiverseWrapperProject(_)) } def wrappedArtifacts = descendents(info.projectPath / "akka-wrap", "*" + buildScalaVersion + "_osgi-" + "*.jar") @@ -73,8 +81,7 @@ trait AkkaWrappersProject extends DefaultProject { def wrappedVersion:String override def version = OpaqueVersion(wrappedVersion) override def artifactID = moduleID + "_osgi" - override def bndEmbedDependencies = true - override def bndExportPackage = Set("*") + override def bndExportPackage = Seq("*") } diff --git a/project/plugins/Plugins.scala b/project/plugins/Plugins.scala index 997b1e8e67..ac9ff64e25 100644 --- a/project/plugins/Plugins.scala +++ b/project/plugins/Plugins.scala @@ -5,5 +5,5 @@ class Plugins(info: ProjectInfo) extends PluginDefinition(info) { val spdeSbt = "us.technically.spde" % "spde-sbt-plugin" % "0.4.1" // val repo = "GH-pages repo" at "http://mpeltonen.github.com/maven/" // val idea = "com.github.mpeltonen" % "sbt-idea-plugin" % "0.1-SNAPSHOT" - val bnd4sbt = "com.weiglewilczek" % "bnd4sbt" % "0.4" + val bnd4sbt = "com.weiglewilczek.bnd4sbt" % "bnd4sbt" % "1.0.0.RC2" } From 03b90a16d4d6359fd7e751fc11d49a070a772dc9 Mon Sep 17 00:00:00 2001 From: Heiko Seeberger Date: Mon, 21 Jun 2010 18:40:15 +0200 Subject: [PATCH 19/23] OSGi work: Switched to bnd4sbt 1.0.0.RC3, using projectVersion for exported packages now and fixed a merge bug. --- project/build/AkkaProject.scala | 10 ++-------- project/plugins/Plugins.scala | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index d4f563f1d5..31bd9e9245 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -21,7 +21,6 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { val CASSANDRA_VERSION = "0.6.1" val LIFT_VERSION = "2.0-scala280-SNAPSHOT" val SCALATEST_VERSION = "1.2-for-scala-2.8.0.RC3-SNAPSHOT" - val MULTIVERSE_VERSION = "0.5.2" val COMMONS_CODEC_VERSION = "1.4" val MULTIVERSE_VERSION = "0.6-SNAPSHOT" @@ -69,12 +68,9 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { val grizzlyModuleConfig = ModuleConfiguration("com.sun.grizzly", javaNetRepo) // val atmosphereModuleConfig = ModuleConfiguration("org.atmosphere", sonatypeSnapshotRepo) val liftModuleConfig = ModuleConfiguration("net.liftweb", ScalaToolsSnapshots) -<<<<<<< HEAD - val scalaBundleConfig = ModuleConfiguration("com.weiglewilczek.scala-lang-osgi", ScalaToolsReleases) -======= +// val scalaBundleConfig = ModuleConfiguration("com.weiglewilczek.scala-lang-osgi", ScalaToolsReleases) def codehausSnapshotRepo = "Codehaus Snapshots" at "http://snapshots.repository.codehaus.org" val multiverseModuleConfig = ModuleConfiguration("org.multiverse", codehausSnapshotRepo) ->>>>>>> master // ------------------------------------------------------------ // project defintions @@ -528,8 +524,6 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { trait OSGiProject extends DefaultProject with BNDPlugin { override def artifactID = moduleID + "_osgi" - override def bndExportPackage = Seq("se.scalablesolutions.akka.*;version=0.9") - + override def bndExportPackage = Seq("se.scalablesolutions.akka.*;version=%s".format(projectVersion.value)) } - } diff --git a/project/plugins/Plugins.scala b/project/plugins/Plugins.scala index bee2aec2f2..1efcad620c 100644 --- a/project/plugins/Plugins.scala +++ b/project/plugins/Plugins.scala @@ -6,5 +6,5 @@ class Plugins(info: ProjectInfo) extends PluginDefinition(info) { // val repo = "GH-pages repo" at "http://mpeltonen.github.com/maven/" // val idea = "com.github.mpeltonen" % "sbt-idea-plugin" % "0.1-SNAPSHOT" - val bnd4sbt = "com.weiglewilczek.bnd4sbt" % "bnd4sbt" % "1.0.0.RC2" + val bnd4sbt = "com.weiglewilczek.bnd4sbt" % "bnd4sbt" % "1.0.0.RC3" } From b72b5b40f15a27dde66623f5e218a1def6f1d6ee Mon Sep 17 00:00:00 2001 From: Heiko Seeberger Date: Mon, 21 Jun 2010 22:02:15 +0200 Subject: [PATCH 20/23] OSGi work: Fixed packageAction for AkkaOSGiAssemblyProject (publish-local working now) and reverted to default artifactID (removed superfluous suffix '_osgi'). --- project/build/AkkaProject.scala | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 31bd9e9245..600f075a5f 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -370,12 +370,12 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { val jms_1_1 = "org.apache.geronimo.specs" % "geronimo-jms_1.1_spec" % "1.1.1" % "compile" intransitive() val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" intransitive() - override def packageAction = task { + override def packageAction = { val libs: Seq[Path] = managedClasspath(config("compile")).get.toSeq val prjs: Seq[Path] = info.dependencies.toSeq.asInstanceOf[Seq[DefaultProject]].map(_.jarPath) val all = libs ++ prjs FileUtilities.copyFlat(all, outputPath / "bundles", log) - None + super.packageAction } } @@ -523,7 +523,6 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { } trait OSGiProject extends DefaultProject with BNDPlugin { - override def artifactID = moduleID + "_osgi" override def bndExportPackage = Seq("se.scalablesolutions.akka.*;version=%s".format(projectVersion.value)) } } From 7dfe392264290295b066e28625fa48e3d2c808d9 Mon Sep 17 00:00:00 2001 From: Heiko Seeberger Date: Mon, 21 Jun 2010 23:29:09 +0200 Subject: [PATCH 21/23] OSGi work: Fixed plugin configuration => Added missing repo and module config for BND. --- project/plugins/Plugins.scala | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/project/plugins/Plugins.scala b/project/plugins/Plugins.scala index 1efcad620c..3abc87270f 100644 --- a/project/plugins/Plugins.scala +++ b/project/plugins/Plugins.scala @@ -1,10 +1,15 @@ import sbt._ class Plugins(info: ProjectInfo) extends PluginDefinition(info) { - val databinderRepo = "Databinder Repository" at "http://databinder.net/repo" - val spdeSbt = "us.technically.spde" % "spde-sbt-plugin" % "0.4.1" // val repo = "GH-pages repo" at "http://mpeltonen.github.com/maven/" // val idea = "com.github.mpeltonen" % "sbt-idea-plugin" % "0.1-SNAPSHOT" - val bnd4sbt = "com.weiglewilczek.bnd4sbt" % "bnd4sbt" % "1.0.0.RC3" + // Repositories: Using module configs to speed up resolution => Repos must be defs! + def aquteRepo = "aQute Maven Repository" at "http://www.aqute.biz/repo" + lazy val aquteModuleConfig = ModuleConfiguration("biz.aQute", aquteRepo) + def databinderRepo = "Databinder Repository" at "http://databinder.net/repo" + lazy val spdeModuleConfig = ModuleConfiguration("us.technically.spde", databinderRepo) + + val bnd4sbt = "com.weiglewilczek.bnd4sbt" % "bnd4sbt" % "1.0.0.RC3" + val spdeSbt = "us.technically.spde" % "spde-sbt-plugin" % "0.4.1" } From e24eb3897bbb19dcaaca5880d246aa90cc986f55 Mon Sep 17 00:00:00 2001 From: Roman Roelofsen Date: Mon, 28 Jun 2010 12:21:56 +0200 Subject: [PATCH 22/23] Removed pom.xml, not needed anymore --- pom.xml | 566 -------------------------------------------------------- 1 file changed, 566 deletions(-) delete mode 100644 pom.xml diff --git a/pom.xml b/pom.xml deleted file mode 100644 index ea7edf729e..0000000000 --- a/pom.xml +++ /dev/null @@ -1,566 +0,0 @@ - - - 4.0.0 - - Akka Project - akka - se.scalablesolutions.akka - 0.7-SNAPSHOT - 2009 - http://akkasource.org - pom - - - Akka implements a unique hybrid of: - * Actors , which gives you: - * Simple and high-level abstractions for concurrency and parallelism. - * Asynchronous, non-blocking and highly performant event-driven programming model. - * Very lightweight event-driven processes (create ~6.5 million actors on 4 G RAM). - * Supervision hierarchies with let-it-crash semantics. For writing highly fault-tolerant systems that never stop, systems that self-heal. - * Software Transactional Memory (STM). (Distributed transactions coming soon). - * Transactors: combine actors and STM into transactional actors. Allows you to compose atomic message flows with automatic rollback and retry. - * Remoting: highly performant distributed actors with remote supervision and error management. - * Cluster membership management. - - Akka also has a set of add-on modules: - * Persistence: A set of pluggable back-end storage modules that works in sync with the STM. - * Cassandra distributed and highly scalable database. - * MongoDB document database. - * Redis data structures database (upcoming) - * REST (JAX-RS): Expose actors as REST services. - * Comet: Expose actors as Comet services. - * Security: Digest and Kerberos based security. - * Microkernel: Run Akka as a stand-alone kernel. - - - - 2.7.7 - UTF-8 - 1.5 - ${maven.compiler.source} - ${project.build.sourceEncoding} - ${project.build.sourceEncoding} - 0.5.2 - 1.1.5 - 1.9.18-i - - - - akka-util-java - akka-util - akka-cluster - akka-core - akka-persistence - akka-rest - akka-comet - akka-amqp - akka-security - akka-patterns - akka-kernel - akka-osgi - akka-fun-test-java - akka-samples - - - - Scalable Solutions AB - http://scalablesolutions.se - - - - - The Apache License, ASL Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - - - - - - jboner - Jonas Bonér - +1 - jonas [REMOVE] AT jonasboner DOT com - - Founder - Hacker - Despot - - - - viktorklang - Viktor Klang - +1 - viktor.klang [REMOVE] AT gmail DOT com - - Apostle - - - - - - scm:git:git://github.com/jboner/akka.git - scm:git:git@github.com:jboner/akka.git - http://github.com/jboner/akka - - - - assembla - http://assembla.com/spaces/akka/ - - - - hudson - http://hudson.scala-tools.org/job/akka/ - - - - - - - - - User and Developer Discussion List - http://groups.google.com/group/akka-user - akka-user@googlegroups.com - akka-user+subscribe@googlegroups.com - akka-user+unsubscribe@googlegroups.com - - - - - - project.embedded.module - Project Embedded Repository - file://${env.AKKA_HOME}/embedded-repo - - - repo1.maven - Maven Main Repository - http://repo1.maven.org/maven2 - - - scala-tools-snapshots - Scala-Tools Maven2 Snapshot Repository - http://scala-tools.org/repo-snapshots - - - scala-tools - Scala-Tools Maven2 Repository - http://scala-tools.org/repo-releases - - - lag - Configgy's' Repository - http://www.lag.net/repo - - - multiverse-releases - http://multiverse.googlecode.com/svn/maven-repository/releases - - false - - - - multiverse-snaphosts - http://multiverse.googlecode.com/svn/maven-repository/snapshots - - - maven2-repository.dev.java.net - Java.net Repository for Maven - http://download.java.net/maven/2 - - - java.net - Java.net Legacy Repository for Maven - http://download.java.net/maven/1 - legacy - - - guiceyfruit.release - GuiceyFruit Release Repository - http://guiceyfruit.googlecode.com/svn/repo/releases/ - - false - - - true - - - - guiceyfruit.snapshot - GuiceyFruit Snapshot Repository - http://guiceyfruit.googlecode.com/svn/repo/snapshots/ - - true - - - false - - - - guice-maven - guice maven - http://guice-maven.googlecode.com/svn/trunk - - - google-maven-repository - Google Maven Repository - http://google-maven-repository.googlecode.com/svn/repository/ - - - repository.codehaus.org - Codehaus Maven Repository - http://repository.codehaus.org - - true - - - - repository.jboss.org - JBoss Repository for Maven - http://repository.jboss.org/maven2 - - false - - - - nexus.griddynamics.net - Grid Dynamics Maven Repository - https://nexus.griddynamics.net/nexus/content/groups/public - - false - - - - databinder.net/repo/ - dbDispatch Repository for Maven - http://databinder.net/repo - - false - - - - - - - onejar-maven-plugin.googlecode.com - http://onejar-maven-plugin.googlecode.com/svn/mavenrepo - - - scala-tools.org - Scala-Tools Maven2 Repository - http://scala-tools.org/repo-releases - - - - - src/main/scala - src/test/scala - - - org.apache.maven.plugins - maven-enforcer-plugin - 1.0-beta-1 - - - enforce-akka-home - - enforce - - - - - env.AKKA_HOME - "You must have set AKKA_HOME!" - - - - ${env.AKKA_HOME}/embedded-repo - - - - true - - - - enforce-java - - enforce - - - - - 1.6.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.4.2 - - - **/*Test.java - - - - **/InMemNestedStateTest.java - - - - akka.home - ${basedir}/.. - - - org.multiverse.api.exceptions.WriteConflictException.reuse - true - - - - - - org.mortbay.jetty - maven-jetty-plugin - - / - 5 - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.0.2 - - 1.5 - 1.5 - - - - org.scala-tools - maven-scala-plugin - 2.10.1 - - - - compile - testCompile - - - - - - -Xmx1024m - - - ${scala.version} - - - - true - maven-source-plugin - - - attach-sources - - jar - - - - - - org.apache.maven.plugins - maven-changes-plugin - 2.0 - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - ${project.version} - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 1.0-beta-1 - - - org.apache.felix - maven-bundle-plugin - 2.0.0 - true - - - J2SE-1.5 - <_versionpolicy>[$(@),$(version;=+;$(@))) - - - - - create-bundle - package - - bundle - - - - bundle-install - install - - install - - - - - - - - - - - org.codehaus.mojo - taglist-maven-plugin - 2.3 - - - FIXME - TODO - XXX - @fixme - @todo - @deprecated - - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.1.2 - - - - cim - dependencies - dependency-convergence - - index - issue-tracking - license - mailing-list - - plugins - project-team - scm - summary - - - - - - org.scala-tools - maven-scala-plugin - 2.12.2 - - ${project.build.sourceEncoding} - - 1.2-SNAPSHOT - ${scala.version} - - -Xmx1024m - -DpackageLinkDefs=file://${project.build.directory}/packageLinkDefs.properties - - - - - - - org.apache.maven.plugins - maven-changes-plugin - 2.1 - - - - changes-report - - - - - ${basedir}/changes.xml - - - - maven-surefire-report-plugin - - - - - report-only - - - - - - - - - release - - - scala-tools.org - http://nexus.scala-tools.org/content/repositories/releases - - - scala-tools.org - file://${user.home}/.m2/mvnsites/akka - - - - - hudson - - - hudson.scala-tools.org - file:///home/scala-tools.org/www/repo-snapshots - - - hudson.scala-tools.org - file:///home/scala-tools.org/www/repo-snapshots - false - - - hudson.scala-tools.org - file:///home/scala-tools.org/www/mvnsites-snapshots/akka - - - - - From 9f4045888d0a2a83f507ebf4613200eaf03bdae3 Mon Sep 17 00:00:00 2001 From: Heiko Seeberger Date: Tue, 20 Jul 2010 12:01:02 +0200 Subject: [PATCH 23/23] closes #31: Some fixes to the O-S-G-i settings in SBT project file; also deleted superfluous bnd4sbt.jar in project/build/lib directory. --- project/build/AkkaProject.scala | 151 +++++++++++++++++++------------- project/build/lib/bnd4sbt.jar | Bin 8092 -> 0 bytes 2 files changed, 91 insertions(+), 60 deletions(-) delete mode 100644 project/build/lib/bnd4sbt.jar diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index d1e125f07d..b24f477d75 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -16,6 +16,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------------------------------------------------------------- // Compile settings // ------------------------------------------------------------------------------------------------------------------- + override def compileOptions = super.compileOptions ++ Seq("-deprecation", "-Xmigration", @@ -29,6 +30,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------------------------------------------------------------- // Deploy/dist settings // ------------------------------------------------------------------------------------------------------------------- + lazy val deployPath = info.projectPath / "deploy" lazy val distPath = info.projectPath / "dist" def distName = "%s_%s-%s.zip".format(name, buildScalaVersion, version) @@ -37,6 +39,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------------------------------------------------------------- // All repositories *must* go here! See ModuleConigurations below. // ------------------------------------------------------------------------------------------------------------------- + object Repositories { lazy val AkkaRepo = MavenRepository("Akka Repository", "http://scalablesolutions.se/akka/repository") lazy val CodehausSnapshotRepo = MavenRepository("Codehaus Snapshots", "http://snapshots.repository.codehaus.org") @@ -54,6 +57,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { // must be resolved from a ModuleConfiguration. This will result in a significant acceleration of the update action. // Therefore, if repositories are defined, this must happen as def, not as val. // ------------------------------------------------------------------------------------------------------------------- + import Repositories._ lazy val atmosphereModuleConfig = ModuleConfiguration("org.atmosphere", SonatypeSnapshotRepo) lazy val grizzlyModuleConfig = ModuleConfiguration("com.sun.grizzly", JavaNetRepo) @@ -74,6 +78,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------------------------------------------------------------- // Versions // ------------------------------------------------------------------------------------------------------------------- + lazy val ATMO_VERSION = "0.6" lazy val CAMEL_VERSION = "2.4.0" lazy val CASSANDRA_VERSION = "0.6.1" @@ -90,6 +95,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------------------------------------------------- + object Dependencies { // Compile @@ -149,16 +155,16 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { lazy val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" - lazy val jta_1_1 = "org.apache.geronimo.specs" % "geronimo-jta_1.1_spec" % "1.1.1" % "compile" intransitive() + lazy val jta_1_1 = "org.apache.geronimo.specs" % "geronimo-jta_1.1_spec" % "1.1.1" % "compile" intransitive - lazy val lift = "net.liftweb" % "lift-webkit" % LIFT_VERSION % "compile" - lazy val lift_util = "net.liftweb" % "lift-util" % LIFT_VERSION % "compile" + lazy val lift_util = "net.liftweb" % "lift-util" % LIFT_VERSION % "compile" + lazy val lift_webkit = "net.liftweb" % "lift-webkit" % LIFT_VERSION % "compile" lazy val log4j = "log4j" % "log4j" % "1.2.15" % "compile" lazy val mongo = "org.mongodb" % "mongo-java-driver" % "1.4" % "compile" - lazy val multiverse = "org.multiverse" % "multiverse-alpha" % MULTIVERSE_VERSION % "compile" intransitive() + lazy val multiverse = "org.multiverse" % "multiverse-alpha" % MULTIVERSE_VERSION % "compile" intransitive lazy val netty = "org.jboss.netty" % "netty" % "3.2.1.Final" % "compile" @@ -203,6 +209,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------------------------------------------------------------- // Subprojects // ------------------------------------------------------------------------------------------------------------------- + lazy val akka_core = project("akka-core", "akka-core", new AkkaCoreProject(_)) lazy val akka_amqp = project("akka-amqp", "akka-amqp", new AkkaAMQPProject(_), akka_core) lazy val akka_http = project("akka-http", "akka-http", new AkkaHttpProject(_), akka_core, akka_camel) @@ -212,10 +219,13 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { lazy val akka_jta = project("akka-jta", "akka-jta", new AkkaJTAProject(_), akka_core) lazy val akka_kernel = project("akka-kernel", "akka-kernel", new AkkaKernelProject(_), akka_core, akka_http, akka_spring, akka_camel, akka_persistence, akka_amqp) + lazy val akka_osgi = project("akka-osgi", "akka-osgi", new AkkaOSGiParentProject(_)) lazy val akka_samples = project("akka-samples", "akka-samples", new AkkaSamplesParentProject(_)) - // ------------------------------------------------------------ - // Run Akka microkernel using 'sbt run' + use for packaging executable JAR + // ------------------------------------------------------------------------------------------------------------------- + // Miscellaneous + // ------------------------------------------------------------------------------------------------------------------- + override def mainClass = Some("se.scalablesolutions.akka.kernel.Main") override def packageOptions = @@ -303,6 +313,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------------------------------------------------------------- // akka-core subproject // ------------------------------------------------------------------------------------------------------------------- + class AkkaCoreProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with CodeFellowPlugin { val aopalliance = Dependencies.aopalliance val commons_codec = Dependencies.commons_codec @@ -333,6 +344,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------------------------------------------------------------- // akka-amqp subproject // ------------------------------------------------------------------------------------------------------------------- + class AkkaAMQPProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with CodeFellowPlugin { val commons_io = Dependencies.commons_io val rabbit = Dependencies.rabbit @@ -346,6 +358,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------------------------------------------------------------- // akka-http subproject // ------------------------------------------------------------------------------------------------------------------- + class AkkaHttpProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with CodeFellowPlugin { val annotation = Dependencies.annotation val atmo = Dependencies.atmo @@ -374,6 +387,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------------------------------------------------------------- // akka-camel subproject // ------------------------------------------------------------------------------------------------------------------- + class AkkaCamelProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with CodeFellowPlugin { val camel_core = Dependencies.camel_core } @@ -381,6 +395,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------------------------------------------------------------- // akka-persistence subproject // ------------------------------------------------------------------------------------------------------------------- + class AkkaPersistenceParentProject(info: ProjectInfo) extends ParentProject(info) { lazy val akka_persistence_common = project("akka-persistence-common", "akka-persistence-common", new AkkaPersistenceCommonProject(_), akka_core) @@ -403,6 +418,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------------------------------------------------------------- // akka-persistence-redis subproject // ------------------------------------------------------------------------------------------------------------------- + class AkkaRedisProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { val commons_codec = Dependencies.commons_codec val redis = Dependencies.redis @@ -413,6 +429,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------------------------------------------------------------- // akka-persistence-mongo subproject // ------------------------------------------------------------------------------------------------------------------- + class AkkaMongoProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { val mongo = Dependencies.mongo @@ -422,6 +439,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------------------------------------------------------------- // akka-persistence-cassandra subproject // ------------------------------------------------------------------------------------------------------------------- + class AkkaCassandraProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { val cassandra = Dependencies.cassandra val log4j = Dependencies.log4j @@ -440,11 +458,13 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------------------------------------------------------------- // akka-kernel subproject // ------------------------------------------------------------------------------------------------------------------- + class AkkaKernelProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) // ------------------------------------------------------------------------------------------------------------------- // akka-spring subproject // ------------------------------------------------------------------------------------------------------------------- + class AkkaSpringProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with CodeFellowPlugin { val spring_beans = Dependencies.spring_beans val spring_context = Dependencies.spring_context @@ -458,6 +478,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------------------------------------------------------------- // akka-jta subproject // ------------------------------------------------------------------------------------------------------------------- + class AkkaJTAProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with CodeFellowPlugin { val atomikos_transactions = Dependencies.atomikos_transactions val atomikos_transactions_api = Dependencies.atomikos_transactions_api @@ -466,7 +487,19 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { //val atomikos_transactions_util = "com.atomikos" % "transactions-util" % "3.2.3" % "compile" } - // ================= OSGi Packaging ================== + // ------------------------------------------------------------------------------------------------------------------- + // OSGi stuff + // ------------------------------------------------------------------------------------------------------------------- + + class AkkaOSGiParentProject(info: ProjectInfo) extends ParentProject(info) { + lazy val akka_osgi_dependencies_bundle = project("akka-osgi-dependencies-bundle", "akka-osgi-dependencies-bundle", + new AkkaOSGiDependenciesBundleProject(_), akka_kernel, akka_jta) // akka_kernel does not depend on akka_jta (why?) therefore we list akka_jta here + lazy val akka_osgi_assembly = project("akka-osgi-assembly", "akka-osgi-assembly", + new AkkaOSGiAssemblyProject(_), akka_osgi_dependencies_bundle, akka_core, akka_amqp, akka_http, + akka_camel, akka_spring, akka_jta, akka_persistence.akka_persistence_common, + akka_persistence.akka_persistence_redis, akka_persistence.akka_persistence_mongo, + akka_persistence.akka_persistence_cassandra) + } class AkkaOSGiDependenciesBundleProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with BNDPlugin { override def bndClasspath = compileClasspath @@ -497,73 +530,69 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { class AkkaOSGiAssemblyProject(info: ProjectInfo) extends DefaultProject(info) { // Scala bundle - val scala_bundle = "com.weiglewilczek.scala-lang-osgi" % "scala-library_2.8.0.RC3" % "1.0" % "compile" intransitive() + val scala_bundle = "com.weiglewilczek.scala-lang-osgi" % "scala-library" % buildScalaVersion % "compile" intransitive // Lift bundles - val lift_actor = "net.liftweb" % "lift-actor" % LIFT_VERSION % "compile" intransitive() - val lift_common = "net.liftweb" % "lift-common" % LIFT_VERSION % "compile" intransitive() - val lift_json = "net.liftweb" % "lift-json" % LIFT_VERSION % "compile" intransitive() - val lift_util = "net.liftweb" % "lift-util" % LIFT_VERSION % "compile" intransitive() - //val lift_webkit = "net.liftweb" % "lift-webkit" % LIFT_VERSION % "compile" intransitive() - //val lift_testkit = "net.liftweb" % "lift-testkit" % LIFT_VERSION % "compile" intransitive() +// val lift_util = Dependencies.lift_util.intransitive +// val lift_actor = "net.liftweb" % "lift-actor" % LIFT_VERSION % "compile" intransitive +// val lift_common = "net.liftweb" % "lift-common" % LIFT_VERSION % "compile" intransitive +// val lift_json = "net.liftweb" % "lift-json" % LIFT_VERSION % "compile" intransitive // Camel bundles - val camel_core = "org.apache.camel" % "camel-core" % "2.3.0" % "compile" intransitive() - val fusesource_commonman = "org.fusesource.commonman" % "commons-management" % "1.0" intransitive() + val camel_core = Dependencies.camel_core.intransitive + val fusesource_commonman = "org.fusesource.commonman" % "commons-management" % "1.0" intransitive // Spring bundles - val spring_beans = "org.springframework" % "spring-beans" % "3.0.2.RELEASE" % "compile" intransitive() - val spring_context = "org.springframework" % "spring-context" % "3.0.2.RELEASE" % "compile" intransitive() - val spring_jms = "org.springframework" % "spring-jms" % "3.0.2.RELEASE" % "compile" intransitive() - val spring_aop = "org.springframework" % "spring-aop" % "3.0.2.RELEASE" % "compile" intransitive() - val spring_asm = "org.springframework" % "spring-asm" % "3.0.2.RELEASE" % "compile" intransitive() - val spring_core = "org.springframework" % "spring-core" % "3.0.2.RELEASE" % "compile" intransitive() - val spring_expression = "org.springframework" % "spring-expression" % "3.0.2.RELEASE" % "compile" intransitive() - val spring_tx = "org.springframework" % "spring-tx" % "3.0.2.RELEASE" % "compile" intransitive() + val spring_beans = Dependencies.spring_beans.intransitive + val spring_context = Dependencies.spring_context.intransitive + val spring_aop = "org.springframework" % "spring-aop" % SPRING_VERSION % "compile" intransitive + val spring_asm = "org.springframework" % "spring-asm" % SPRING_VERSION % "compile" intransitive + val spring_core = "org.springframework" % "spring-core" % SPRING_VERSION % "compile" intransitive + val spring_expression = "org.springframework" % "spring-expression" % SPRING_VERSION % "compile" intransitive + val spring_jms = "org.springframework" % "spring-jms" % SPRING_VERSION % "compile" intransitive + val spring_tx = "org.springframework" % "spring-tx" % SPRING_VERSION % "compile" intransitive - val commons_io = "commons-io" % "commons-io" % "1.4" % "compile" intransitive() - val commons_pool = "commons-pool" % "commons-pool" % "1.5.4" % "compile" intransitive() - val commons_codec = "commons-codec" % "commons-codec" % "1.4" % "compile" intransitive() - val commons_fileupload = "commons-fileupload" % "commons-fileupload" % "1.2.1" % "compile" intransitive() - val jackson_core = "org.codehaus.jackson" % "jackson-core-asl" % "1.2.1" % "compile" intransitive() - val jackson = "org.codehaus.jackson" % "jackson-mapper-asl" % "1.2.1" % "compile" intransitive() - val netty = "org.jboss.netty" % "netty" % "3.2.0.CR1" % "compile" intransitive() - val guicey = "org.guiceyfruit" % "guice-all" % "2.0" % "compile" intransitive() - val joda = "joda-time" % "joda-time" % "1.6" intransitive() + val commons_codec = Dependencies.commons_codec.intransitive + val commons_io = Dependencies.commons_io.intransitive + val commons_pool = Dependencies.commons_pool.intransitive + val guicey = Dependencies.guicey.intransitive + val jackson = Dependencies.jackson.intransitive + val jackson_core = Dependencies.jackson_core.intransitive + val jsr311 = Dependencies.jsr311.intransitive + val jta_1_1 = Dependencies.jta_1_1.intransitive + val netty = Dependencies.netty.intransitive + val commons_fileupload = "commons-fileupload" % "commons-fileupload" % "1.2.1" % "compile" intransitive + val jms_1_1 = "org.apache.geronimo.specs" % "geronimo-jms_1.1_spec" % "1.1.1" % "compile" intransitive + val joda = "joda-time" % "joda-time" % "1.6" intransitive - val jta_1_1 = "org.apache.geronimo.specs" % "geronimo-jta_1.1_spec" % "1.1.1" % "compile" intransitive() - val jms_1_1 = "org.apache.geronimo.specs" % "geronimo-jms_1.1_spec" % "1.1.1" % "compile" intransitive() - val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" intransitive() + override def packageAction = + task { + val libs: Seq[Path] = managedClasspath(config("compile")).get.toSeq + val prjs: Seq[Path] = info.dependencies.toSeq.asInstanceOf[Seq[DefaultProject]] map { _.jarPath } + val all = libs ++ prjs + val destination = outputPath / "bundles" + FileUtilities.copyFlat(all, destination, log) + log info "Copied %s bundles to %s".format(all.size, destination) + None + } - override def packageAction = { - val libs: Seq[Path] = managedClasspath(config("compile")).get.toSeq - val prjs: Seq[Path] = info.dependencies.toSeq.asInstanceOf[Seq[DefaultProject]].map(_.jarPath) - val all = libs ++ prjs - FileUtilities.copyFlat(all, outputPath / "bundles", log) - super.packageAction - } + override def artifacts = Set.empty } - class AkkaOSGiParentProject(info: ProjectInfo) extends ParentProject(info) { - lazy val akka_osgi_dependencies_bundle = project("akka-osgi-dependencies-bundle", "akka-osgi-dependencies-bundle", - new AkkaOSGiDependenciesBundleProject(_), akka_kernel, - akka_jta // akka_kernel does not depend on akka_jta (why?) therefore we list akka_jta here - ) - lazy val akka_osgi_assembly = project("akka-osgi-assembly", "akka-osgi-assembly", - new AkkaOSGiAssemblyProject(_), akka_osgi_dependencies_bundle, akka_core, akka_amqp, akka_http, - akka_camel, akka_spring, akka_jta, akka_persistence.akka_persistence_common, - akka_persistence.akka_persistence_redis, akka_persistence.akka_persistence_mongo, - akka_persistence.akka_persistence_cassandra) - } + // ------------------------------------------------------------------------------------------------------------------- + // Test + // ------------------------------------------------------------------------------------------------------------------- - // ================= TEST ================== class AkkaActiveObjectTestProject(info: ProjectInfo) extends DefaultProject(info) { // testing val junit = "junit" % "junit" % "4.5" % "test" val jmock = "org.jmock" % "jmock" % "2.4.0" % "test" } - // ================= EXAMPLES ================== + // ------------------------------------------------------------------------------------------------------------------- + // Examples + // ------------------------------------------------------------------------------------------------------------------- + class AkkaSampleAntsProject(info: ProjectInfo) extends DefaultSpdeProject(info) with CodeFellowPlugin { // val scalaToolsSnapshots = ScalaToolsSnapshots override def spdeSourcePath = mainSourcePath / "spde" @@ -574,8 +603,8 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { class AkkaSampleLiftProject(info: ProjectInfo) extends DefaultWebProject(info) with DeployProject with CodeFellowPlugin { val commons_logging = Dependencies.commons_logging - val lift = Dependencies.lift val lift_util = Dependencies.lift_util + val lift_webkit = Dependencies.lift_webkit val servlet = Dependencies.servlet // testing @@ -649,8 +678,10 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { new AkkaSampleOSGiProject(_), akka_core) } - // ------------------------------------------------------------ - // helper functions + // ------------------------------------------------------------------------------------------------------------------- + // Helpers + // ------------------------------------------------------------------------------------------------------------------- + def removeDupEntries(paths: PathFinder) = Path.lazyPathFinder { val mapped = paths.get map { p => (p.relativePath, p) } @@ -675,7 +706,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { ) } - def akkaArtifacts = descendents(info.projectPath / "dist", "*" + buildScalaVersion + "_osgi-" + version + ".jar") + def akkaArtifacts = descendents(info.projectPath / "dist", "*" + buildScalaVersion + "-" + version + ".jar") // ------------------------------------------------------------ class AkkaDefaultProject(info: ProjectInfo, val deployPath: Path) extends DefaultProject(info) with DeployProject with OSGiProject diff --git a/project/build/lib/bnd4sbt.jar b/project/build/lib/bnd4sbt.jar deleted file mode 100644 index 5906b493003a67283602179ffdf24d15acdeb0b4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8092 zcmWIWW@Zs#;9%fj5Sn$=h5-qPFt9NAx`sIFdiuHP`#So0y1532==r++JH^28+4sz8 zA8%c~i@e^tTIbH3-yCFc#rVO~M^Bj;0=(HdHq|q|lV)IGkYr$B2!LA<5wRb|0v-ki zhSY)_-7-T1y^NCFoTE{Z#gBJvt>dd_T_=C(tybi_c_*Ko+cABL+p^nhPE1lhwb#Z; zB_(lIciWORVL{*bKeuLQU=1otU-iyeZrSlk4b7YD(i!jldmBBkQ$6(RE}eUG_sZ?F z5?)vrr`e02KnfHl%@cGdqV73w{D^XSv3 z%jJ(xpMJeN`{U2DLUTa{WwEI`S$7-OoYB)i{Bov6wE5X*uRaxRzs*~2&v*LO$0Ec1 zf84gjT~7P`-1YHWnPt9JZIgdGY>2w@-fu$X-_!d0XWWhGKI*mX#^lv*Tv0U(>+Zi= zUY`DVQ%1B_J9ue|=) z{P9dSE_?lmw|@TVSApW;kFI`T|Ml|fg+J9l5~i6JRW4L?{i?EA`+xiY!~3N_>MQyh2S!fpOueEUL)-s78h|GxOe z+vKmpyXTwvKVO{Nk@V|xa*1qQcl*my3-K)_g6G~R8SXyFuETMB@(VjY=GU)(=+8N} zu;S7@cx!^Y>3N2QJRqD%9EHbz1cQ zT5gu5XI#A3tYQ1d&zRuM8M#DBcXDpujY%c*JRB!qUmcRu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