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 2007/03/24 14:12:20 UTC

svn commit: r522017 [1/3] - in /webservices/muse/trunk/modules: muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/ muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/internal/ muse-osgi-soa-core/src/org/apache/muse/osgi/soa...

Author: danj
Date: Sat Mar 24 06:12:19 2007
New Revision: 522017

URL: http://svn.apache.org/viewvc?view=rev&rev=522017
Log:
Updating all source files to have new license header as mandated by ASF policy.

Modified:
    webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/Activator.java
    webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/Axis2Environment.java
    webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/Axis2IsolationLayer.java
    webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/ResourceManagementAdminService.java
    webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/ResourceManagementProviderFactory.java
    webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/internal/Axis2ResourceManagementService.java
    webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/internal/OSGiRawXMLInOutMessageReceiver.java
    webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/internal/ResourceManagementAdminServiceImpl.java
    webservices/muse/trunk/modules/muse-osgi-soa-core/src/org/apache/muse/osgi/soa/core/Activator.java
    webservices/muse/trunk/modules/muse-osgi-soa-core/src/org/apache/muse/osgi/soa/core/BundleClassResolver.java
    webservices/muse/trunk/modules/muse-osgi-soa-core/src/org/apache/muse/osgi/soa/core/SOAPProvider.java
    webservices/muse/trunk/modules/muse-osgi-soa-core/src/org/apache/muse/osgi/soa/core/web/ServletDescriptor.java
    webservices/muse/trunk/modules/muse-osgi-soa-core/src/org/apache/muse/osgi/soa/core/web/WebApp.java
    webservices/muse/trunk/modules/muse-osgi-soa-core/src/org/apache/muse/osgi/soa/core/web/WebAppDescriptor.java
    webservices/muse/trunk/modules/muse-osgi-soa-mini/src/org/apache/muse/core/platform/osgi/mini/Activator.java
    webservices/muse/trunk/modules/muse-osgi-soa-mini/src/org/apache/muse/core/platform/osgi/mini/ResourceManagementAdminService.java
    webservices/muse/trunk/modules/muse-osgi-soa-mini/src/org/apache/muse/core/platform/osgi/mini/ResourceManagementProviderFactory.java
    webservices/muse/trunk/modules/muse-osgi-soa-mini/src/org/apache/muse/core/platform/osgi/mini/internal/OSGiMinServlet.java
    webservices/muse/trunk/modules/muse-osgi-soa-mini/src/org/apache/muse/core/platform/osgi/mini/internal/OSGiMiniEnvironment.java
    webservices/muse/trunk/modules/muse-osgi-soa-mini/src/org/apache/muse/core/platform/osgi/mini/internal/OSGiMiniIsolationLayer.java
    webservices/muse/trunk/modules/muse-osgi-soa-mini/src/org/apache/muse/core/platform/osgi/mini/internal/RequestWrapper.java
    webservices/muse/trunk/modules/muse-osgi-soa-mini/src/org/apache/muse/core/platform/osgi/mini/internal/ResourceManagementAdminServiceImpl.java
    webservices/muse/trunk/modules/muse-platform-axis2/src/org/apache/muse/core/platform/axis2/AxisEnvironment.java
    webservices/muse/trunk/modules/muse-platform-axis2/src/org/apache/muse/core/platform/axis2/AxisIsolationLayer.java
    webservices/muse/trunk/modules/muse-platform-axis2/src/org/apache/muse/core/platform/axis2/ResponseActionHandler.java
    webservices/muse/trunk/modules/muse-platform-mini/src/org/apache/muse/core/platform/mini/MiniEnvironment.java
    webservices/muse/trunk/modules/muse-platform-mini/src/org/apache/muse/core/platform/mini/MiniIsolationLayer.java
    webservices/muse/trunk/modules/muse-platform-mini/src/org/apache/muse/core/platform/mini/MiniServlet.java

Modified: webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/Activator.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/Activator.java?view=diff&rev=522017&r1=522016&r2=522017
==============================================================================
--- webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/Activator.java (original)
+++ webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/Activator.java Sat Mar 24 06:12:19 2007
@@ -1,119 +1,122 @@
-/*=============================================================================*
- *  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.core.platform.osgi.axis2;
-
-import java.util.Hashtable;
-
-import org.apache.muse.core.platform.osgi.ResourceManagementProvider;
-import org.apache.muse.core.platform.osgi.axis2.internal.ResourceManagementAdminServiceImpl;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.ServiceEvent;
-import org.osgi.framework.ServiceListener;
-import org.osgi.framework.ServiceReference;
-import org.apache.muse.osgi.soa.core.SOAPProvider;
-import org.apache.muse.util.xml.XmlUtils;
-
-/**
- *
- * Activator is ...
- *
- * @author Joel Hawkins (joelh)
- *
- */
-
-public class Activator implements BundleActivator, ServiceListener {
-
-	private ResourceManagementProvider adminService;
-
-	private BundleContext context;
-
-	private ServiceReference soapProviderReference = null;
-
-	private boolean enabled = false;
-
-	private static final String SOAP_SERVICE_FILTER = "(objectclass=org.apache.muse.osgi.soa.core.SOAPProvider)";
-
-	public void start(BundleContext context) throws Exception {
-		this.context = context;
-		try {
-			
-			//Intialize XMLUtils with this bundle's services.
-			ClassLoader prev = Thread.currentThread().getContextClassLoader();
-			Thread.currentThread().setContextClassLoader(Activator.class.getClassLoader());
-			XmlUtils.createDocument();
-			Thread.currentThread().setContextClassLoader(prev);
-			
-			if ((soapProviderReference = context
-					.getServiceReference("org.apache.muse.osgi.soa.core.SOAPProvider")) != null) {
-				SOAPProvider soapProvider = (SOAPProvider)context.getService(soapProviderReference);
-				ResourceManagementAdminServiceImpl adminImpl = new ResourceManagementAdminServiceImpl(context, soapProvider);
-				Axis2Environment.setBundleContext(context);
-				adminService = adminImpl;
-				context.registerService(
-						"org.apache.muse.core.platform.osgi.ResourceManagementProvider",
-						adminService, new Hashtable());
-				enabled = true;
-			}
-			context.addServiceListener(this, SOAP_SERVICE_FILTER);
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw new BundleException("Failed to start server");
-		}
-	}
-
-	public void stop(BundleContext context) throws Exception {
-		if(soapProviderReference != null){
-			context.ungetService(soapProviderReference);
-			soapProviderReference = null;
-		}
-	}
-
-	public void serviceChanged(ServiceEvent event) {
-		ServiceReference ref = event.getServiceReference();
-		switch (event.getType()) {
-		case ServiceEvent.REGISTERED:
-			if (!enabled) {
-				try {
-					if ((soapProviderReference = context
-							.getServiceReference("org.apache.muse.osgi.soa.core.SOAPProvider")) != null) {
-						SOAPProvider soapProvider = (SOAPProvider)context.getService(soapProviderReference);
-						ResourceManagementAdminServiceImpl adminImpl = new ResourceManagementAdminServiceImpl(context, soapProvider);
-						Axis2Environment.setBundleContext(context);
-						adminService = adminImpl;
-						context.registerService(
-										"org.apache.muse.core.platform.osgi.ResourceManagementProvider",
-										adminService, new Hashtable());
-						enabled = true;
-					}
-				} catch (Throwable e) {
-					e.printStackTrace();
-				}
-			}
-			break;
-		case ServiceEvent.MODIFIED:
-			break;
-		case ServiceEvent.UNREGISTERING:
-			if (ref == soapProviderReference) {
-				enabled = false;
-			}
-			break;
-		}
-	}
-}
+/* 
+ * 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.muse.core.platform.osgi.axis2;
+
+import java.util.Hashtable;
+
+import org.apache.muse.core.platform.osgi.ResourceManagementProvider;
+import org.apache.muse.core.platform.osgi.axis2.internal.ResourceManagementAdminServiceImpl;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.apache.muse.osgi.soa.core.SOAPProvider;
+import org.apache.muse.util.xml.XmlUtils;
+
+/**
+ *
+ * Activator is ...
+ *
+ * @author Joel Hawkins (joelh)
+ *
+ */
+
+public class Activator implements BundleActivator, ServiceListener {
+
+	private ResourceManagementProvider adminService;
+
+	private BundleContext context;
+
+	private ServiceReference soapProviderReference = null;
+
+	private boolean enabled = false;
+
+	private static final String SOAP_SERVICE_FILTER = "(objectclass=org.apache.muse.osgi.soa.core.SOAPProvider)";
+
+	public void start(BundleContext context) throws Exception {
+		this.context = context;
+		try {
+			
+			//Intialize XMLUtils with this bundle's services.
+			ClassLoader prev = Thread.currentThread().getContextClassLoader();
+			Thread.currentThread().setContextClassLoader(Activator.class.getClassLoader());
+			XmlUtils.createDocument();
+			Thread.currentThread().setContextClassLoader(prev);
+			
+			if ((soapProviderReference = context
+					.getServiceReference("org.apache.muse.osgi.soa.core.SOAPProvider")) != null) {
+				SOAPProvider soapProvider = (SOAPProvider)context.getService(soapProviderReference);
+				ResourceManagementAdminServiceImpl adminImpl = new ResourceManagementAdminServiceImpl(context, soapProvider);
+				Axis2Environment.setBundleContext(context);
+				adminService = adminImpl;
+				context.registerService(
+						"org.apache.muse.core.platform.osgi.ResourceManagementProvider",
+						adminService, new Hashtable());
+				enabled = true;
+			}
+			context.addServiceListener(this, SOAP_SERVICE_FILTER);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new BundleException("Failed to start server");
+		}
+	}
+
+	public void stop(BundleContext context) throws Exception {
+		if(soapProviderReference != null){
+			context.ungetService(soapProviderReference);
+			soapProviderReference = null;
+		}
+	}
+
+	public void serviceChanged(ServiceEvent event) {
+		ServiceReference ref = event.getServiceReference();
+		switch (event.getType()) {
+		case ServiceEvent.REGISTERED:
+			if (!enabled) {
+				try {
+					if ((soapProviderReference = context
+							.getServiceReference("org.apache.muse.osgi.soa.core.SOAPProvider")) != null) {
+						SOAPProvider soapProvider = (SOAPProvider)context.getService(soapProviderReference);
+						ResourceManagementAdminServiceImpl adminImpl = new ResourceManagementAdminServiceImpl(context, soapProvider);
+						Axis2Environment.setBundleContext(context);
+						adminService = adminImpl;
+						context.registerService(
+										"org.apache.muse.core.platform.osgi.ResourceManagementProvider",
+										adminService, new Hashtable());
+						enabled = true;
+					}
+				} catch (Throwable e) {
+					e.printStackTrace();
+				}
+			}
+			break;
+		case ServiceEvent.MODIFIED:
+			break;
+		case ServiceEvent.UNREGISTERING:
+			if (ref == soapProviderReference) {
+				enabled = false;
+			}
+			break;
+		}
+	}
+}

Modified: webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/Axis2Environment.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/Axis2Environment.java?view=diff&rev=522017&r1=522016&r2=522017
==============================================================================
--- webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/Axis2Environment.java (original)
+++ webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/Axis2Environment.java Sat Mar 24 06:12:19 2007
@@ -1,308 +1,311 @@
-/*=============================================================================*
- *  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.core.platform.osgi.axis2;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.InetAddress;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.net.UnknownHostException;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.muse.core.AbstractEnvironment;
-import org.apache.muse.core.platform.axis2.AxisEnvironment;
-import org.apache.muse.core.platform.osgi.OSGiEnvironment;
-import org.apache.muse.core.platform.osgi.util.BundleRootHelper;
-import org.apache.muse.core.platform.osgi.util.OSGiReflectUtilHelper;
-import org.apache.muse.util.messages.Messages;
-import org.apache.muse.util.messages.MessagesFactory;
-import org.apache.muse.ws.addressing.EndpointReference;
-import org.apache.muse.ws.addressing.MessageHeaders;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.apache.muse.core.platform.osgi.OSGiPlatformConstants;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.OperationContext;
-
-/**
- *
- * Axis2Environment is an OSGi aware extension of the Muse AxisEnvironment. This class
- * implements the <code>OSGiEnvironment</code> interface, which allows the Muse environment 
- * to access the Bundle context of an executing thread.
- * 
- * @see OSGiEnvironment
- *
- * @author Joel Hawkins (joelh)
- *
- */
-
-public class Axis2Environment extends AxisEnvironment implements
-		OSGiEnvironment {
-
-	//
-	// Used to lookup all exception messages
-	//
-	private static Messages _MESSAGES = MessagesFactory.get(Axis2Environment.class);
-
-	//
-	// The name of the property that has the J2EE HttpServletRequest
-	//
-	private static final String _REQUEST_PROPERTY = "transport.http.servletRequest";
-
-	//
-	// The name of the property that has the J2EE ServletEndpointContext
-	//
-	private static final String _SEC_PROPERTY = "servletEndpointContext";
-
-	//
-	// The WAR installation directory
-	//
-	private File _realDirectory = null;
-
-	private boolean backLevelServletAPI = false;
-
-	private static BundleContext bundleContext;
-
-	private InheritableThreadLocal localEnvironmentContext = new InheritableThreadLocal();
-
-	/**
-	 * setter for the the bundle context of the hosting bundle.
-	 */
-	public static void setBundleContext(BundleContext context) {
-		bundleContext = context;
-	}
-
-	/**
-	 * getter for the Bundle corresponding to the executing thread
-	 * @return the current thread's Bundle
-	 */
-	public Bundle getThreadLocalBundle() {
-		return (Bundle) localEnvironmentContext.get();
-	}
-
-	/**
-	 * setter for the Bundle corresponding to the executing thread
-	 * @param bundle the current thread's Bundle
-	 */
-	public void setThreadLocalBundle(Bundle bundle) {
-		localEnvironmentContext.set(bundle);
-		OSGiReflectUtilHelper.getDefault().setThreadLocalBundle(bundle);
-	}
-    
-	public Axis2Environment() {
-        MessageHeaders wsa = convertContext();
-        addAddressingContext(wsa);
-        
-        String address = wsa.getToAddress().getAddress().toString();
-        setDefaultURI(getDeploymentURI(address));
-        //TODO enable real back-level servlet check
-		//int major = servletContext.getMajorVersion();
-		//int minor = servletContext.getMinorVersion();
-		//if (major <= 2 && minor <= 1)
-			backLevelServletAPI = true;
-          
-        MessageContext message = MessageContext.getCurrentMessageContext();
-		_realDirectory = message.getConfigurationContext().getRealPath("/");
-		//_realDirectory = new File(address);
-	}
-
-	public EndpointReference getDeploymentEPR() {
-		return super.getDeploymentEPR();
-	}
-	
-    public String getDefaultURI()
-    {
-    	String defaultURI = super.getDefaultURI();
-		OSGiReflectUtilHelper helper = OSGiReflectUtilHelper.getDefault();
-		Bundle bundle = helper.getThreadLocalBundle();
-		String context = BundleRootHelper.getContextForBundle(bundle);
-		if(context != null && defaultURI != null){
-			int first = defaultURI.indexOf("/",8);
-			defaultURI = defaultURI.substring(0,first+1);
-			defaultURI = defaultURI + context + "/services/blah";
-		}
-        return defaultURI;
-    }
-	
-
-	/**
-	 *
-	 * @param request
-	 *
-	 * @return The URI being targeted by the current request. This URI includes
-	 *         an IP address rather than a host name, because we often use it to
-	 *         create EPRs/URIs for remote users based on the results of a local
-	 *         request. Just because the initial request was local doesn't mean
-	 *         we should represent ourselves to remote users with a local name.
-	 *         It also means that remote systems don't have to have a hosts
-	 *         lookup that includes our endpoint's machine.
-	 *
-	 */
-	protected URI getDeploymentURI(HttpServletRequest request) {
-
-		String urlWithHostName = null;
-		String ip = null;
-		String eprContext = null;
-		Bundle bundle = getThreadLocalBundle();
-		if(bundle != null){
-			eprContext = (String)bundle.getHeaders().get(OSGiPlatformConstants.MANAGEMENT_CONTEXT_HEADER);
-		}
-
-		String portString = "";
-		int serverPort = request.getServerPort();
-		if(serverPort != 80){
-			portString = ":" + Integer.toString(serverPort, 10);
-		}
-
-		if (!this.backLevelServletAPI) {
-			urlWithHostName = request.getRequestURL().toString();
-		} else {
-			urlWithHostName = request.getRequestURI().toString();
-			String pathInfo = request.getPathInfo();
-			String reqURI = request.getRequestURI();
-			urlWithHostName = "http://blah" +portString+ urlWithHostName;
-		}
-
-		try {
-			ip = InetAddress.getLocalHost().getHostAddress();
-			if(portString.length() > 0) ip = ip.concat(portString);
-		}
-
-		catch (UnknownHostException error) {
-			throw new RuntimeException(error);
-		}
-
-		int start = urlWithHostName.indexOf("://") + 3;
-		int end = urlWithHostName.indexOf('/', start);
-
-		int port = urlWithHostName.indexOf(':', start);
-
-		//
-		// check for port - we don't want to lose that in the replacement
-		//
-		if (port >= 0 && port < end)
-			end = port;
-
-		StringBuffer urlWithIP = new StringBuffer(urlWithHostName.length());
-		urlWithIP.append(urlWithHostName.substring(0, start));
-		urlWithIP.append(ip);
-		if(eprContext == null) urlWithIP.append(urlWithHostName.substring(end));
-		else{
-			urlWithIP.append("/"+eprContext);
-			int servicesStart = urlWithHostName.indexOf("/services/");
-			urlWithIP.append(urlWithHostName.substring(servicesStart));
-		}
-
-		return URI.create(urlWithIP.toString());
-	}
-
-	/**
-	 * @return A <File> object corresponding to the executing thread's Bundle's 
-	 * root directory. This method uses the <code>BundleRootHelper</code> class 
-	 * to resolve the root directory.
-	 * 
-	 * @see BundleRootHelper
-	 */
-	public File getRealDirectory() {
-		Bundle bundle = getThreadLocalBundle();
-		if(bundle != null) {
-			File root = BundleRootHelper.getRootForBundle(bundle);
-			if(root != null) return root;
-		}
-		return _realDirectory;
-	}
-
-	/**
-	 * 
-	 */
-	public URL getDataResource(String path) {
-		if (path == null)
-			throw new NullPointerException(_MESSAGES.get("NullResourcePath"));
-
-		File file = new File(_realDirectory, path);
-
-		try {
-			return file.toURL();
-		}
-
-		catch (MalformedURLException error) {
-			throw new RuntimeException(error);
-		}
-	}
-
-	/**
-	 * this method returns an InputStream for a resource based on the 
-	 * executing thread's Bundle context.
-	 * @param path the path to the resource
-	 * @return an <code>InputStream</code> corresponding to the resource if the resource is found,
-	 * otherwise <code>null</code>
-	 */
-	public InputStream getDataResourceStream(String path) {
-		if (path == null)
-			throw new NullPointerException("NullResourcePath");
-
-		InputStream input = null;
-		Bundle bundle = getThreadLocalBundle();
-		if (bundle != null) {
-			URL url = bundle.getResource(path);
-			if (url != null) {
-				try {
-					input = url.openStream();
-				} catch (IOException ioe) {
-					input = null;
-				}
-			}
-		}
-		
-		if (input == null)
-			input = this.getClass().getResourceAsStream(path);
-		if (input == null)
-			input = this.getClass().getResourceAsStream("/OSGI-INF/" + path);
-		if (input == null){
-			input = OSGiReflectUtilHelper.getDefault().getResource(path);
-		}
-		if(input == null && bundle != null){
-			try {
-				File file = BundleRootHelper.getRootForBundle(bundle);
-				File lastTry = new File(file.getAbsolutePath() +"/"+ path);
-				input = new FileInputStream(lastTry);
-			} catch(Throwable t){
-				throw new RuntimeException(t.getMessage(), t);
-			}
-		}
-		return input;
-
-	}
-	
-    protected File createRealDirectoryFromContext(){
-    	return null;
-    }
-    
-    protected File createRealDirectory(){
-    	//There is no real use for this, but we can't return a 'null', as the rest of 
-    	//Muse's initialization will fail
-    	return bundleContext.getDataFile("");    	
-    }
-
-}
+/* 
+ * 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.muse.core.platform.osgi.axis2;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.InetAddress;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.net.UnknownHostException;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.muse.core.AbstractEnvironment;
+import org.apache.muse.core.platform.axis2.AxisEnvironment;
+import org.apache.muse.core.platform.osgi.OSGiEnvironment;
+import org.apache.muse.core.platform.osgi.util.BundleRootHelper;
+import org.apache.muse.core.platform.osgi.util.OSGiReflectUtilHelper;
+import org.apache.muse.util.messages.Messages;
+import org.apache.muse.util.messages.MessagesFactory;
+import org.apache.muse.ws.addressing.EndpointReference;
+import org.apache.muse.ws.addressing.MessageHeaders;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.apache.muse.core.platform.osgi.OSGiPlatformConstants;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
+
+/**
+ *
+ * Axis2Environment is an OSGi aware extension of the Muse AxisEnvironment. This class
+ * implements the <code>OSGiEnvironment</code> interface, which allows the Muse environment 
+ * to access the Bundle context of an executing thread.
+ * 
+ * @see OSGiEnvironment
+ *
+ * @author Joel Hawkins (joelh)
+ *
+ */
+
+public class Axis2Environment extends AxisEnvironment implements
+		OSGiEnvironment {
+
+	//
+	// Used to lookup all exception messages
+	//
+	private static Messages _MESSAGES = MessagesFactory.get(Axis2Environment.class);
+
+	//
+	// The name of the property that has the J2EE HttpServletRequest
+	//
+	private static final String _REQUEST_PROPERTY = "transport.http.servletRequest";
+
+	//
+	// The name of the property that has the J2EE ServletEndpointContext
+	//
+	private static final String _SEC_PROPERTY = "servletEndpointContext";
+
+	//
+	// The WAR installation directory
+	//
+	private File _realDirectory = null;
+
+	private boolean backLevelServletAPI = false;
+
+	private static BundleContext bundleContext;
+
+	private InheritableThreadLocal localEnvironmentContext = new InheritableThreadLocal();
+
+	/**
+	 * setter for the the bundle context of the hosting bundle.
+	 */
+	public static void setBundleContext(BundleContext context) {
+		bundleContext = context;
+	}
+
+	/**
+	 * getter for the Bundle corresponding to the executing thread
+	 * @return the current thread's Bundle
+	 */
+	public Bundle getThreadLocalBundle() {
+		return (Bundle) localEnvironmentContext.get();
+	}
+
+	/**
+	 * setter for the Bundle corresponding to the executing thread
+	 * @param bundle the current thread's Bundle
+	 */
+	public void setThreadLocalBundle(Bundle bundle) {
+		localEnvironmentContext.set(bundle);
+		OSGiReflectUtilHelper.getDefault().setThreadLocalBundle(bundle);
+	}
+    
+	public Axis2Environment() {
+        MessageHeaders wsa = convertContext();
+        addAddressingContext(wsa);
+        
+        String address = wsa.getToAddress().getAddress().toString();
+        setDefaultURI(getDeploymentURI(address));
+        //TODO enable real back-level servlet check
+		//int major = servletContext.getMajorVersion();
+		//int minor = servletContext.getMinorVersion();
+		//if (major <= 2 && minor <= 1)
+			backLevelServletAPI = true;
+          
+        MessageContext message = MessageContext.getCurrentMessageContext();
+		_realDirectory = message.getConfigurationContext().getRealPath("/");
+		//_realDirectory = new File(address);
+	}
+
+	public EndpointReference getDeploymentEPR() {
+		return super.getDeploymentEPR();
+	}
+	
+    public String getDefaultURI()
+    {
+    	String defaultURI = super.getDefaultURI();
+		OSGiReflectUtilHelper helper = OSGiReflectUtilHelper.getDefault();
+		Bundle bundle = helper.getThreadLocalBundle();
+		String context = BundleRootHelper.getContextForBundle(bundle);
+		if(context != null && defaultURI != null){
+			int first = defaultURI.indexOf("/",8);
+			defaultURI = defaultURI.substring(0,first+1);
+			defaultURI = defaultURI + context + "/services/blah";
+		}
+        return defaultURI;
+    }
+	
+
+	/**
+	 *
+	 * @param request
+	 *
+	 * @return The URI being targeted by the current request. This URI includes
+	 *         an IP address rather than a host name, because we often use it to
+	 *         create EPRs/URIs for remote users based on the results of a local
+	 *         request. Just because the initial request was local doesn't mean
+	 *         we should represent ourselves to remote users with a local name.
+	 *         It also means that remote systems don't have to have a hosts
+	 *         lookup that includes our endpoint's machine.
+	 *
+	 */
+	protected URI getDeploymentURI(HttpServletRequest request) {
+
+		String urlWithHostName = null;
+		String ip = null;
+		String eprContext = null;
+		Bundle bundle = getThreadLocalBundle();
+		if(bundle != null){
+			eprContext = (String)bundle.getHeaders().get(OSGiPlatformConstants.MANAGEMENT_CONTEXT_HEADER);
+		}
+
+		String portString = "";
+		int serverPort = request.getServerPort();
+		if(serverPort != 80){
+			portString = ":" + Integer.toString(serverPort, 10);
+		}
+
+		if (!this.backLevelServletAPI) {
+			urlWithHostName = request.getRequestURL().toString();
+		} else {
+			urlWithHostName = request.getRequestURI().toString();
+			String pathInfo = request.getPathInfo();
+			String reqURI = request.getRequestURI();
+			urlWithHostName = "http://blah" +portString+ urlWithHostName;
+		}
+
+		try {
+			ip = InetAddress.getLocalHost().getHostAddress();
+			if(portString.length() > 0) ip = ip.concat(portString);
+		}
+
+		catch (UnknownHostException error) {
+			throw new RuntimeException(error);
+		}
+
+		int start = urlWithHostName.indexOf("://") + 3;
+		int end = urlWithHostName.indexOf('/', start);
+
+		int port = urlWithHostName.indexOf(':', start);
+
+		//
+		// check for port - we don't want to lose that in the replacement
+		//
+		if (port >= 0 && port < end)
+			end = port;
+
+		StringBuffer urlWithIP = new StringBuffer(urlWithHostName.length());
+		urlWithIP.append(urlWithHostName.substring(0, start));
+		urlWithIP.append(ip);
+		if(eprContext == null) urlWithIP.append(urlWithHostName.substring(end));
+		else{
+			urlWithIP.append("/"+eprContext);
+			int servicesStart = urlWithHostName.indexOf("/services/");
+			urlWithIP.append(urlWithHostName.substring(servicesStart));
+		}
+
+		return URI.create(urlWithIP.toString());
+	}
+
+	/**
+	 * @return A <File> object corresponding to the executing thread's Bundle's 
+	 * root directory. This method uses the <code>BundleRootHelper</code> class 
+	 * to resolve the root directory.
+	 * 
+	 * @see BundleRootHelper
+	 */
+	public File getRealDirectory() {
+		Bundle bundle = getThreadLocalBundle();
+		if(bundle != null) {
+			File root = BundleRootHelper.getRootForBundle(bundle);
+			if(root != null) return root;
+		}
+		return _realDirectory;
+	}
+
+	/**
+	 * 
+	 */
+	public URL getDataResource(String path) {
+		if (path == null)
+			throw new NullPointerException(_MESSAGES.get("NullResourcePath"));
+
+		File file = new File(_realDirectory, path);
+
+		try {
+			return file.toURL();
+		}
+
+		catch (MalformedURLException error) {
+			throw new RuntimeException(error);
+		}
+	}
+
+	/**
+	 * this method returns an InputStream for a resource based on the 
+	 * executing thread's Bundle context.
+	 * @param path the path to the resource
+	 * @return an <code>InputStream</code> corresponding to the resource if the resource is found,
+	 * otherwise <code>null</code>
+	 */
+	public InputStream getDataResourceStream(String path) {
+		if (path == null)
+			throw new NullPointerException("NullResourcePath");
+
+		InputStream input = null;
+		Bundle bundle = getThreadLocalBundle();
+		if (bundle != null) {
+			URL url = bundle.getResource(path);
+			if (url != null) {
+				try {
+					input = url.openStream();
+				} catch (IOException ioe) {
+					input = null;
+				}
+			}
+		}
+		
+		if (input == null)
+			input = this.getClass().getResourceAsStream(path);
+		if (input == null)
+			input = this.getClass().getResourceAsStream("/OSGI-INF/" + path);
+		if (input == null){
+			input = OSGiReflectUtilHelper.getDefault().getResource(path);
+		}
+		if(input == null && bundle != null){
+			try {
+				File file = BundleRootHelper.getRootForBundle(bundle);
+				File lastTry = new File(file.getAbsolutePath() +"/"+ path);
+				input = new FileInputStream(lastTry);
+			} catch(Throwable t){
+				throw new RuntimeException(t.getMessage(), t);
+			}
+		}
+		return input;
+
+	}
+	
+    protected File createRealDirectoryFromContext(){
+    	return null;
+    }
+    
+    protected File createRealDirectory(){
+    	//There is no real use for this, but we can't return a 'null', as the rest of 
+    	//Muse's initialization will fail
+    	return bundleContext.getDataFile("");    	
+    }
+
+}

Modified: webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/Axis2IsolationLayer.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/Axis2IsolationLayer.java?view=diff&rev=522017&r1=522016&r2=522017
==============================================================================
--- webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/Axis2IsolationLayer.java (original)
+++ webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/Axis2IsolationLayer.java Sat Mar 24 06:12:19 2007
@@ -1,100 +1,103 @@
-/*=============================================================================*
- *  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.core.platform.osgi.axis2;
-
-import org.apache.muse.core.Environment;
-import org.apache.muse.core.descriptor.DeploymentDescriptor;
-import org.apache.muse.core.platform.axis2.AxisIsolationLayer;
-import org.apache.muse.core.platform.osgi.descriptor.OSGiDeploymentDescriptor;
-import org.apache.muse.core.platform.osgi.util.OSGiReflectUtilHelper;
-import org.apache.muse.util.ReflectUtils;
-
-import org.apache.axis2.context.ServiceContext;
-
-/**
-*
-* Axis2IsolationLayer is an OSGi aware extension of the Muse AxisIsolationLayer. 
-* 
-* @author Joel Hawkins (joelh)
-*
-*/
-
-public class Axis2IsolationLayer extends AxisIsolationLayer {
-
-	protected boolean initializing = false;
-	protected boolean initialized = false;
-
-	private static Axis2IsolationLayer _instance = null;
-
-	public static Axis2IsolationLayer getInstance(){
-        _instance = new Axis2IsolationLayer();
-		return _instance;
-	}
-	
-	
-	public void init(ServiceContext serviceContext){
-		if(!initialized) initialize();
-	}
-
-	/**
-	 * performs initialzation of the IsolationLayer, and installs the
-	 * <code>OSGiReflectUtilHelper</code> singleton as the <code>ReflectUtils</code>
-	 * helper.
-	 * 
-	 * @see ReflectUtils
-	 * @see OSGiReflectUtilHelper
-	 */
-	public void initialize() {
-
-		if(initializing) return;
-
-		ClassLoader prev = Thread.currentThread().getContextClassLoader();
-		try {
-			initializing = true;
-			ReflectUtils.setHelper(OSGiReflectUtilHelper.getDefault());
-			Thread.currentThread().setContextClassLoader(
-					Axis2IsolationLayer.class.getClassLoader());
-			super.initialize();
-			initialized = true;
-		} catch (RuntimeException e) {
-			e.printStackTrace();
-			throw e;
-		} finally {
-			Thread.currentThread().setContextClassLoader(prev);
-		}
-	}
-
-	/**
-	 * @return an <code>Axis2Environment</code> instance
-	 * 
-	 * @see Axis2Environment
-	 */
-	protected Environment createEnvironment() {
-		return new Axis2Environment();
-	}
-
-	/**
-	 * @return an <code>OSGiDeploymentDescritpor</code> instance.
-	 * 
-	 * @see OSGiDeploymentDescriptor
-	 */
-	protected DeploymentDescriptor createDeploymentDescriptor() {
-		return new OSGiDeploymentDescriptor();
-	}
-
-}
+/* 
+ * 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.muse.core.platform.osgi.axis2;
+
+import org.apache.muse.core.Environment;
+import org.apache.muse.core.descriptor.DeploymentDescriptor;
+import org.apache.muse.core.platform.axis2.AxisIsolationLayer;
+import org.apache.muse.core.platform.osgi.descriptor.OSGiDeploymentDescriptor;
+import org.apache.muse.core.platform.osgi.util.OSGiReflectUtilHelper;
+import org.apache.muse.util.ReflectUtils;
+
+import org.apache.axis2.context.ServiceContext;
+
+/**
+*
+* Axis2IsolationLayer is an OSGi aware extension of the Muse AxisIsolationLayer. 
+* 
+* @author Joel Hawkins (joelh)
+*
+*/
+
+public class Axis2IsolationLayer extends AxisIsolationLayer {
+
+	protected boolean initializing = false;
+	protected boolean initialized = false;
+
+	private static Axis2IsolationLayer _instance = null;
+
+	public static Axis2IsolationLayer getInstance(){
+        _instance = new Axis2IsolationLayer();
+		return _instance;
+	}
+	
+	
+	public void init(ServiceContext serviceContext){
+		if(!initialized) initialize();
+	}
+
+	/**
+	 * performs initialzation of the IsolationLayer, and installs the
+	 * <code>OSGiReflectUtilHelper</code> singleton as the <code>ReflectUtils</code>
+	 * helper.
+	 * 
+	 * @see ReflectUtils
+	 * @see OSGiReflectUtilHelper
+	 */
+	public void initialize() {
+
+		if(initializing) return;
+
+		ClassLoader prev = Thread.currentThread().getContextClassLoader();
+		try {
+			initializing = true;
+			ReflectUtils.setHelper(OSGiReflectUtilHelper.getDefault());
+			Thread.currentThread().setContextClassLoader(
+					Axis2IsolationLayer.class.getClassLoader());
+			super.initialize();
+			initialized = true;
+		} catch (RuntimeException e) {
+			e.printStackTrace();
+			throw e;
+		} finally {
+			Thread.currentThread().setContextClassLoader(prev);
+		}
+	}
+
+	/**
+	 * @return an <code>Axis2Environment</code> instance
+	 * 
+	 * @see Axis2Environment
+	 */
+	protected Environment createEnvironment() {
+		return new Axis2Environment();
+	}
+
+	/**
+	 * @return an <code>OSGiDeploymentDescritpor</code> instance.
+	 * 
+	 * @see OSGiDeploymentDescriptor
+	 */
+	protected DeploymentDescriptor createDeploymentDescriptor() {
+		return new OSGiDeploymentDescriptor();
+	}
+
+}

Modified: webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/ResourceManagementAdminService.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/ResourceManagementAdminService.java?view=diff&rev=522017&r1=522016&r2=522017
==============================================================================
--- webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/ResourceManagementAdminService.java (original)
+++ webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/ResourceManagementAdminService.java Sat Mar 24 06:12:19 2007
@@ -1,33 +1,36 @@
-/*=============================================================================*
- *  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.core.platform.osgi.axis2;
-
-import org.apache.muse.core.platform.osgi.ResourceManagementProvider;
-
-/**
- *
- * ResourceManagementAdminService is ...
- *
- * @author Joel Hawkins (joelh)
- *
- */
-
-public interface ResourceManagementAdminService extends ResourceManagementProvider {
-
-
-}
+/* 
+ * 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.muse.core.platform.osgi.axis2;
+
+import org.apache.muse.core.platform.osgi.ResourceManagementProvider;
+
+/**
+ *
+ * ResourceManagementAdminService is ...
+ *
+ * @author Joel Hawkins (joelh)
+ *
+ */
+
+public interface ResourceManagementAdminService extends ResourceManagementProvider {
+
+
+}

Modified: webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/ResourceManagementProviderFactory.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/ResourceManagementProviderFactory.java?view=diff&rev=522017&r1=522016&r2=522017
==============================================================================
--- webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/ResourceManagementProviderFactory.java (original)
+++ webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/ResourceManagementProviderFactory.java Sat Mar 24 06:12:19 2007
@@ -1,73 +1,76 @@
-/*=============================================================================*
- *  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.core.platform.osgi.axis2;
-
-import org.apache.muse.core.platform.osgi.ResourceManagementProvider;
-
-/**
- *
- * ResourceManagementProviderFactory is ...
- *
- * @author Joel Hawkins (joelh)
- *
- */
-
-public class ResourceManagementProviderFactory {
-	private ResourceManagementProvider provider;
-
-	private static ResourceManagementProviderFactory sThis;
-
-	private ResourceManagementProviderFactory() {
-		sThis = this;
-	}
-
-	/**
-	 * Get the singleton instance of the ResourceManagementProviderFactory
-	 *
-	 * @return ResourceManagementProviderFactory object
-	 */
-	public static ResourceManagementProviderFactory getInstance() {
-		if (sThis == null) {
-			new ResourceManagementProviderFactory();
-		}
-		return sThis;
-	}
-
-	/**
-	 * Register the ResourceManagementProvider the this environment.
-	 *
-	 * @param provider
-	 */
-	public void registerManagementProvider(ResourceManagementProvider provider) {
-		this.provider = provider;
-	}
-
-	/**
-	 * Get the service deployer for this environment
-	 *
-	 * @return The registered service deployer
-	 */
-	public ResourceManagementProvider getManagementProvider() {
-		if (provider == null) {
-			throw new IllegalStateException(
-					"ResourceManagementProvider has not been registered");
-		}
-
-		return provider;
-	}
-}
+/* 
+ * 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.muse.core.platform.osgi.axis2;
+
+import org.apache.muse.core.platform.osgi.ResourceManagementProvider;
+
+/**
+ *
+ * ResourceManagementProviderFactory is ...
+ *
+ * @author Joel Hawkins (joelh)
+ *
+ */
+
+public class ResourceManagementProviderFactory {
+	private ResourceManagementProvider provider;
+
+	private static ResourceManagementProviderFactory sThis;
+
+	private ResourceManagementProviderFactory() {
+		sThis = this;
+	}
+
+	/**
+	 * Get the singleton instance of the ResourceManagementProviderFactory
+	 *
+	 * @return ResourceManagementProviderFactory object
+	 */
+	public static ResourceManagementProviderFactory getInstance() {
+		if (sThis == null) {
+			new ResourceManagementProviderFactory();
+		}
+		return sThis;
+	}
+
+	/**
+	 * Register the ResourceManagementProvider the this environment.
+	 *
+	 * @param provider
+	 */
+	public void registerManagementProvider(ResourceManagementProvider provider) {
+		this.provider = provider;
+	}
+
+	/**
+	 * Get the service deployer for this environment
+	 *
+	 * @return The registered service deployer
+	 */
+	public ResourceManagementProvider getManagementProvider() {
+		if (provider == null) {
+			throw new IllegalStateException(
+					"ResourceManagementProvider has not been registered");
+		}
+
+		return provider;
+	}
+}

Modified: webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/internal/Axis2ResourceManagementService.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/internal/Axis2ResourceManagementService.java?view=diff&rev=522017&r1=522016&r2=522017
==============================================================================
--- webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/internal/Axis2ResourceManagementService.java (original)
+++ webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/internal/Axis2ResourceManagementService.java Sat Mar 24 06:12:19 2007
@@ -1,131 +1,134 @@
-/*=============================================================================*
- *  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.core.platform.osgi.axis2.internal;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URL;
-
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLWriter;
-import javax.xml.namespace.QName;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.InOutAxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.wsdl.WSDLConstants;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.Constants;
-
-import org.osgi.framework.Bundle;
-
-/**
- * Axis2ResourceManagementService represents the Muse <code>IsolationLayer</code> to the Axis runtime.  
- * The service intializes an operation for the <code>IsolationLayer handleRequest</code> operation
- * and sets the message receiver for that operation to an instance of 
- * <code>OSGiRawXMLInOutMessageReceiver</code>
- * 
- * @see OSGiRawXMLInOutMessageReceiver
- * @see org.apache.muse.core.platform.IsolationLayer
- * 
- * @author Joel Hawkins
- *
- */
-public class Axis2ResourceManagementService extends AxisService {
-
-	private AxisOperation isolationLayerOperation;
-	private String wsdlPath;
-	private Bundle bundle;
-
-	/**
-	 * Constructs the service and initializes an operation for the 
-	 * <code>IsolationLayer handleRequest</code> operation  
-	 */
-	public Axis2ResourceManagementService(AxisConfiguration axisConfig){
-		super();
-		isolationLayerOperation = new InOutAxisOperation();
-		isolationLayerOperation.setName(new QName("handleRequest"));
-		isolationLayerOperation.setMessageReceiver(new OSGiRawXMLInOutMessageReceiver());
-		Parameter sendStackTrace = axisConfig.getParameter(Constants.Configuration.SEND_STACKTRACE_DETAILS_WITH_FAULTS);
-		if(sendStackTrace == null){
-			sendStackTrace = new Parameter(Constants.Configuration.SEND_STACKTRACE_DETAILS_WITH_FAULTS,new Boolean(false));
-		}
-		try {
-			isolationLayerOperation.addParameter(sendStackTrace);
-		}catch(AxisFault fault){
-			//Nothing to do here - best effort case
-		}
-
-	}
-
-	/**
-	 * gets the requested operation from this service. If no operation is found,  
-	 * the <code>handleRequest</code> operation is returned.
-	 * @param operationName  the QName of the requested operation
-	 * @return the <code>AxisOperation</code> corresponding to the <code>operationName</code> or
-	 *         the <code>handleOperation</code> if the <code>operationName</code> is not found   
-	 */
-    public AxisOperation getOperation(QName operationName) {
-      AxisOperation axisOperation = super.getOperation(operationName);
-
-      if (axisOperation == null) {
-          axisOperation = isolationLayerOperation;
-      }
-
-      return axisOperation;
-    }
-    
-    public void setWSDLPath(String wsdlPath){
-    	this.wsdlPath = wsdlPath;
-    }
-    
-    public void setBundle(Bundle bundle){
-    	this.bundle = bundle;
-    }
-    
-    public void printWSDL(OutputStream out, String requestIP, String servicePath) throws AxisFault {
-    	if(wsdlPath != null && bundle != null){
-    		try {
-    			URL wsdlURL = bundle.getResource(wsdlPath);
-    			if(wsdlURL != null){
-    				InputStream stream = wsdlURL.openStream();
-    				byte buffer[] = new byte[512];
-    				int read = 0;
-    				while((read = stream.read(buffer)) > 0){
-    					out.write(buffer, 0, read);
-    				}
-    			}
-    		} catch(Throwable t){
-    			//prints an error message...
-    			//TODO - uncomment once we get a real Axis2 1.1
-    			//super.printWSDL(out, requestIP, servicePath);
-    			throw new AxisFault("Wsdl not found for " + servicePath);
-    		}
-    	}else {
-			//TODO - uncomment once we get a real Axis2 1.1
-			//super.printWSDL(out, requestIP, servicePath);
-			throw new AxisFault("Wsdl not found for " + servicePath);
-    	}
-    }
-  
-}
+/* 
+ * 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.muse.core.platform.osgi.axis2.internal;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLWriter;
+import javax.xml.namespace.QName;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.InOutAxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.wsdl.WSDLConstants;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.Constants;
+
+import org.osgi.framework.Bundle;
+
+/**
+ * Axis2ResourceManagementService represents the Muse <code>IsolationLayer</code> to the Axis runtime.  
+ * The service intializes an operation for the <code>IsolationLayer handleRequest</code> operation
+ * and sets the message receiver for that operation to an instance of 
+ * <code>OSGiRawXMLInOutMessageReceiver</code>
+ * 
+ * @see OSGiRawXMLInOutMessageReceiver
+ * @see org.apache.muse.core.platform.IsolationLayer
+ * 
+ * @author Joel Hawkins
+ *
+ */
+public class Axis2ResourceManagementService extends AxisService {
+
+	private AxisOperation isolationLayerOperation;
+	private String wsdlPath;
+	private Bundle bundle;
+
+	/**
+	 * Constructs the service and initializes an operation for the 
+	 * <code>IsolationLayer handleRequest</code> operation  
+	 */
+	public Axis2ResourceManagementService(AxisConfiguration axisConfig){
+		super();
+		isolationLayerOperation = new InOutAxisOperation();
+		isolationLayerOperation.setName(new QName("handleRequest"));
+		isolationLayerOperation.setMessageReceiver(new OSGiRawXMLInOutMessageReceiver());
+		Parameter sendStackTrace = axisConfig.getParameter(Constants.Configuration.SEND_STACKTRACE_DETAILS_WITH_FAULTS);
+		if(sendStackTrace == null){
+			sendStackTrace = new Parameter(Constants.Configuration.SEND_STACKTRACE_DETAILS_WITH_FAULTS,new Boolean(false));
+		}
+		try {
+			isolationLayerOperation.addParameter(sendStackTrace);
+		}catch(AxisFault fault){
+			//Nothing to do here - best effort case
+		}
+
+	}
+
+	/**
+	 * gets the requested operation from this service. If no operation is found,  
+	 * the <code>handleRequest</code> operation is returned.
+	 * @param operationName  the QName of the requested operation
+	 * @return the <code>AxisOperation</code> corresponding to the <code>operationName</code> or
+	 *         the <code>handleOperation</code> if the <code>operationName</code> is not found   
+	 */
+    public AxisOperation getOperation(QName operationName) {
+      AxisOperation axisOperation = super.getOperation(operationName);
+
+      if (axisOperation == null) {
+          axisOperation = isolationLayerOperation;
+      }
+
+      return axisOperation;
+    }
+    
+    public void setWSDLPath(String wsdlPath){
+    	this.wsdlPath = wsdlPath;
+    }
+    
+    public void setBundle(Bundle bundle){
+    	this.bundle = bundle;
+    }
+    
+    public void printWSDL(OutputStream out, String requestIP, String servicePath) throws AxisFault {
+    	if(wsdlPath != null && bundle != null){
+    		try {
+    			URL wsdlURL = bundle.getResource(wsdlPath);
+    			if(wsdlURL != null){
+    				InputStream stream = wsdlURL.openStream();
+    				byte buffer[] = new byte[512];
+    				int read = 0;
+    				while((read = stream.read(buffer)) > 0){
+    					out.write(buffer, 0, read);
+    				}
+    			}
+    		} catch(Throwable t){
+    			//prints an error message...
+    			//TODO - uncomment once we get a real Axis2 1.1
+    			//super.printWSDL(out, requestIP, servicePath);
+    			throw new AxisFault("Wsdl not found for " + servicePath);
+    		}
+    	}else {
+			//TODO - uncomment once we get a real Axis2 1.1
+			//super.printWSDL(out, requestIP, servicePath);
+			throw new AxisFault("Wsdl not found for " + servicePath);
+    	}
+    }
+  
+}

Modified: webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/internal/OSGiRawXMLInOutMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/internal/OSGiRawXMLInOutMessageReceiver.java?view=diff&rev=522017&r1=522016&r2=522017
==============================================================================
--- webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/internal/OSGiRawXMLInOutMessageReceiver.java (original)
+++ webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/internal/OSGiRawXMLInOutMessageReceiver.java Sat Mar 24 06:12:19 2007
@@ -1,45 +1,49 @@
-/*=============================================================================*
- *  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.core.platform.osgi.axis2.internal;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.receivers.RawXMLINOutMessageReceiver;
-import org.apache.muse.core.platform.osgi.axis2.Axis2IsolationLayer;
-
-/**
- *
- * OSGiRawXMLInOutMessageReceiver extends the Axis2 <code>RawXMLINOutMessageReceiver</code>
- * to act as a factory for creating Axis2IsolationLayer instances
- *
- * @see org.apache.muse.core.platform.osgi.axis2.Axis2IsolationLayer
- * @author Joel Hawkins (joelh)
- *
- */
-
-public class OSGiRawXMLInOutMessageReceiver extends RawXMLINOutMessageReceiver {
-
-	/**
-	 * returns the <code>Axis2IsolationLayer</code> instance.
-	 * @param msgContext  the Axis2 message context for a service request
-	 * @return            the <code>Axis2IsolationLayer</code> instance
-	 */
-	protected Object getTheImplementationObject(MessageContext msgContext) throws AxisFault {
-    	return Axis2IsolationLayer.getInstance();
-    }
-
-}
+/* 
+ * 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.muse.core.platform.osgi.axis2.internal;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.receivers.RawXMLINOutMessageReceiver;
+import org.apache.muse.core.platform.osgi.axis2.Axis2IsolationLayer;
+
+/**
+ *
+ * OSGiRawXMLInOutMessageReceiver extends the Axis2 <code>RawXMLINOutMessageReceiver</code>
+ * to act as a factory for creating Axis2IsolationLayer instances
+ *
+ * @see org.apache.muse.core.platform.osgi.axis2.Axis2IsolationLayer
+ * @author Joel Hawkins (joelh)
+ *
+ */
+
+public class OSGiRawXMLInOutMessageReceiver extends RawXMLINOutMessageReceiver {
+
+	/**
+	 * returns the <code>Axis2IsolationLayer</code> instance.
+	 * @param msgContext  the Axis2 message context for a service request
+	 * @return            the <code>Axis2IsolationLayer</code> instance
+	 */
+	protected Object getTheImplementationObject(MessageContext msgContext) throws AxisFault {
+    	return Axis2IsolationLayer.getInstance();
+    }
+
+}

Modified: webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/internal/ResourceManagementAdminServiceImpl.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/internal/ResourceManagementAdminServiceImpl.java?view=diff&rev=522017&r1=522016&r2=522017
==============================================================================
--- webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/internal/ResourceManagementAdminServiceImpl.java (original)
+++ webservices/muse/trunk/modules/muse-osgi-soa-axis2/src/org/apache/muse/core/platform/osgi/axis2/internal/ResourceManagementAdminServiceImpl.java Sat Mar 24 06:12:19 2007
@@ -1,106 +1,109 @@
-/*=============================================================================*
- *  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.core.platform.osgi.axis2.internal;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.xml.soap.SOAPException;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.Constants;
-import org.apache.axis2.description.Parameter;
-import org.apache.muse.core.platform.osgi.ResourceManagementProvider;
-import org.apache.muse.osgi.soa.core.SOAPProvider;
-import org.apache.muse.osgi.soa.core.web.WebApp;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Bundle;
-
-/**
- *
- * ResourceManagementAdminServiceImpl administers the interaction between the OSGi-hosted
- * Muse Axis2 environment and an OSGi service that provides the actual Axis2 runtime environment
- *
- * @see ResourceManagementProvider
- * @see ResourceManagementAdminService
- * @author Joel Hawkins (joelh)
- *
- */
-public class ResourceManagementAdminServiceImpl implements ResourceManagementProvider {
-
-	public static final String DEFAULT_CONTEXT = "management";
-
-	private BundleContext context;
-	private Bundle bundle;
-	private SOAPProvider provider;
-
-	public ResourceManagementAdminServiceImpl(BundleContext context, SOAPProvider provider){
-		this.context = context;
-		this.provider = provider;
-	}
-
-	public void intializeContext(Bundle bundle, String contextPath) throws Exception{
-		WebApp webApp = null;
-		if (contextPath != null) {
-			webApp = provider.getWebApp(bundle, contextPath, true);
-		}
-	}
-
-
-	public void deployManagementService(Bundle bundle, String homeName, String wsdlPath) throws SOAPException {
-		deployManagementService(bundle, DEFAULT_CONTEXT, homeName);
-	}
-
-
-	public void deployManagementService(Bundle bundle, String contextPath, String srvName, String wsdlPath) throws SOAPException {
-		WebApp webApp = null;
-		if (contextPath != null) {
-			try {
-				webApp = provider.getWebApp(bundle, contextPath, true);
-			} catch (Exception e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-			}
-		}
-
-		// rename all references to service name
-		try {
-			
-			ConfigurationContext context = (ConfigurationContext)provider.getProviderDeployer(webApp);
-			AxisConfiguration axisConfig = context.getAxisConfiguration();
-			Axis2ResourceManagementService service = new Axis2ResourceManagementService(axisConfig);
-			service.setName(srvName);
-			service.setWSDLPath(wsdlPath);
-			service.setBundle(bundle);
-			service.setScope(Constants.SCOPE_APPLICATION);
-			try {
-				service.setFileName(new URL("file",contextPath, srvName));
-			} catch (MalformedURLException e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-			}
-			axisConfig.addService(service);
-		} catch (AxisFault se){
-			se.printStackTrace();
-		} catch(Throwable t){
-			t.printStackTrace();
-		}
-	}
-}
+/* 
+ * 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.muse.core.platform.osgi.axis2.internal;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.soap.SOAPException;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.Constants;
+import org.apache.axis2.description.Parameter;
+import org.apache.muse.core.platform.osgi.ResourceManagementProvider;
+import org.apache.muse.osgi.soa.core.SOAPProvider;
+import org.apache.muse.osgi.soa.core.web.WebApp;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Bundle;
+
+/**
+ *
+ * ResourceManagementAdminServiceImpl administers the interaction between the OSGi-hosted
+ * Muse Axis2 environment and an OSGi service that provides the actual Axis2 runtime environment
+ *
+ * @see ResourceManagementProvider
+ * @see ResourceManagementAdminService
+ * @author Joel Hawkins (joelh)
+ *
+ */
+public class ResourceManagementAdminServiceImpl implements ResourceManagementProvider {
+
+	public static final String DEFAULT_CONTEXT = "management";
+
+	private BundleContext context;
+	private Bundle bundle;
+	private SOAPProvider provider;
+
+	public ResourceManagementAdminServiceImpl(BundleContext context, SOAPProvider provider){
+		this.context = context;
+		this.provider = provider;
+	}
+
+	public void intializeContext(Bundle bundle, String contextPath) throws Exception{
+		WebApp webApp = null;
+		if (contextPath != null) {
+			webApp = provider.getWebApp(bundle, contextPath, true);
+		}
+	}
+
+
+	public void deployManagementService(Bundle bundle, String homeName, String wsdlPath) throws SOAPException {
+		deployManagementService(bundle, DEFAULT_CONTEXT, homeName);
+	}
+
+
+	public void deployManagementService(Bundle bundle, String contextPath, String srvName, String wsdlPath) throws SOAPException {
+		WebApp webApp = null;
+		if (contextPath != null) {
+			try {
+				webApp = provider.getWebApp(bundle, contextPath, true);
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+
+		// rename all references to service name
+		try {
+			
+			ConfigurationContext context = (ConfigurationContext)provider.getProviderDeployer(webApp);
+			AxisConfiguration axisConfig = context.getAxisConfiguration();
+			Axis2ResourceManagementService service = new Axis2ResourceManagementService(axisConfig);
+			service.setName(srvName);
+			service.setWSDLPath(wsdlPath);
+			service.setBundle(bundle);
+			service.setScope(Constants.SCOPE_APPLICATION);
+			try {
+				service.setFileName(new URL("file",contextPath, srvName));
+			} catch (MalformedURLException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+			axisConfig.addService(service);
+		} catch (AxisFault se){
+			se.printStackTrace();
+		} catch(Throwable t){
+			t.printStackTrace();
+		}
+	}
+}

Modified: webservices/muse/trunk/modules/muse-osgi-soa-core/src/org/apache/muse/osgi/soa/core/Activator.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-osgi-soa-core/src/org/apache/muse/osgi/soa/core/Activator.java?view=diff&rev=522017&r1=522016&r2=522017
==============================================================================
--- webservices/muse/trunk/modules/muse-osgi-soa-core/src/org/apache/muse/osgi/soa/core/Activator.java (original)
+++ webservices/muse/trunk/modules/muse-osgi-soa-core/src/org/apache/muse/osgi/soa/core/Activator.java Sat Mar 24 06:12:19 2007
@@ -1,46 +1,50 @@
-/*=============================================================================*
- *  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.soa.core;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-/**
- *
- * Activator is the Bundle Activator for the SOAP Provider API bundle 
- *
- * @author Joel Hawkins (joelh)
- *
- */
-
-public class Activator implements BundleActivator {
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
-	 */
-	public void start(BundleContext context) throws Exception {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
-	 */
-	public void stop(BundleContext context) throws Exception {
-	}
-
-}
+/* 
+ * 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.muse.osgi.soa.core;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ *
+ * Activator is the Bundle Activator for the SOAP Provider API bundle 
+ *
+ * @author Joel Hawkins (joelh)
+ *
+ */
+
+public class Activator implements BundleActivator {
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+	}
+
+}

Modified: webservices/muse/trunk/modules/muse-osgi-soa-core/src/org/apache/muse/osgi/soa/core/BundleClassResolver.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-osgi-soa-core/src/org/apache/muse/osgi/soa/core/BundleClassResolver.java?view=diff&rev=522017&r1=522016&r2=522017
==============================================================================
--- webservices/muse/trunk/modules/muse-osgi-soa-core/src/org/apache/muse/osgi/soa/core/BundleClassResolver.java (original)
+++ webservices/muse/trunk/modules/muse-osgi-soa-core/src/org/apache/muse/osgi/soa/core/BundleClassResolver.java Sat Mar 24 06:12:19 2007
@@ -1,34 +1,38 @@
-/*=============================================================================*
- *  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.soa.core;
-
-import org.osgi.framework.Bundle;
-
-/**
- *
- * BundleClassResolver is an interface for SOAPProviders to use for creating class to 
- * Bundle mappings for supporting JAX-RPC style bindings to OSGi hosted classes.
- *
- * @author Joel Hawkins (joelh)
- *
- */
-
-public interface BundleClassResolver {
-	Bundle getResolverBundle(String className);
-	void registerClass(String className, Bundle bundle) throws Exception;
-	Object getInstance(String className) throws Exception;
-}
+/* 
+ * 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.muse.osgi.soa.core;
+
+import org.osgi.framework.Bundle;
+
+/**
+ *
+ * BundleClassResolver is an interface for SOAPProviders to use for creating class to 
+ * Bundle mappings for supporting JAX-RPC style bindings to OSGi hosted classes.
+ *
+ * @author Joel Hawkins (joelh)
+ *
+ */
+
+public interface BundleClassResolver {
+	Bundle getResolverBundle(String className);
+	void registerClass(String className, Bundle bundle) throws Exception;
+	Object getInstance(String className) throws Exception;
+}



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