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/03 00:40:17 UTC

svn commit: r428179 - in /webservices/muse/trunk/modules/osgi-bundles/muse-wsrf-impl/src: ./ org/ org/apache/ org/apache/muse/ org/apache/muse/osgi/ org/apache/muse/osgi/wsrf/

Author: danj
Date: Wed Aug  2 15:40:16 2006
New Revision: 428179

URL: http://svn.apache.org/viewvc?rev=428179&view=rev
Log: (empty)

Added:
    webservices/muse/trunk/modules/osgi-bundles/muse-wsrf-impl/src/
    webservices/muse/trunk/modules/osgi-bundles/muse-wsrf-impl/src/org/
    webservices/muse/trunk/modules/osgi-bundles/muse-wsrf-impl/src/org/apache/
    webservices/muse/trunk/modules/osgi-bundles/muse-wsrf-impl/src/org/apache/muse/
    webservices/muse/trunk/modules/osgi-bundles/muse-wsrf-impl/src/org/apache/muse/osgi/
    webservices/muse/trunk/modules/osgi-bundles/muse-wsrf-impl/src/org/apache/muse/osgi/wsrf/
    webservices/muse/trunk/modules/osgi-bundles/muse-wsrf-impl/src/org/apache/muse/osgi/wsrf/Activator.java
    webservices/muse/trunk/modules/osgi-bundles/muse-wsrf-impl/src/org/apache/muse/osgi/wsrf/WSRFImplementationService.java

Added: webservices/muse/trunk/modules/osgi-bundles/muse-wsrf-impl/src/org/apache/muse/osgi/wsrf/Activator.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/osgi-bundles/muse-wsrf-impl/src/org/apache/muse/osgi/wsrf/Activator.java?rev=428179&view=auto
==============================================================================
--- webservices/muse/trunk/modules/osgi-bundles/muse-wsrf-impl/src/org/apache/muse/osgi/wsrf/Activator.java (added)
+++ webservices/muse/trunk/modules/osgi-bundles/muse-wsrf-impl/src/org/apache/muse/osgi/wsrf/Activator.java Wed Aug  2 15:40:16 2006
@@ -0,0 +1,56 @@
+/*=============================================================================*
+ *  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 org.apache.muse.osgi.wsrf;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import java.util.Hashtable;
+import org.apache.muse.core.platform.osgi.ResourceManagementImplementation;
+
+/**
+ *
+ * Activator is ...
+ *
+ * @author Joel Hawkins (joelh)
+ *
+ */
+
+public class Activator implements BundleActivator {
+	
+	private WSRFImplementationService wsrfService;
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		wsrfService = new WSRFImplementationService(context.getBundle());
+		Hashtable props = new Hashtable();
+		props.put(ResourceManagementImplementation.IMPLEMENTATION_NAME, wsrfService.getImplementationName());
+		//org.apache.muse.core.platform.osgi.ResourceManagementImplementation
+		context.registerService(new String[] {"org.apache.muse.core.platform.osgi.ResourceManagementImplementation"}, wsrfService, props);
+		
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+	}
+
+}

Added: webservices/muse/trunk/modules/osgi-bundles/muse-wsrf-impl/src/org/apache/muse/osgi/wsrf/WSRFImplementationService.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/osgi-bundles/muse-wsrf-impl/src/org/apache/muse/osgi/wsrf/WSRFImplementationService.java?rev=428179&view=auto
==============================================================================
--- webservices/muse/trunk/modules/osgi-bundles/muse-wsrf-impl/src/org/apache/muse/osgi/wsrf/WSRFImplementationService.java (added)
+++ webservices/muse/trunk/modules/osgi-bundles/muse-wsrf-impl/src/org/apache/muse/osgi/wsrf/WSRFImplementationService.java Wed Aug  2 15:40:16 2006
@@ -0,0 +1,100 @@
+package org.apache.muse.osgi.wsrf;
+
+import java.util.Map;
+import java.util.HashMap;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.ServiceFactory;
+import org.osgi.framework.ServiceRegistration;
+
+import org.apache.muse.core.platform.osgi.ResourceManagementImplementation;
+
+public class WSRFImplementationService implements ResourceManagementImplementation, ServiceFactory {
+	
+	private static final String IMPLEMENTATION_NAME = "wsrf";
+	private static final String[] RESOURCE_IMPLEMENTATIONS = 
+		{"org.apache.muse.ws.resource.impl.SimpleWsResource"};
+	
+	private static final String[] RESOURCE_SPECS = { 
+	"WS-BaseFaults-1_2.xsd",
+	"WS-Resource-1_2.wsdl",
+	"WS-Resource-1_2.xsd",
+	"WS-ResourceLifetime-1_2.wsdl",
+	"WS-ResourceLifetime-1_2.xsd",
+	"WS-ResourceMetadataDescriptor-CD-01.wsdl",
+	"WS-ResourceMetadataDescriptor-CD-01.xsd",
+	"WS-ResourceProperties-1_2.wsdl",
+	"WS-ResourceProperties-1_2.xsd",
+	"WS-ServiceGroup-1_2.wsdl",
+	"WS-ServiceGroup-1_2.xsd",
+	"WS-ServiceGroupEntry-1_2.wsdl"
+	};
+	
+	private static final String[] capabilityURI = {
+		"http://docs.oasis-open.org/wsrf/rlw-2/ImmediateResourceTermination",
+		"http://docs.oasis-open.org/wsrf/rlw-2/ScheduledResourceTermination",
+		"http://docs.oasis-open.org/wsrf/rp-2/Get",
+		"http://docs.oasis-open.org/wsrf/rp-2/Set",
+		"http://docs.oasis-open.org/wsrf/rp-2/Query",
+		"http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata",
+		"http://docs.oasis-open.org/wsrf/rmd-1/ResourceMetadataCapability",
+		"http://docs.oasis-open.org/wsrf/sgw-2/ServiceGroup",
+		"http://docs.oasis-open.org/wsrf/sgw-2/ServiceGroupEntry"
+	};
+	
+	private static final String[] capabilityImplementation = {
+		"org.apache.muse.ws.resource.lifetime.impl.SimpleImmediateTermination",
+		"org.apache.muse.ws.resource.lifetime.impl.SimpleScheduledTermination",
+		"org.apache.muse.ws.resource.properties.get.impl.SimpleGetCapability",
+		"org.apache.muse.ws.resource.properties.get.impl.SimpleSetCapability",
+		"org.apache.muse.ws.resource.properties.get.impl.SimpleQueryCapability",
+		"org.apache.muse.ws.metadata.impl.SimpleMetadataExchange",
+		"org.apache.muse.ws.resource.metadata.impl.SimpleResourceMetadataCapability",
+		"org.apache.muse.ws.resource.sg.impl.SimpleServiceGroup",
+		"org.apache.muse.ws.resource.sg.impl.SimpleEntry"
+	};
+	
+	private static HashMap capabilityMap;
+	
+	private Bundle bundle;
+	
+	static {
+		capabilityMap = new HashMap();
+		for(int i=0;i<capabilityURI.length;i++){
+			capabilityMap.put(capabilityURI[i], capabilityImplementation[i]);
+		}
+	}
+	
+	public WSRFImplementationService(Bundle bundle){
+		this.bundle = bundle;
+	}
+
+	public String getImplementationName() {
+		return IMPLEMENTATION_NAME;
+	}
+
+	public Map getResourceCapabilityMappings() {
+		return capabilityMap;
+	}
+
+	public String[] getResourceImplementationNames() {
+		return RESOURCE_IMPLEMENTATIONS;
+	}
+
+	public String[] getResourceSpecNames() {
+		return RESOURCE_SPECS;
+	}
+	
+	public Bundle getBundle(){
+		return bundle;
+	}
+
+	public Object getService(Bundle bundle, ServiceRegistration registration) {
+		return this;
+	}
+
+	public void ungetService(Bundle bundle, ServiceRegistration registration, Object service) {
+	}
+	
+
+}



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