You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by ae...@apache.org on 2006/09/01 04:42:07 UTC

svn commit: r439146 - in /webservices/muse/trunk/samples/eclipse-osgi/wsrf: ./ config/ src/ src/org/ src/org/apache/ src/org/apache/muse/ src/org/apache/muse/test/ src/org/apache/muse/test/wsrf/

Author: aeberbac
Date: Thu Aug 31 19:42:06 2006
New Revision: 439146

URL: http://svn.apache.org/viewvc?rev=439146&view=rev
Log:
a little reorganizing

Added:
    webservices/muse/trunk/samples/eclipse-osgi/wsrf/
    webservices/muse/trunk/samples/eclipse-osgi/wsrf/build.xml
    webservices/muse/trunk/samples/eclipse-osgi/wsrf/config/
    webservices/muse/trunk/samples/eclipse-osgi/wsrf/config/MANIFEST.MF
    webservices/muse/trunk/samples/eclipse-osgi/wsrf/config/config.ini
    webservices/muse/trunk/samples/eclipse-osgi/wsrf/src/
    webservices/muse/trunk/samples/eclipse-osgi/wsrf/src/org/
    webservices/muse/trunk/samples/eclipse-osgi/wsrf/src/org/apache/
    webservices/muse/trunk/samples/eclipse-osgi/wsrf/src/org/apache/muse/
    webservices/muse/trunk/samples/eclipse-osgi/wsrf/src/org/apache/muse/test/
    webservices/muse/trunk/samples/eclipse-osgi/wsrf/src/org/apache/muse/test/wsrf/
    webservices/muse/trunk/samples/eclipse-osgi/wsrf/src/org/apache/muse/test/wsrf/Activator.java

Added: webservices/muse/trunk/samples/eclipse-osgi/wsrf/build.xml
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/samples/eclipse-osgi/wsrf/build.xml?rev=439146&view=auto
==============================================================================
--- webservices/muse/trunk/samples/eclipse-osgi/wsrf/build.xml (added)
+++ webservices/muse/trunk/samples/eclipse-osgi/wsrf/build.xml Thu Aug 31 19:42:06 2006
@@ -0,0 +1,147 @@
+<?xml version="1.0"?>
+<project name="WSRF OSGi Example" default="plugins">
+    
+    <target name="init">
+        <basename property="NAME" file="${basedir}"/>
+        <property name="MUSE_HOME" value="../../.."/>
+        <property name="MUSE_TEMPLATE" value="${MUSE_HOME}/lib/eclipse-osgi"/>
+        <property name="BUILD_DIR" value="build"/>
+        <property name="JAVA_SRC_DIR" value="${BUILD_DIR}/src"/>
+        <property name="JAVA_DEST_DIR" value="${BUILD_DIR}/bin"/>
+        <property name="OSGI_INF_DIR" value="${BUILD_DIR}/OSGI-INF"/>
+        <property name="META_INF_DIR" value="${BUILD_DIR}/META-INF"/>
+        <property name="PLUGINS_DIR" value="${basedir}/plugins"/>
+        <property name="PLUGIN_DIR" value="${PLUGINS_DIR}/${NAME}"/>
+
+        <property name="WSRF_SAMPLE_DIR" value="../../wsrf"/>
+        <property name="JAR_FILE" value="${BUILD_DIR}/${NAME}.jar"/>
+
+        <path id="muse.class.path">
+            <fileset dir="${MUSE_HOME}/modules/ws-fx-api/">
+                <include name="*.jar"/>
+            </fileset>
+            <fileset dir="${MUSE_HOME}/modules/ws-fx-impl/">
+                <include name="*.jar"/>
+            </fileset>
+            <fileset dir="${MUSE_HOME}/modules/core/">
+                <include name="*.jar"/>
+            </fileset>
+            <fileset dir="${MUSE_HOME}/modules/osgi/core">
+                <include name="*.jar"/>
+            </fileset>
+            <fileset dir="${MUSE_HOME}/lib/eclipse-osgi">
+                <include name="*.jar"/>
+            </fileset>
+            <fileset dir="${MUSE_HOME}/lib/common">
+                <include name="*.jar"/>
+            </fileset>
+        </path>
+    </target>
+
+    <target name="layout" depends="init, clean">
+        <mkdir dir="${BUILD_DIR}"/>
+
+        <copy todir="${BUILD_DIR}">
+            <fileset dir="${WSRF_SAMPLE_DIR}">
+                <include name="src/**"/>
+                <include name="wsdl/**"/>
+                <include name="router-entries/**"/>
+            </fileset>
+            <fileset dir="${basedir}">
+                <include name="src/**"/>
+            </fileset>
+        </copy>
+
+        <mkdir dir="${OSGI_INF_DIR}"/>
+        <copy todir="${OSGI_INF_DIR}">
+            <fileset dir="${WSRF_SAMPLE_DIR}/config">
+                <include name="muse.xml"/>
+            </fileset>
+        </copy> 
+
+        <mkdir dir="${META_INF_DIR}"/>
+        <copy todir="${META_INF_DIR}">
+            <fileset dir="${basedir}/config">
+                <include name="MANIFEST.MF"/>
+            </fileset>
+        </copy> 
+    </target>
+
+    <target name="java" depends="layout">
+        <mkdir dir="${JAVA_DEST_DIR}"/>
+        <javac srcdir="${JAVA_SRC_DIR}" destdir="${JAVA_DEST_DIR}" classpathref="muse.class.path"/>
+        <jar basedir="${JAVA_DEST_DIR}" destfile="${JAR_FILE}">
+            <fileset dir="${JAVA_DEST_DIR}">
+                <include name="**/*.class"/>
+            </fileset>
+        </jar>
+    </target>
+
+    <target name="plugins" depends="java">
+
+        <mkdir dir="${PLUGIN_DIR}"/>
+        <copy todir="${PLUGIN_DIR}">
+            <fileset dir="${BUILD_DIR}">
+                <include name="OSGI-INF/**"/>
+                <include name="META-INF/**"/>
+                <include name="wsdl/**"/>
+                <include name="router-entries/**"/>
+            </fileset>
+        </copy>
+        <copy todir="${PLUGIN_DIR}" file="${JAR_FILE}"/>
+        <mkdir dir="${PLUGINS_DIR}"/>
+        <copy todir="${PLUGINS_DIR}">
+            <fileset dir="${MUSE_TEMPLATE}">
+                <include name="**/*"/>
+            </fileset>
+        </copy>
+        <copy todir="${PLUGINS_DIR}" flatten="true">
+            <fileset dir="${MUSE_HOME}/modules/osgi">
+                <include name="**/*.jar"/>
+            </fileset>
+        </copy>
+
+        <mkdir dir="${PLUGINS_DIR}/configuration"/>
+        <pathconvert property="bundlesProperty" pathsep=", ">
+            <chainedmapper>
+              <flattenmapper/>
+              <regexpmapper from="^(.*)$" to="\1@start"/>
+            </chainedmapper>
+            <path>
+                <dirset dir="plugins" includes="*"> 
+                    <exclude name="configuration"/>
+                </dirset>
+                <fileset dir="plugins">
+                    <exclude name="org.eclipse.osgi_3.2.0.v20060601.jar"/>
+                    <include name="*.jar"/>
+                </fileset>
+            </path>
+        </pathconvert>
+        <copy todir="${PLUGINS_DIR}/configuration">
+            <filterchain>
+                <replacetokens>
+                    <token key="XXX" value="${bundlesProperty}"/>
+                </replacetokens>
+            </filterchain>
+            <fileset dir="config">
+                <include name="config.ini"/>
+            </fileset>
+        </copy>
+    </target>
+
+    <target name="run" >
+        <echo message="Launching OSGi framework..."/>
+        <java fork="true" dir="plugins" jar="plugins/org.eclipse.osgi_3.2.0.v20060601.jar">
+            <arg value="-console"/>
+            <arg value="-clean"/>
+        </java>
+        <echo message="OSGi framework has exited"/>
+    </target>
+
+    <target name="clean" depends="init">
+        <delete dir="${BUILD_DIR}"/>		
+        <delete dir="${PLUGINS_DIR}"/>		
+    </target>
+
+</project>
+

Added: webservices/muse/trunk/samples/eclipse-osgi/wsrf/config/MANIFEST.MF
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/samples/eclipse-osgi/wsrf/config/MANIFEST.MF?rev=439146&view=auto
==============================================================================
--- webservices/muse/trunk/samples/eclipse-osgi/wsrf/config/MANIFEST.MF (added)
+++ webservices/muse/trunk/samples/eclipse-osgi/wsrf/config/MANIFEST.MF Thu Aug 31 19:42:06 2006
@@ -0,0 +1,28 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: WSRF OSGi Capability
+Bundle-SymbolicName: wsrf
+Bundle-Version: 1.0.0
+Bundle-Activator: org.apache.muse.test.wsrf.Activator
+Bundle-Localization: plugin
+Import-Package: javax.xml.namespace,
+ org.osgi.framework;version="1.3.0"
+Require-Bundle: muse.osgi.core,
+ muse.osgi.soa.axis2,
+ muse.osgi.soa.core,
+ muse.core,
+ muse.util.all,
+ muse.wsa.soap,
+ muse.wsrf.api,
+ muse.wsrf.impl,
+ org.eclipse.corona.soa.provider.Axis2,
+ org.eclipse.equinox.http,
+ org.eclipse.equinox.servlet.api,
+ org.eclipse.osgi.services,
+ org.eclipse.osgi.util,
+ org.eclipse.osgi
+MUSE-CONFIG: OSGI-INF/muse.xml
+MUSE-CONTEXT: wsrf
+Bundle-ClassPath: .,wsrf.jar
+
+

Added: webservices/muse/trunk/samples/eclipse-osgi/wsrf/config/config.ini
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/samples/eclipse-osgi/wsrf/config/config.ini?rev=439146&view=auto
==============================================================================
--- webservices/muse/trunk/samples/eclipse-osgi/wsrf/config/config.ini (added)
+++ webservices/muse/trunk/samples/eclipse-osgi/wsrf/config/config.ini Thu Aug 31 19:42:06 2006
@@ -0,0 +1,5 @@
+osgi.bundles=@XXX@
+osgi.noShutdown=true
+osgi.bundles.defaultStartLevel=4
+osgi.configuration.cascaded=false
+eclipse.ignoreApp=true

Added: webservices/muse/trunk/samples/eclipse-osgi/wsrf/src/org/apache/muse/test/wsrf/Activator.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/samples/eclipse-osgi/wsrf/src/org/apache/muse/test/wsrf/Activator.java?rev=439146&view=auto
==============================================================================
--- webservices/muse/trunk/samples/eclipse-osgi/wsrf/src/org/apache/muse/test/wsrf/Activator.java (added)
+++ webservices/muse/trunk/samples/eclipse-osgi/wsrf/src/org/apache/muse/test/wsrf/Activator.java Thu Aug 31 19:42:06 2006
@@ -0,0 +1,43 @@
+package org.apache.muse.test.wsrf;
+
+import org.apache.muse.core.platform.osgi.util.BundleRootHelper;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+import java.io.File;
+import java.util.Hashtable;
+import java.util.Properties;
+
+public class Activator implements BundleActivator {
+
+	public void start(BundleContext context) throws Exception {
+		String prop = System.getProperty("data.location");
+		String dir = System.getProperty("user.dir");
+		Properties props = System.getProperties();
+		File curr = new File(".");
+		File root = null;
+		if(prop == null){
+			String location = context.getBundle().getLocation();
+			//WARNING - truly hacky code to get to proper install location
+			if(location.startsWith("initial@reference:file:")){
+				location = location.substring("initial@reference:file:".length());
+				root = new File(location);
+				location = root.getCanonicalPath();
+			}
+		} else if("USE_BUNDLE_DATA".equals(prop)){
+			root = context.getDataFile(".");
+		} else {
+			root = new File(prop);
+		}
+		BundleRootHelper.registerRoot(context.getBundle(), root);
+	}
+	
+	private String patchupLocation(String location, int sampleStart, String replacementText){
+		return location.substring(0,sampleStart)+replacementText + location.substring(sampleStart+"samples/samples".length());
+	}
+	
+
+	public void stop(BundleContext context) throws Exception {
+	}
+
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: muse-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-commits-help@ws.apache.org