cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r782577 - in /cxf/dosgi/trunk/distribution: ./ discovery-single-bundle/ discovery-single-bundle/src/ discovery-single-bundle/src/main/ discovery-single-bundle/src/main/java/ discovery-single-bundle/src/main/java/org/ discovery-single-bundle...
Date Mon, 08 Jun 2009 10:02:36 GMT
Author: davidb
Date: Mon Jun  8 10:02:35 2009
New Revision: 782577

URL: http://svn.apache.org/viewvc?rev=782577&view=rev
Log:
Initial bits for a convenience singlebundle distribution for Discovery.

Added:
    cxf/dosgi/trunk/distribution/discovery-single-bundle/
    cxf/dosgi/trunk/distribution/discovery-single-bundle/pom.xml   (with props)
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/java/
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/java/org/
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/java/org/apache/
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/java/org/apache/cxf/
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/java/org/apache/cxf/dosgi/
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/java/org/apache/cxf/dosgi/discovery/
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/java/org/apache/cxf/dosgi/discovery/singlebundle/
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/java/org/apache/cxf/dosgi/discovery/singlebundle/AggregatedActivator.java
  (with props)
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/resources/
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/resources/org/
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/resources/org/apache/
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/resources/org/apache/cxf/
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/resources/org/apache/cxf/dosgi/
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/resources/org/apache/cxf/dosgi/discovery/
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/resources/org/apache/cxf/dosgi/discovery/singlebundle/
    cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/resources/org/apache/cxf/dosgi/discovery/singlebundle/activators.list
Modified:
    cxf/dosgi/trunk/distribution/pom.xml

Added: cxf/dosgi/trunk/distribution/discovery-single-bundle/pom.xml
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/distribution/discovery-single-bundle/pom.xml?rev=782577&view=auto
==============================================================================
--- cxf/dosgi/trunk/distribution/discovery-single-bundle/pom.xml (added)
+++ cxf/dosgi/trunk/distribution/discovery-single-bundle/pom.xml Mon Jun  8 10:02:35 2009
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+<!--
+  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.
+-->
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.cxf.dosgi</groupId>
+  <artifactId>cxf-dosgi-ri-discovery-singlebundle-distribution</artifactId>
+  <version>1.1-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+  <name>Distributed OSGI Zookeeper-Based Discovery Single-Bundle Distribution</name>
+  <url>http://cxf.apache.org</url>
+
+  <parent>
+    <groupId>org.apache.cxf.dosgi</groupId>
+    <artifactId>cxf-dosgi-ri-distribution-parent</artifactId>
+    <version>1.1-SNAPSHOT</version>
+    <relativePath>../pom.xml</relativePath>
+  </parent>
+
+  <properties>
+    <topDirectoryLocation>../..</topDirectoryLocation>
+  </properties>
+  
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.osgi.compendium</artifactId>
+      <version>1.2.0</version>
+      <scope>provided</scope>
+      <exclusions>
+        <exclusion>
+          <groupId>org.apache.felix</groupId>
+          <artifactId>org.osgi.foundation</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.configadmin</artifactId>
+      <version>1.0.10</version>
+    </dependency>      
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.fileinstall</artifactId>
+      <version>1.0.0</version>
+    </dependency>      
+
+    <dependency> 
+      <groupId>org.apache.log4j</groupId> 
+      <artifactId>com.springsource.org.apache.log4j</artifactId> 
+      <version>${log4j.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cxf.dosgi</groupId>
+      <artifactId>cxf-dosgi-ri-discovery-distributed-zookeeper-wrapper</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cxf.dosgi</groupId>
+      <artifactId>cxf-dosgi-ri-discovery-distributed</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>        
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <configuration>
+          <instructions>
+            <Bundle-Name>Distributed OSGi Zookeeper-Based Discovery Single-Bundle Distribution</Bundle-Name>
+            <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+            <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
+            <Bundle-Activator>org.apache.cxf.dosgi.discovery.singlebundle.AggregatedActivator</Bundle-Activator>
+            <Include-Resource>
+              @cxf-dosgi-ri-discovery-distributed-${project.version}.jar!/META-INF/spring/*,
+              {maven-resources}
+            </Include-Resource> 
+            <Import-Package>
+              com.sun.jdmk.comm;resolution:=optional,
+              javax.jms;resolution:=optional,
+              javax.mail.*;resolution:=optional,
+              javax.management;resolution:=optional,
+              javax.naming;resolution:=optional,
+              javax.swing.*;resolution:=optional,
+              javax.xml.*,
+              org.apache.cxf.dosgi.discovery.local;version=${pom.version},
+              org.osgi.framework;version="[1.4.0,2.0.0)",
+              org.osgi.service.cm;version="[1.2.0,2.0.0)",
+              org.osgi.service.discovery;version="[1.0.0,2.0.0)",
+              org.osgi.service.packageadmin;version="[1.2.0,2.0.0)",
+              org.osgi.util.tracker;version="[1.3.0,2.0.0)",
+              org.springframework.beans.factory;version="[2.5.0,3.0.0)",
+              org.springframework.osgi.context;version="[1.2.0,2.0.0)",
+              org.w3c.dom,
+              org.xml.sax.*,
+              !*
+            </Import-Package> 
+            <Export-Package>
+              !*
+            </Export-Package>
+            <Private-Package>org.apache.cxf.dosgi.discovery.singlebundle</Private-Package>
+            <Embed-Dependency>*;scope=compile;inline=false</Embed-Dependency>
+            <Embed-Directory>lib</Embed-Directory>
+            <_exportcontents>
+              !*
+            </_exportcontents>
+            <_removeheaders>
+              Ignore-Package,
+              Include-Resource,
+              Private-Package,
+              Embed-Dependency
+            </_removeheaders>
+          </instructions>
+        </configuration>
+      </plugin> 
+    </plugins>
+  </build>
+</project>

Propchange: cxf/dosgi/trunk/distribution/discovery-single-bundle/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/dosgi/trunk/distribution/discovery-single-bundle/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/dosgi/trunk/distribution/discovery-single-bundle/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/java/org/apache/cxf/dosgi/discovery/singlebundle/AggregatedActivator.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/java/org/apache/cxf/dosgi/discovery/singlebundle/AggregatedActivator.java?rev=782577&view=auto
==============================================================================
--- cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/java/org/apache/cxf/dosgi/discovery/singlebundle/AggregatedActivator.java
(added)
+++ cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/java/org/apache/cxf/dosgi/discovery/singlebundle/AggregatedActivator.java
Mon Jun  8 10:02:35 2009
@@ -0,0 +1,91 @@
+/** 
+  * 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.cxf.dosgi.discovery.singlebundle;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class AggregatedActivator implements BundleActivator {
+    static final String ACTIVATOR_RESOURCE = "activators.list";
+
+    private List<BundleActivator> activators = new ArrayList<BundleActivator>();

+
+    public void start(BundleContext ctx) throws Exception {
+        startEmbeddedActivators(ctx);
+    }
+
+    public void stop(BundleContext ctx) throws Exception {
+        stopEmbeddedActivators(ctx);
+    }
+
+    void startEmbeddedActivators(BundleContext ctx) throws Exception {
+        ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
+        try {
+            Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+            for (String s : getActivators()) {
+                try {
+                    Class<?> clazz = getClass().getClassLoader().loadClass(s);
+                    Object o = clazz.newInstance();
+                    if (o instanceof BundleActivator) {
+                        BundleActivator ba = (BundleActivator) o;
+                        activators.add(ba);
+                        ba.start(ctx);
+                    }
+                } catch (Throwable th) {
+                    th.printStackTrace();
+                }
+            }
+        } finally {
+            Thread.currentThread().setContextClassLoader(oldClassLoader);
+        }
+    }
+
+    void stopEmbeddedActivators(BundleContext ctx) throws Exception {
+        for (BundleActivator ba : activators) {
+            ba.stop(ctx);
+        }
+    }
+    
+    static Collection<String> getActivators() throws IOException {
+        List<String> bundleActivators = new ArrayList<String>();
+        
+        URL url = AggregatedActivator.class.getResource(ACTIVATOR_RESOURCE);
+        if (url == null) {
+            return Collections.emptyList();
+        }
+        
+        BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+        String line = null;
+        while ((line = br.readLine()) != null) {
+            bundleActivators.add(line);
+        }
+        
+        return bundleActivators;
+    }
+    
+}

Propchange: cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/java/org/apache/cxf/dosgi/discovery/singlebundle/AggregatedActivator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/java/org/apache/cxf/dosgi/discovery/singlebundle/AggregatedActivator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/resources/org/apache/cxf/dosgi/discovery/singlebundle/activators.list
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/resources/org/apache/cxf/dosgi/discovery/singlebundle/activators.list?rev=782577&view=auto
==============================================================================
--- cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/resources/org/apache/cxf/dosgi/discovery/singlebundle/activators.list
(added)
+++ cxf/dosgi/trunk/distribution/discovery-single-bundle/src/main/resources/org/apache/cxf/dosgi/discovery/singlebundle/activators.list
Mon Jun  8 10:02:35 2009
@@ -0,0 +1,4 @@
+org.apache.felix.cm.impl.ConfigurationManager
+org.apache.felix.fileinstall.FileInstall
+org.apache.cxf.dosgi.discovery.zookeeper.Activator
+

Modified: cxf/dosgi/trunk/distribution/pom.xml
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/distribution/pom.xml?rev=782577&r1=782576&r2=782577&view=diff
==============================================================================
--- cxf/dosgi/trunk/distribution/pom.xml (original)
+++ cxf/dosgi/trunk/distribution/pom.xml Mon Jun  8 10:02:35 2009
@@ -40,6 +40,7 @@
     <modules>
       <module>multi-bundle</module>
       <module>single-bundle</module>
+      <module>discovery-single-bundle</module>
       <module>sources</module>
     </modules> 
 </project>



Mime
View raw message