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 da...@apache.org on 2006/08/25 22:56:20 UTC
svn commit: r436943 [4/4] - in
/webservices/muse/trunk/samples/eclipse-osgi/samples: osgi_manager/
osgi_manager/plugins/ osgi_manager/plugins/dummy.bundle/
osgi_manager/plugins/dummy.bundle/META-INF/
osgi_manager/plugins/dummy.bundle/src/ osgi_manager/...
Added: webservices/muse/trunk/samples/eclipse-osgi/samples/osgi_manager_consumer/plugins/test.muse.osgi.management/src/test/muse/osgi/management/ConsumerCapability.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/samples/eclipse-osgi/samples/osgi_manager_consumer/plugins/test.muse.osgi.management/src/test/muse/osgi/management/ConsumerCapability.java?rev=436943&view=auto
==============================================================================
--- webservices/muse/trunk/samples/eclipse-osgi/samples/osgi_manager_consumer/plugins/test.muse.osgi.management/src/test/muse/osgi/management/ConsumerCapability.java (added)
+++ webservices/muse/trunk/samples/eclipse-osgi/samples/osgi_manager_consumer/plugins/test.muse.osgi.management/src/test/muse/osgi/management/ConsumerCapability.java Fri Aug 25 13:56:15 2006
@@ -0,0 +1,26 @@
+/*=============================================================================*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * 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 test.muse.osgi.management;
+
+import org.apache.muse.core.Capability;
+
+public interface ConsumerCapability extends Capability
+{
+ //
+ // no additional methods
+ //
+}
Added: webservices/muse/trunk/samples/eclipse-osgi/samples/osgi_manager_consumer/plugins/test.muse.osgi.management/src/test/muse/osgi/management/impl/ConsumerCapabilityImpl.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/samples/eclipse-osgi/samples/osgi_manager_consumer/plugins/test.muse.osgi.management/src/test/muse/osgi/management/impl/ConsumerCapabilityImpl.java?rev=436943&view=auto
==============================================================================
--- webservices/muse/trunk/samples/eclipse-osgi/samples/osgi_manager_consumer/plugins/test.muse.osgi.management/src/test/muse/osgi/management/impl/ConsumerCapabilityImpl.java (added)
+++ webservices/muse/trunk/samples/eclipse-osgi/samples/osgi_manager_consumer/plugins/test.muse.osgi.management/src/test/muse/osgi/management/impl/ConsumerCapabilityImpl.java Fri Aug 25 13:56:15 2006
@@ -0,0 +1,48 @@
+/*=============================================================================*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * 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 test.muse.osgi.management.impl;
+
+import org.apache.muse.core.AbstractCapability;
+import test.muse.osgi.management.ConsumerCapability;
+import org.apache.muse.ws.addressing.soap.SoapFault;
+import org.apache.muse.ws.notification.NotificationConsumer;
+import org.apache.muse.ws.notification.NotificationMessage;
+import org.apache.muse.ws.notification.NotificationMessageListener;
+import org.apache.muse.ws.notification.WsnConstants;
+
+public class ConsumerCapabilityImpl
+ extends AbstractCapability implements ConsumerCapability, NotificationMessageListener
+{
+ public void initializeCompleted()
+ throws SoapFault
+ {
+ super.initializeCompleted();
+
+ NotificationConsumer wsn = (NotificationConsumer)getResource().getCapability(WsnConstants.CONSUMER_URI);
+ wsn.addMessageListener(this);
+ }
+
+ public boolean accepts(NotificationMessage message)
+ {
+ return true;
+ }
+
+ public void process(NotificationMessage message)
+ {
+ getLog().info("Received message:\n\n" + message);
+ }
+}
Added: webservices/muse/trunk/samples/eclipse-osgi/samples/osgi_manager_consumer/readme.txt
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/samples/eclipse-osgi/samples/osgi_manager_consumer/readme.txt?rev=436943&view=auto
==============================================================================
--- webservices/muse/trunk/samples/eclipse-osgi/samples/osgi_manager_consumer/readme.txt (added)
+++ webservices/muse/trunk/samples/eclipse-osgi/samples/osgi_manager_consumer/readme.txt Fri Aug 25 13:56:15 2006
@@ -0,0 +1,3 @@
+Use config.ini setting for HTTP service port. The default for this project is 8080.
+
+org.osgi.service.http.port=8080
Modified: webservices/muse/trunk/samples/eclipse-osgi/samples/wsrf/plugins/test.muse.osgi.wsrf/OSGI-INF/muse.xml
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/samples/eclipse-osgi/samples/wsrf/plugins/test.muse.osgi.wsrf/OSGI-INF/muse.xml?rev=436943&r1=436942&r2=436943&view=diff
==============================================================================
--- webservices/muse/trunk/samples/eclipse-osgi/samples/wsrf/plugins/test.muse.osgi.wsrf/OSGI-INF/muse.xml (original)
+++ webservices/muse/trunk/samples/eclipse-osgi/samples/wsrf/plugins/test.muse.osgi.wsrf/OSGI-INF/muse.xml Fri Aug 25 13:56:15 2006
@@ -15,7 +15,7 @@
<persistence-location>router-entries</persistence-location>
</persistence>
</router>
- <resource-type>
+ <resource-type use-router-persistence="true">
<context-path>WsResourceFactory</context-path>
<wsdl>
<wsdl-file>/wsdl/WsResourceFactory.wsdl</wsdl-file>
@@ -90,7 +90,7 @@
<param-value>false</param-value>
</init-param>
</resource-type>
- <resource-type>
+ <resource-type use-router-persistence="true">
<context-path>ServiceGroup</context-path>
<wsdl>
<wsdl-file>/wsdl/WS-ServiceGroup-1_2.wsdl</wsdl-file>
@@ -113,10 +113,12 @@
<capability>
<capability-uri>http://docs.oasis-open.org/wsrf/sgw-2/ServiceGroup</capability-uri>
<java-capability-class>org.apache.muse.ws.resource.sg.impl.SimpleServiceGroup</java-capability-class>
+ <!--
<persistence>
<java-persistence-class>org.apache.muse.ws.resource.sg.impl.ServiceGroupFilePersistence</java-persistence-class>
<persistence-location>service-group-entries</persistence-location>
</persistence>
+ -->
</capability>
</resource-type>
</muse>
Added: webservices/muse/trunk/samples/eclipse-osgi/samples/wsrf/plugins/test.muse.osgi.wsrf/src/org/apache/muse/test/wsrf/Activator.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/samples/eclipse-osgi/samples/wsrf/plugins/test.muse.osgi.wsrf/src/org/apache/muse/test/wsrf/Activator.java?rev=436943&view=auto
==============================================================================
--- webservices/muse/trunk/samples/eclipse-osgi/samples/wsrf/plugins/test.muse.osgi.wsrf/src/org/apache/muse/test/wsrf/Activator.java (added)
+++ webservices/muse/trunk/samples/eclipse-osgi/samples/wsrf/plugins/test.muse.osgi.wsrf/src/org/apache/muse/test/wsrf/Activator.java Fri Aug 25 13:56:15 2006
@@ -0,0 +1,60 @@
+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 {
+ System.out.println("Starting WSRF Test bundle");
+ String prop = System.getProperty("data.location");
+ String dir = System.getProperty("user.dir");
+ Properties props = System.getProperties();
+ File curr = new File(".");
+ System.out.println("curr dir" + curr.getCanonicalPath());
+ 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();
+
+ if(File.separator.equals("/")){
+ int sample = location.lastIndexOf("samples/samples");
+ if(sample > 0)
+ location = patchupLocation(location, sample, "samples/eclipse-osgi/samples");
+ root = new File(location);
+ } else {
+ int sample = location.lastIndexOf("samples\\samples");
+ if(sample > 0)
+ location = patchupLocation(location, sample, "samples\\eclipse-osgi\\samples");
+ root = new File(location);
+ }
+ }
+ } else if("USE_BUNDLE_DATA".equals(prop)){
+ root = context.getDataFile(".");
+ } else {
+ root = new File(prop);
+ }
+ System.out.println("Using " + root.getCanonicalPath() + " as bundle root");
+ 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 {
+ }
+
+}
Added: webservices/muse/trunk/samples/eclipse-osgi/samples/wsrf/pom.xml
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/samples/eclipse-osgi/samples/wsrf/pom.xml?rev=436943&view=auto
==============================================================================
--- webservices/muse/trunk/samples/eclipse-osgi/samples/wsrf/pom.xml (added)
+++ webservices/muse/trunk/samples/eclipse-osgi/samples/wsrf/pom.xml Fri Aug 25 13:56:15 2006
@@ -0,0 +1,115 @@
+<?xml version="1.0"?>
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>muse-samples</groupId>
+ <artifactId>wsrf_osgi_bundle</artifactId>
+ <packaging>jar</packaging>
+ <version>2.0.0-SNAPSHOT</version>
+ <name>Apache Muse - sample project demonstrating all WSRF concepts and operations in an OSGi plugin</name>
+ <url>http://ws.apache.org/muse</url>
+ <dependencies>
+ <dependency>
+ <groupId>muse</groupId>
+ <artifactId>muse-core</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>muse</groupId>
+ <artifactId>muse-osgi-core</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>muse</groupId>
+ <artifactId>muse-util-qname</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>muse</groupId>
+ <artifactId>muse-util-xml</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>muse</groupId>
+ <artifactId>muse-wsa-soap</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>muse</groupId>
+ <artifactId>muse-wsrf-api</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>muse</groupId>
+ <artifactId>muse-wsrf-impl</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <sourceDirectory>plugins/test.muse.osgi.wsrf/src</sourceDirectory>
+ <outputDirectory>plugins/test.muse.osgi.wsrf/build/classes</outputDirectory>
+ <directory>build/jars</directory>
+
+ <!--
+
+ This feature can be used when Maven 2.1 is released
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <addMavenDescriptor>false</addMavenDescriptor>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+
+ <dependency>
+ <groupId>woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>2.9.3</version>
+ <copy>compile</copy>
+ </dependency>
+
+ -->
+
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>dependency-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>2.9.3</version>
+ <type>jar</type>
+ <outputDirectory>${project.build.directory}/../../../../muse/muse-osgi-soa-axis2</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+
+
+ </build>
+</project>
Added: webservices/muse/trunk/samples/eclipse-osgi/samples/wsrf/update-osgi-sample.bat
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/samples/eclipse-osgi/samples/wsrf/update-osgi-sample.bat?rev=436943&view=auto
==============================================================================
--- webservices/muse/trunk/samples/eclipse-osgi/samples/wsrf/update-osgi-sample.bat (added)
+++ webservices/muse/trunk/samples/eclipse-osgi/samples/wsrf/update-osgi-sample.bat Fri Aug 25 13:56:15 2006
@@ -0,0 +1,8 @@
+echo off
+
+echo Copying OSGi bundles to OSGi samples ...
+
+xcopy ..\..\..\wsrf\src\My*.java .\plugins\test.muse.osgi.wsrf\src /S /Y
+xcopy ..\..\..\wsrf\config\muse.xml .\plugins\test.muse.osgi.wsrf\OSGI-INF
+xcopy ..\..\..\wsrf\wsdl\WSResource*.* .\plugins\test.muse.osgi.wsrf\wsdl /S /Y
+xcopy ..\..\..\wsrf\router-entries\*.xml .\plugins\test.muse.osgi.wsrf\router-entries /S /Y
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-commits-help@ws.apache.org