tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r951242 - in /tuscany/sca-java-2.x/trunk/modules: implementation-widget-runtime/META-INF/ implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/ implementation-widget/META-INF/ implementation-widg...
Date Fri, 04 Jun 2010 02:38:55 GMT
Author: lresende
Date: Fri Jun  4 02:38:54 2010
New Revision: 951242

URL: http://svn.apache.org/viewvc?rev=951242&view=rev
Log:
TUSCANY-3565 - Registering dojo resource servlet only when implementation widget starts...

Added:
    tuscany/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/javascript/
    tuscany/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/javascript/WidgetImplementationJavascriptProvider.java
  (with props)
    tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.widget.javascript.WidgetImplementationJavascriptProvider
      - copied, changed from r951132, tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
Removed:
    tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoModuleActivator.java
    tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
Modified:
    tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/META-INF/MANIFEST.MF
    tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProvider.java
    tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProviderFactory.java
    tuscany/sca-java-2.x/trunk/modules/implementation-widget/META-INF/MANIFEST.MF
    tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/META-INF/MANIFEST.MF
    tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/pom.xml

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/META-INF/MANIFEST.MF?rev=951242&r1=951241&r2=951242&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/META-INF/MANIFEST.MF
(original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/META-INF/MANIFEST.MF
Fri Jun  4 02:38:54 2010
@@ -19,6 +19,7 @@ Import-Package: javax.servlet,
  org.apache.tuscany.sca.core;version="2.0.0",
  org.apache.tuscany.sca.host.http;version="2.0.0",
  org.apache.tuscany.sca.implementation.widget;version="2.0.0",
+ org.apache.tuscany.sca.implementation.widget.javascript;version="2.0.0",
  org.apache.tuscany.sca.implementation.widget.provider;version="2.0.0",
  org.apache.tuscany.sca.interfacedef;version="2.0.0",
  org.apache.tuscany.sca.invocation;version="2.0.0",

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProvider.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProvider.java?rev=951242&r1=951241&r2=951242&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProvider.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProvider.java
Fri Jun  4 02:38:54 2010
@@ -28,6 +28,7 @@ import org.apache.tuscany.sca.assembly.B
 import org.apache.tuscany.sca.assembly.ComponentService;
 import org.apache.tuscany.sca.host.http.ServletHost;
 import org.apache.tuscany.sca.implementation.widget.WidgetImplementation;
+import org.apache.tuscany.sca.implementation.widget.javascript.WidgetImplementationJavascriptProvider;
 import org.apache.tuscany.sca.interfacedef.Operation;
 import org.apache.tuscany.sca.invocation.Invoker;
 import org.apache.tuscany.sca.provider.ImplementationProvider;
@@ -46,6 +47,7 @@ class WidgetImplementationProvider imple
     
     private RuntimeComponent component;
     
+    private WidgetImplementationJavascriptProvider javascriptProvider;
     private ComponentJavaScriptGenerator javaScriptGenerator;
     private ServletHost servletHost;
     
@@ -59,9 +61,11 @@ class WidgetImplementationProvider imple
      * Constructs a new resource implementation provider.
      */
     WidgetImplementationProvider(RuntimeComponent component, 
-                                 WidgetImplementation implementation, 
+                                 WidgetImplementation implementation,
+                                 WidgetImplementationJavascriptProvider javascriptProvider,
                                  ComponentJavaScriptGenerator javaScriptGenerator, 
                                  ServletHost servletHost) {
+        
         this.component = component;
         
         this.javaScriptGenerator = javaScriptGenerator;
@@ -86,7 +90,6 @@ class WidgetImplementationProvider imple
     public void start() {
         String baseURI = getBaseURI();
 
-        // get the ScaDomainScriptServlet, if it doesn't yet exist create one
         // this uses removeServletMapping / addServletMapping as there is no getServletMapping
facility
         scriptURI = URI.create(baseURI + "/" + this.widgetName + ".js").toString();
         Servlet servlet = servletHost.getServletMapping(scriptURI);
@@ -95,6 +98,12 @@ class WidgetImplementationProvider imple
             widgetScriptServlet = new WidgetComponentScriptServlet(this.component, javaScriptGenerator);
             servletHost.addServletMapping(scriptURI, widgetScriptServlet);
         }     
+
+        // If added to the class path, start dojo provider
+        if(javascriptProvider != null) {
+            javascriptProvider.start();
+        }
+        
     }
 
     public void stop() {
@@ -104,6 +113,10 @@ class WidgetImplementationProvider imple
             // Remove the Servlet mapping
             servletHost.removeServletMapping(scriptURI);
         }
+        
+        if(javascriptProvider != null) {
+            javascriptProvider.stop();
+        }
     }
     
 

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProviderFactory.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProviderFactory.java?rev=951242&r1=951241&r2=951242&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProviderFactory.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-widget-runtime/src/main/java/org/apache/tuscany/sca/implementation/widget/provider/WidgetImplementationProviderFactory.java
Fri Jun  4 02:38:54 2010
@@ -19,9 +19,11 @@
 package org.apache.tuscany.sca.implementation.widget.provider;
 
 import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
 import org.apache.tuscany.sca.host.http.ServletHost;
 import org.apache.tuscany.sca.host.http.ServletHostHelper;
 import org.apache.tuscany.sca.implementation.widget.WidgetImplementation;
+import org.apache.tuscany.sca.implementation.widget.javascript.WidgetImplementationJavascriptProvider;
 import org.apache.tuscany.sca.provider.ImplementationProvider;
 import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
 import org.apache.tuscany.sca.runtime.RuntimeComponent;
@@ -35,21 +37,26 @@ import org.apache.tuscany.sca.web.javasc
  */
 public class WidgetImplementationProviderFactory implements ImplementationProviderFactory<WidgetImplementation>
{
     private ServletHost servletHost;
-    private ComponentJavaScriptGenerator javaScriptGenerator;
+    
+    private WidgetImplementationJavascriptProvider javascriptProvider;
+    private ComponentJavaScriptGenerator javascriptGenerator;
         
     /**
      * Constructs a resource implementation.
      */
-    public WidgetImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
-        this.servletHost = ServletHostHelper.getServletHost(extensionPoints);
+    public WidgetImplementationProviderFactory(ExtensionPointRegistry registry) {
+        this.servletHost = ServletHostHelper.getServletHost(registry);
+        
+        UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+        javascriptProvider = utilities.getUtility(WidgetImplementationJavascriptProvider.class);
         
-        ComponentJavaScriptGeneratorExtensionPoint javascriptGeneratorExtensionPoint = extensionPoints.getExtensionPoint(ComponentJavaScriptGeneratorExtensionPoint.class);
-        javaScriptGenerator = javascriptGeneratorExtensionPoint.getComponentJavaScriptGenerators().get(0);
+        ComponentJavaScriptGeneratorExtensionPoint javascriptGeneratorExtensionPoint = registry.getExtensionPoint(ComponentJavaScriptGeneratorExtensionPoint.class);
+        javascriptGenerator = javascriptGeneratorExtensionPoint.getComponentJavaScriptGenerators().get(0);
         
     }
 
     public ImplementationProvider createImplementationProvider(RuntimeComponent component,
WidgetImplementation implementation) {
-        return new WidgetImplementationProvider(component, implementation, javaScriptGenerator,
servletHost);
+        return new WidgetImplementationProvider(component, implementation, javascriptProvider,
javascriptGenerator, servletHost);
     }
     
     public Class<WidgetImplementation> getModelType() {

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-widget/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-widget/META-INF/MANIFEST.MF?rev=951242&r1=951241&r2=951242&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-widget/META-INF/MANIFEST.MF (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-widget/META-INF/MANIFEST.MF Fri Jun
 4 02:38:54 2010
@@ -6,7 +6,8 @@ Export-Package: org.apache.tuscany.sca.i
    org.apache.tuscany.sca.contribution.resolver,
    org.apache.tuscany.sca.contribution.processor,
    org.apache.tuscany.sca.core,
-   javax.xml.namespace"
+   javax.xml.namespace",
+ org.apache.tuscany.sca.implementation.widget.javascript;version="2.0.0"
 SCA-Version: 1.1
 Bundle-Name: Apache Tuscany SCA Widget Implementation Model
 Bundle-Vendor: The Apache Software Foundation

Added: tuscany/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/javascript/WidgetImplementationJavascriptProvider.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/javascript/WidgetImplementationJavascriptProvider.java?rev=951242&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/javascript/WidgetImplementationJavascriptProvider.java
(added)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/javascript/WidgetImplementationJavascriptProvider.java
Fri Jun  4 02:38:54 2010
@@ -0,0 +1,34 @@
+/*
+ * 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.sca.implementation.widget.javascript;
+
+import org.apache.tuscany.sca.core.ModuleActivator;
+
+
+/**
+ * A widget javascript provider which 
+ * provides dojo and tuscany dojo extensions 
+ * to an application using implementation.widget
+ * 
+ * @version $Rev$ $Date$
+ */
+public interface WidgetImplementationJavascriptProvider extends ModuleActivator {
+
+}

Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/javascript/WidgetImplementationJavascriptProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/javascript/WidgetImplementationJavascriptProvider.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/META-INF/MANIFEST.MF?rev=951242&r1=951241&r2=951242&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/META-INF/MANIFEST.MF (original)
+++ tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/META-INF/MANIFEST.MF Fri Jun  4
02:38:54 2010
@@ -15,6 +15,7 @@ Import-Package: javax.servlet,
  org.apache.tuscany.sca.core;version="2.0.0",
  org.apache.tuscany.sca.extensibility;version="2.0.0",
  org.apache.tuscany.sca.host.http;version="2.0.0",
+ org.apache.tuscany.sca.implementation.widget.javascript;version="2.0.0",
  org.apache.tuscany.sca.monitor;version="2.0.0",
  org.apache.tuscany.sca.runtime;version="2.0.0"
 Bundle-SymbolicName: org.apache.tuscany.sca.core.web.javascript.dojo

Modified: tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/pom.xml?rev=951242&r1=951241&r2=951242&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/pom.xml (original)
+++ tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/pom.xml Fri Jun  4 02:38:54 2010
@@ -35,6 +35,12 @@
             <artifactId>tuscany-core</artifactId>
             <version>2.0-SNAPSHOT</version>
         </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-widget</artifactId>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>        
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>

Copied: tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.widget.javascript.WidgetImplementationJavascriptProvider
(from r951132, tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.widget.javascript.WidgetImplementationJavascriptProvider?p2=tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.widget.javascript.WidgetImplementationJavascriptProvider&p1=tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator&r1=951132&r2=951242&rev=951242&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
(original)
+++ tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.widget.javascript.WidgetImplementationJavascriptProvider
Fri Jun  4 02:38:54 2010
@@ -14,5 +14,6 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+#
 # Implementation class for the ModuleActivator
-org.apache.tuscany.sca.web.javascript.dojo.DojoModuleActivator;priority=9999
+org.apache.tuscany.sca.web.javascript.dojo.DojoWidgetJavascriptProvider;priority=9999



Mime
View raw message