You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jb...@apache.org on 2006/09/17 23:15:28 UTC

svn commit: r447147 - in /incubator/tuscany/java/sca: kernel/host-api/src/main/java/org/apache/tuscany/host/runtime/ runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/ runtime/webapp-host/src/test/java/org/apache/tuscany/runtime/webap...

Author: jboynes
Date: Sun Sep 17 14:15:27 2006
New Revision: 447147

URL: http://svn.apache.org/viewvc?view=rev&rev=447147
Log:
factor common runtime interface out from webapp host

Added:
    incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/runtime/
    incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/runtime/TuscanyRuntime.java   (with props)
Modified:
    incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/WebappRuntimeImpl.java
    incubator/tuscany/java/sca/runtime/webapp-host/src/test/java/org/apache/tuscany/runtime/webapp/WebappRuntimeImplTestCase.java
    incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/TuscanyContextListener.java
    incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/WebappRuntime.java
    incubator/tuscany/java/sca/runtime/webapp/src/test/java/org/apache/tuscany/runtime/webapp/TuscanyContextListenerTestCase.java

Added: incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/runtime/TuscanyRuntime.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/runtime/TuscanyRuntime.java?view=auto&rev=447147
==============================================================================
--- incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/runtime/TuscanyRuntime.java (added)
+++ incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/runtime/TuscanyRuntime.java Sun Sep 17 14:15:27 2006
@@ -0,0 +1,79 @@
+/*
+ * 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.tuscany.host.runtime;
+
+import java.net.URL;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface TuscanyRuntime {
+    /**
+     * Returns the location of the SCDL used to boot this runtime.
+     *
+     * @return the location of the SCDL used to boot this runtime
+     */
+    URL getSystemScdl();
+
+    /**
+     * Sets the location of the SCDL used to boot this runtime.
+     *
+     * @param systemScdl the location of the SCDL used to boot this runtime
+     */
+    void setSystemScdl(URL systemScdl);
+
+    /**
+     * Returns the location of the default application's SCDL.
+     *
+     * @return the location of the default application's SCDL
+     */
+    URL getApplicationScdl();
+
+    /**
+     * Sets the location of the default application's SCDL
+     *
+     * @param applicationScdl the location of the default application's SCDL
+     */
+    void setApplicationScdl(URL applicationScdl);
+
+    /**
+     * Returns the host ClassLoader that is parent to all Tuscany classloaders.
+     *
+     * @return the host's ClassLoader
+     */
+    ClassLoader getHostClassLoader();
+
+    /**
+     * Sets the host ClassLoader; this will be a parent for all Tuscany classloaders.
+     *
+     * @param classLoader the host's ClassLoader
+     */
+    void setHostClassLoader(ClassLoader classLoader);
+
+    /**
+     * Initialize a runtime.
+     *
+     */
+    void initialize();
+
+    /**
+     * Destroy the runtime. Any further invocations should result in an error.
+     */
+    void destroy();
+}

Propchange: incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/runtime/TuscanyRuntime.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/runtime/TuscanyRuntime.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/WebappRuntimeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/WebappRuntimeImpl.java?view=diff&rev=447147&r1=447146&r2=447147
==============================================================================
--- incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/WebappRuntimeImpl.java (original)
+++ incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/WebappRuntimeImpl.java Sun Sep 17 14:15:27 2006
@@ -106,11 +106,11 @@
         this.applicationScdl = applicationScdl;
     }
 
-    public ClassLoader getWebappClassLoader() {
+    public ClassLoader getHostClassLoader() {
         return webappClassLoader;
     }
 
-    public void setWebappClassLoader(ClassLoader webappClassLoader) {
+    public void setHostClassLoader(ClassLoader webappClassLoader) {
         this.webappClassLoader = webappClassLoader;
     }
 

Modified: incubator/tuscany/java/sca/runtime/webapp-host/src/test/java/org/apache/tuscany/runtime/webapp/WebappRuntimeImplTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp-host/src/test/java/org/apache/tuscany/runtime/webapp/WebappRuntimeImplTestCase.java?view=diff&rev=447147&r1=447146&r2=447147
==============================================================================
--- incubator/tuscany/java/sca/runtime/webapp-host/src/test/java/org/apache/tuscany/runtime/webapp/WebappRuntimeImplTestCase.java (original)
+++ incubator/tuscany/java/sca/runtime/webapp-host/src/test/java/org/apache/tuscany/runtime/webapp/WebappRuntimeImplTestCase.java Sun Sep 17 14:15:27 2006
@@ -60,7 +60,7 @@
         context = createMock(ServletContext.class);
 
         runtime = new WebappRuntimeImpl();
-        runtime.setWebappClassLoader(getClass().getClassLoader());
+        runtime.setHostClassLoader(getClass().getClassLoader());
         runtime.setServletContext(context);
         runtime.setSystemScdl(systemScdl);
         runtime.setApplicationScdl(applicationScdl);

Modified: incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/TuscanyContextListener.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/TuscanyContextListener.java?view=diff&rev=447147&r1=447146&r2=447147
==============================================================================
--- incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/TuscanyContextListener.java (original)
+++ incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/TuscanyContextListener.java Sun Sep 17 14:15:27 2006
@@ -69,7 +69,7 @@
             URL applicationScdl = getApplicationScdl(servletContext, webappClassLoader);
 
             runtime.setServletContext(servletContext);
-            runtime.setWebappClassLoader(webappClassLoader);
+            runtime.setHostClassLoader(webappClassLoader);
             runtime.setSystemScdl(systemScdl);
             runtime.setApplicationScdl(applicationScdl);
             runtime.initialize();

Modified: incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/WebappRuntime.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/WebappRuntime.java?view=diff&rev=447147&r1=447146&r2=447147
==============================================================================
--- incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/WebappRuntime.java (original)
+++ incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/WebappRuntime.java Sun Sep 17 14:15:27 2006
@@ -18,13 +18,13 @@
  */
 package org.apache.tuscany.runtime.webapp;
 
-import java.net.URL;
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpSessionListener;
 
 import org.osoa.sca.SCA;
 
 import org.apache.tuscany.host.servlet.ServletRequestInjector;
+import org.apache.tuscany.host.runtime.TuscanyRuntime;
 
 /**
  * The contract for artifacts loaded in the web application classloader to comminicate with the Tuscany runtime loaded
@@ -35,7 +35,7 @@
  * @see TuscanyFilter
  * @see TuscanySessionListener
  */
-public interface WebappRuntime extends HttpSessionListener {
+public interface WebappRuntime extends HttpSessionListener, TuscanyRuntime {
     /**
      * Returns the ServletContext associated with this runtime.
      *
@@ -49,60 +49,6 @@
      * @param servletContext the ServletContext associated with this runtime
      */
     void setServletContext(ServletContext servletContext);
-
-    /**
-     * Returns the location of the SCDL used to boot this runtime.
-     *
-     * @return the location of the SCDL used to boot this runtime
-     */
-    URL getSystemScdl();
-
-    /**
-     * Sets the location of the SCDL used to boot this runtime.
-     *
-     * @param systemScdl the location of the SCDL used to boot this runtime
-     */
-    void setSystemScdl(URL systemScdl);
-
-    /**
-     * Returns the location of the default application's SCDL.
-     *
-     * @return the location of the default application's SCDL
-     */
-    URL getApplicationScdl();
-
-    /**
-     * Sets the location of the default application's SCDL
-     *
-     * @param applicationScdl the location of the default application's SCDL
-     */
-    void setApplicationScdl(URL applicationScdl);
-
-    /**
-     * Returns the web application's ClassLoader.
-     *
-     * @return the web application's ClassLoader
-     */
-    ClassLoader getWebappClassLoader();
-
-    /**
-     * Sets the web application's ClassLoader.
-     *
-     * @param webappClassLoader the web application's ClassLoader
-     */
-    void setWebappClassLoader(ClassLoader webappClassLoader);
-
-    /**
-     * Initialize a runtime for the supplied servlet context.
-     *
-     */
-    void initialize();
-
-    /**
-     * Destroy the runtime.
-     * Any further invocations should result in an error.
-     */
-    void destroy();
 
     /**
      * Returns the current SCA context

Modified: incubator/tuscany/java/sca/runtime/webapp/src/test/java/org/apache/tuscany/runtime/webapp/TuscanyContextListenerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp/src/test/java/org/apache/tuscany/runtime/webapp/TuscanyContextListenerTestCase.java?view=diff&rev=447147&r1=447146&r2=447147
==============================================================================
--- incubator/tuscany/java/sca/runtime/webapp/src/test/java/org/apache/tuscany/runtime/webapp/TuscanyContextListenerTestCase.java (original)
+++ incubator/tuscany/java/sca/runtime/webapp/src/test/java/org/apache/tuscany/runtime/webapp/TuscanyContextListenerTestCase.java Sun Sep 17 14:15:27 2006
@@ -58,7 +58,7 @@
             expect(listener.getRuntime(context, cl)).andReturn(runtime);
             replay(listener);
             runtime.setServletContext(context);
-            runtime.setWebappClassLoader(cl);
+            runtime.setHostClassLoader(cl);
             runtime.setSystemScdl(systemUrl);
             runtime.setApplicationScdl(applicationUrl);
             runtime.initialize();



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