You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2011/09/23 15:59:10 UTC

svn commit: r1174771 - in /felix/sandbox/rickhall/ct-launcher: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/felix/ src/main/java/org/apache/felix/ct/ src/main/resources/ src/main/resources/META-...

Author: rickhall
Date: Fri Sep 23 13:59:09 2011
New Revision: 1174771

URL: http://svn.apache.org/viewvc?rev=1174771&view=rev
Log:
Simple project to combine the Felix framework and security provider
for running the OSGi CT.

Added:
    felix/sandbox/rickhall/ct-launcher/
    felix/sandbox/rickhall/ct-launcher/pom.xml
    felix/sandbox/rickhall/ct-launcher/src/
    felix/sandbox/rickhall/ct-launcher/src/main/
    felix/sandbox/rickhall/ct-launcher/src/main/java/
    felix/sandbox/rickhall/ct-launcher/src/main/java/org/
    felix/sandbox/rickhall/ct-launcher/src/main/java/org/apache/
    felix/sandbox/rickhall/ct-launcher/src/main/java/org/apache/felix/
    felix/sandbox/rickhall/ct-launcher/src/main/java/org/apache/felix/ct/
    felix/sandbox/rickhall/ct-launcher/src/main/java/org/apache/felix/ct/FrameworkFactory.java
    felix/sandbox/rickhall/ct-launcher/src/main/resources/
    felix/sandbox/rickhall/ct-launcher/src/main/resources/META-INF/
    felix/sandbox/rickhall/ct-launcher/src/main/resources/META-INF/services/
    felix/sandbox/rickhall/ct-launcher/src/main/resources/META-INF/services/org.osgi.framework.launch.FrameworkFactory

Added: felix/sandbox/rickhall/ct-launcher/pom.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/ct-launcher/pom.xml?rev=1174771&view=auto
==============================================================================
--- felix/sandbox/rickhall/ct-launcher/pom.xml (added)
+++ felix/sandbox/rickhall/ct-launcher/pom.xml Fri Sep 23 13:59:09 2011
@@ -0,0 +1,96 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>org.apache</groupId>
+    <artifactId>apache</artifactId>
+    <version>5</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <packaging>bundle</packaging>
+  <name>Apache Felix CT Launcher</name>
+  <groupId>org.apache.felix</groupId>
+  <artifactId>org.apache.felix.ct</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.framework</artifactId>
+      <version>3.3.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.framework.security</artifactId>
+      <version>1.5.0-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+
+  <properties>
+    <dollar>$</dollar>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <target>1.5</target>
+          <source>1.5</source>
+        </configuration>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <version>2.1.0</version>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Bundle-SymbolicName>org.apache.felix.ct</Bundle-SymbolicName>
+            <Bundle-Name>Apache Felix CT Launcher</Bundle-Name>
+            <Bundle-Description>Custom launcher for OSGi CT.</Bundle-Description>
+            <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
+            <Embed-Dependency>org.apache.felix.framework;inline=true,org.apache.felix.framework.security;inline=true</Embed-Dependency>
+            <Private-Package>org.apache.felix.ct.*</Private-Package>
+            <Import-Package>!*</Import-Package>
+          </instructions>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>rat-maven-plugin</artifactId>
+        <version>1.0-alpha-3</version>
+        <configuration>
+          <excludeSubProjects>false</excludeSubProjects>
+          <useEclipseDefaultExcludes>true</useEclipseDefaultExcludes>
+          <useMavenDefaultExcludes>true</useMavenDefaultExcludes>
+          <excludes>
+            <param>doc/*</param>
+            <param>maven-eclipse.xml</param>
+            <param>.checkstyle</param>
+            <param>.externalToolBuilders/*</param>
+          </excludes>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: felix/sandbox/rickhall/ct-launcher/src/main/java/org/apache/felix/ct/FrameworkFactory.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/ct-launcher/src/main/java/org/apache/felix/ct/FrameworkFactory.java?rev=1174771&view=auto
==============================================================================
--- felix/sandbox/rickhall/ct-launcher/src/main/java/org/apache/felix/ct/FrameworkFactory.java (added)
+++ felix/sandbox/rickhall/ct-launcher/src/main/java/org/apache/felix/ct/FrameworkFactory.java Fri Sep 23 13:59:09 2011
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 org.apache.felix.ct;
+
+import java.util.*;
+import org.apache.felix.framework.cache.*;
+
+public class FrameworkFactory implements org.osgi.framework.launch.FrameworkFactory
+{
+    public org.osgi.framework.launch.Framework newFramework(Map configuration)
+    {
+	    String extra = (String) configuration.get("org.osgi.framework.system.packages.extra");
+		if (extra != null) {
+		    extra += ",";
+		}
+		else {
+		    extra = "";
+		}
+		extra += "org.osgi.service.permissionadmin;version=\"1.2\",org.osgi.service.condpermadmin;uses:=\"org.osgi.service.permissionadmin\";version=\"1.1.1\"";
+		configuration.put("org.osgi.framework.system.packages.extra", extra);
+		// We want to disable cache locking, since the CT assumes that
+        // caches can be shared among instances.
+        configuration.put(BundleCache.CACHE_LOCKING_PROP, "false");
+		// We need the security extension activated
+		List activators = new ArrayList();
+		activators.add(new org.apache.felix.framework.SecurityActivator());
+		configuration.put("felix.systembundle.activators", activators);
+        return new org.apache.felix.framework.Felix(configuration);
+    }
+}
\ No newline at end of file

Added: felix/sandbox/rickhall/ct-launcher/src/main/resources/META-INF/services/org.osgi.framework.launch.FrameworkFactory
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/ct-launcher/src/main/resources/META-INF/services/org.osgi.framework.launch.FrameworkFactory?rev=1174771&view=auto
==============================================================================
--- felix/sandbox/rickhall/ct-launcher/src/main/resources/META-INF/services/org.osgi.framework.launch.FrameworkFactory (added)
+++ felix/sandbox/rickhall/ct-launcher/src/main/resources/META-INF/services/org.osgi.framework.launch.FrameworkFactory Fri Sep 23 13:59:09 2011
@@ -0,0 +1 @@
+org.apache.felix.ct.FrameworkFactory