incubator-ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1161455 - in /incubator/ace/trunk: ace-client-rest/ ace-client-rest/src/main/java/org/apache/ace/client/rest/ ace-deployment-servlet/src/main/java/org/apache/ace/deployment/servlet/ ace-httplistener/src/main/java/org/apache/ace/http/listen...
Date Thu, 25 Aug 2011 09:18:14 GMT
Author: marrs
Date: Thu Aug 25 09:18:13 2011
New Revision: 1161455

URL: http://svn.apache.org/viewvc?rev=1161455&view=rev
Log:
ACE-159 applied the (second) provided patch.

Modified:
    incubator/ace/trunk/ace-client-rest/src/main/java/org/apache/ace/client/rest/Activator.java
    incubator/ace/trunk/ace-client-rest/test.sh
    incubator/ace/trunk/ace-deployment-servlet/src/main/java/org/apache/ace/deployment/servlet/Activator.java
    incubator/ace/trunk/ace-httplistener/src/main/java/org/apache/ace/http/listener/Activator.java
    incubator/ace/trunk/ace-integrationtests/src/test/java/org/apache/ace/it/http/ServletConfiguratorIntegrationTest.java
    incubator/ace/trunk/ace-log-servlet/src/main/java/org/apache/ace/server/log/servlet/Activator.java
    incubator/ace/trunk/ace-obr-servlet/src/main/java/org/apache/ace/obr/servlet/Activator.java
    incubator/ace/trunk/ace-repository-servlet/src/main/java/org/apache/ace/repository/servlet/Activator.java
    incubator/ace/trunk/ace-target-devserver/pom.xml
    incubator/ace/trunk/ace-target-devserver/src/main/resources/conf/org.apache.ace.webui.vaadin.cfg
    incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/Activator.java

Modified: incubator/ace/trunk/ace-client-rest/src/main/java/org/apache/ace/client/rest/Activator.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-client-rest/src/main/java/org/apache/ace/client/rest/Activator.java?rev=1161455&r1=1161454&r2=1161455&view=diff
==============================================================================
--- incubator/ace/trunk/ace-client-rest/src/main/java/org/apache/ace/client/rest/Activator.java
(original)
+++ incubator/ace/trunk/ace-client-rest/src/main/java/org/apache/ace/client/rest/Activator.java
Thu Aug 25 09:18:13 2011
@@ -18,7 +18,7 @@
  */
 package org.apache.ace.client.rest;
 
-import javax.servlet.http.HttpServlet;
+import javax.servlet.Servlet;
 
 import org.apache.ace.client.repository.SessionFactory;
 import org.apache.felix.dm.DependencyActivatorBase;
@@ -32,7 +32,7 @@ public class Activator extends Dependenc
     @Override
     public void init(BundleContext context, DependencyManager manager) throws Exception {
         manager.add(createComponent()
-            .setInterface(HttpServlet.class.getName(), null)
+            .setInterface(Servlet.class.getName(), null)
             .setImplementation(RESTClientServlet.class)
             .add(createServiceDependency()
                 .setService(SessionFactory.class)

Modified: incubator/ace/trunk/ace-client-rest/test.sh
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-client-rest/test.sh?rev=1161455&r1=1161454&r2=1161455&view=diff
==============================================================================
--- incubator/ace/trunk/ace-client-rest/test.sh (original)
+++ incubator/ace/trunk/ace-client-rest/test.sh Thu Aug 25 09:18:13 2011
@@ -8,10 +8,6 @@ echo "*** Creating new workspace..."
 WORK=`curl -s -d dummy_data -w %{redirect_url} http://localhost:8080/client/work`
 echo "Workspace is ${WORK}"
 
-# Add two random features (might fail, name is actually random)
-#curl -v -d "{ attributes: { name: 'feature-${RANDOM}', description: 'a random feature' },
tags: { generated: 'true'}}" ${WORK}/feature
-#curl -v -d "{ attributes: { name: 'feature-${RANDOM}', description: 'another random feature'
}, tags: { generated: 'true'}}" ${WORK}/feature
-
 echo "*** Adding artifact, feature, distribution, target and all associations..."
 
 RND=$RANDOM
@@ -45,15 +41,6 @@ echo "Association is ${ASSOC3}"
 
 # Get a list of artifacts
 #curl ${WORK}/artifact
-#curl ${WORK}/artifact/%28%26%28Bundle-SymbolicName%3Dnet.luminis.android.desktop%29%28Bundle-Version%3D1.0.0%29%29
-
-# Add a random artifact (does not upload to OBR yet)
-#echo "*** Adding a new, random artifact..."
-#RND=$RANDOM
-#BSN=org.apache.bundle${RND}
-#VERSION=1.0.0
-#NAME=${BSN}-${VERSION}
-#curl -v -d "{attributes: { artifactName: '${NAME}' , mimetype: 'application/vnd.osgi.bundle',
Bundle-Name: '${BSN}', Bundle-SymbolicName: '${BSN}', Bundle-Version: '${VERSION}', url: 'http://localhost:8080/obr/${NAME}.jar',
artifactDescription: 'coolio', processorPid: '' }, tags: { generated: 'true' }}" ${WORK}/artifact
 
 # Commit the workspace
 echo "*** Committing workspace..."

Modified: incubator/ace/trunk/ace-deployment-servlet/src/main/java/org/apache/ace/deployment/servlet/Activator.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-deployment-servlet/src/main/java/org/apache/ace/deployment/servlet/Activator.java?rev=1161455&r1=1161454&r2=1161455&view=diff
==============================================================================
--- incubator/ace/trunk/ace-deployment-servlet/src/main/java/org/apache/ace/deployment/servlet/Activator.java
(original)
+++ incubator/ace/trunk/ace-deployment-servlet/src/main/java/org/apache/ace/deployment/servlet/Activator.java
Thu Aug 25 09:18:13 2011
@@ -18,7 +18,7 @@
  */
 package org.apache.ace.deployment.servlet;
 
-import javax.servlet.http.HttpServlet;
+import javax.servlet.Servlet;
 
 import org.apache.ace.deployment.provider.DeploymentProvider;
 import org.apache.ace.deployment.streamgenerator.StreamGenerator;
@@ -33,7 +33,7 @@ public class Activator extends Dependenc
     @Override
     public void init(BundleContext context, DependencyManager manager) throws Exception {
         manager.add(createComponent()
-            .setInterface(HttpServlet.class.getName(), null)
+            .setInterface(Servlet.class.getName(), null)
             .setImplementation(DeploymentServlet.class)
             .add(createServiceDependency().setService(StreamGenerator.class).setRequired(true))
             .add(createServiceDependency().setService(DeploymentProvider.class).setRequired(true))

Modified: incubator/ace/trunk/ace-httplistener/src/main/java/org/apache/ace/http/listener/Activator.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-httplistener/src/main/java/org/apache/ace/http/listener/Activator.java?rev=1161455&r1=1161454&r2=1161455&view=diff
==============================================================================
--- incubator/ace/trunk/ace-httplistener/src/main/java/org/apache/ace/http/listener/Activator.java
(original)
+++ incubator/ace/trunk/ace-httplistener/src/main/java/org/apache/ace/http/listener/Activator.java
Thu Aug 25 09:18:13 2011
@@ -24,7 +24,6 @@ import java.util.Map;
 import java.util.Set;
 
 import javax.servlet.Servlet;
-import javax.servlet.http.HttpServlet;
 
 import org.apache.ace.http.listener.constants.HttpConstants;
 import org.apache.felix.dm.DependencyActivatorBase;
@@ -35,9 +34,9 @@ import org.osgi.service.http.HttpService
 import org.osgi.service.log.LogService;
 
 /**
- * Service responsible for registrating HttpServlets at HttpServices.<p>
+ * Service responsible for registrating Servlets at HttpServices.<p>
  *
- * When a HttpServlet is being added or removed, the callback methods in this class are being
+ * When a Servlet is being added or removed, the callback methods in this class are being
  * called via the DependencyManager. A Servlet is being added to all HttpServices currently
  * available or removed from all available HttpServices.<p>
  *
@@ -66,18 +65,18 @@ public class Activator extends Dependenc
                 .setAutoConfig(false)
                 .setCallbacks("addHttpService", "removeHttpService"))
             .add(createServiceDependency()
-                .setService(HttpServlet.class)
+                .setService(Servlet.class)
                 .setAutoConfig(false)
-                .setCallbacks("addHttpServlet", "changeHttpServlet", "removeHttpServlet")));
+                .setCallbacks("addServlet", "changeServlet", "removeServlet")));
     }
 
     /**
-     * Callback method used in case a HttpServlet is being added. This Servlet is being added
+     * Callback method used in case a Servlet is being added. This Servlet is being added
      * to all available HttpServices under the endpoint configured via the Configurator.
      *
      * @param ref  reference to the Servlet
      */
-    public synchronized void addHttpServlet(ServiceReference ref) {
+    public synchronized void addServlet(ServiceReference ref) {
         // register servlet to all HttpServices
         String endpoint = (String)ref.getProperty(HttpConstants.ENDPOINT);
         m_servlets.put(ref, endpoint);
@@ -98,18 +97,24 @@ public class Activator extends Dependenc
         }
     }
 
-    public synchronized void changeHttpServlet(ServiceReference ref) {
+    /**
+     * Callback method used in case a Servlet is being changed. This Servlet is removed
+     * and then added again. 
+     *
+     * @param ref  reference to the Servlet
+     */
+    public synchronized void changeServlet(ServiceReference ref) {
         removeServlet(ref, m_servlets.get(ref));
-        addHttpServlet(ref);
+        addServlet(ref);
     }
 
     /**
-     * Callback method used in case a HttpServlet is being removed. This Servlet is being
removed
+     * Callback method used in case a Servlet is being removed. This Servlet is being removed
      * from all available HttpServices using the endpoint configured via the Configurator.
      *
      * @param ref  reference to the Servlet
      */
-    public synchronized void removeHttpServlet(ServiceReference ref) {
+    public synchronized void removeServlet(ServiceReference ref) {
         // remove servlet from all HttpServices
         String endpoint = (String)ref.getProperty(HttpConstants.ENDPOINT);
         removeServlet(ref, endpoint);

Modified: incubator/ace/trunk/ace-integrationtests/src/test/java/org/apache/ace/it/http/ServletConfiguratorIntegrationTest.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-integrationtests/src/test/java/org/apache/ace/it/http/ServletConfiguratorIntegrationTest.java?rev=1161455&r1=1161454&r2=1161455&view=diff
==============================================================================
--- incubator/ace/trunk/ace-integrationtests/src/test/java/org/apache/ace/it/http/ServletConfiguratorIntegrationTest.java
(original)
+++ incubator/ace/trunk/ace-integrationtests/src/test/java/org/apache/ace/it/http/ServletConfiguratorIntegrationTest.java
Thu Aug 25 09:18:13 2011
@@ -18,8 +18,27 @@
  */
 package org.apache.ace.it.http;
 
+import static org.apache.ace.it.Options.jetty;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.provision;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import javax.servlet.Servlet;
+import javax.servlet.http.HttpServlet;
+
 import org.apache.ace.http.listener.constants.HttpConstants;
 import org.apache.ace.it.IntegrationTestBase;
+import org.apache.ace.it.Options.Ace;
+import org.apache.ace.it.Options.Felix;
+import org.apache.ace.it.Options.Osgi;
 import org.apache.ace.test.constants.TestConstants;
 import org.apache.felix.dm.Component;
 import org.junit.Test;
@@ -29,21 +48,6 @@ import org.ops4j.pax.exam.container.def.
 import org.ops4j.pax.exam.junit.Configuration;
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
 import org.osgi.service.http.HttpService;
-import org.osgi.service.log.LogService;
-
-import javax.servlet.http.HttpServlet;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-import static org.apache.ace.it.Options.*;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.provision;
-import static org.ops4j.pax.exam.CoreOptions.systemProperty;
 
 @RunWith(JUnit4TestRunner.class)
 public class ServletConfiguratorIntegrationTest extends IntegrationTestBase {
@@ -69,7 +73,7 @@ public class ServletConfiguratorIntegrat
         dictionary.put(HttpConstants.ENDPOINT, "/echoServlet");
         m_echoServletService = m_dependencyManager.createComponent()
             .setImplementation(m_echoServlet)
-            .setInterface(HttpServlet.class.getName(), dictionary);
+            .setInterface(Servlet.class.getName(), dictionary);
 
         m_mockHttp = new MockHttpService();
         m_mockHttpService = m_dependencyManager.createComponent()

Modified: incubator/ace/trunk/ace-log-servlet/src/main/java/org/apache/ace/server/log/servlet/Activator.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-log-servlet/src/main/java/org/apache/ace/server/log/servlet/Activator.java?rev=1161455&r1=1161454&r2=1161455&view=diff
==============================================================================
--- incubator/ace/trunk/ace-log-servlet/src/main/java/org/apache/ace/server/log/servlet/Activator.java
(original)
+++ incubator/ace/trunk/ace-log-servlet/src/main/java/org/apache/ace/server/log/servlet/Activator.java
Thu Aug 25 09:18:13 2011
@@ -23,9 +23,8 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 
-import javax.servlet.http.HttpServlet;
+import javax.servlet.Servlet;
 
-import org.apache.ace.http.listener.constants.HttpConstants;
 import org.apache.ace.server.log.store.LogStore;
 import org.apache.felix.dm.Component;
 import org.apache.felix.dm.DependencyActivatorBase;
@@ -74,17 +73,11 @@ public class Activator extends Dependenc
         if ((name == null) || "".equals(name)) {
             throw new ConfigurationException(LOG_NAME, "Log name has to be specified.");
         }
-        String endpoint = (String) dict.get(HttpConstants.ENDPOINT);
-        if ((endpoint == null) || "".equals(endpoint)) {
-            throw new ConfigurationException(HttpConstants.ENDPOINT, "Servlet endpoint has
to be specified.");
-        }
 
         Component service = m_instances.get(pid);
         if (service == null) {
-            Properties props = new Properties();
-            props.put(HttpConstants.ENDPOINT, endpoint);
             service = m_manager.createComponent()
-                .setInterface(HttpServlet.class.getName(), props)
+                .setInterface(Servlet.class.getName(), dict)
                 .setImplementation(new LogServlet(name))
                 .add(createServiceDependency().setService(LogService.class).setRequired(false))
                 .add(createServiceDependency().setService(LogStore.class, "(&("+Constants.OBJECTCLASS+"="+LogStore.class.getName()+")(name="
+ name + "))").setRequired(true));

Modified: incubator/ace/trunk/ace-obr-servlet/src/main/java/org/apache/ace/obr/servlet/Activator.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-obr-servlet/src/main/java/org/apache/ace/obr/servlet/Activator.java?rev=1161455&r1=1161454&r2=1161455&view=diff
==============================================================================
--- incubator/ace/trunk/ace-obr-servlet/src/main/java/org/apache/ace/obr/servlet/Activator.java
(original)
+++ incubator/ace/trunk/ace-obr-servlet/src/main/java/org/apache/ace/obr/servlet/Activator.java
Thu Aug 25 09:18:13 2011
@@ -18,6 +18,7 @@
  */
 package org.apache.ace.obr.servlet;
 
+import javax.servlet.Servlet;
 import javax.servlet.http.HttpServlet;
 
 import org.apache.ace.obr.storage.BundleStore;
@@ -32,7 +33,7 @@ public class Activator extends Dependenc
     @Override
     public void init(BundleContext context, DependencyManager manager) throws Exception {
         manager.add(createComponent()
-            .setInterface(HttpServlet.class.getName(), null)
+            .setInterface(Servlet.class.getName(), null)
             .setImplementation(BundleServlet.class)
             .add(createConfigurationDependency()
                 .setPropagate(true)

Modified: incubator/ace/trunk/ace-repository-servlet/src/main/java/org/apache/ace/repository/servlet/Activator.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-repository-servlet/src/main/java/org/apache/ace/repository/servlet/Activator.java?rev=1161455&r1=1161454&r2=1161455&view=diff
==============================================================================
--- incubator/ace/trunk/ace-repository-servlet/src/main/java/org/apache/ace/repository/servlet/Activator.java
(original)
+++ incubator/ace/trunk/ace-repository-servlet/src/main/java/org/apache/ace/repository/servlet/Activator.java
Thu Aug 25 09:18:13 2011
@@ -18,7 +18,7 @@
  */
 package org.apache.ace.repository.servlet;
 
-import javax.servlet.http.HttpServlet;
+import javax.servlet.Servlet;
 
 import org.apache.felix.dm.DependencyActivatorBase;
 import org.apache.felix.dm.DependencyManager;
@@ -32,7 +32,7 @@ public class Activator extends Dependenc
     @Override
     public void init(BundleContext context, DependencyManager manager) throws Exception {
         manager.add(createComponent()
-            .setInterface(HttpServlet.class.getName(), null)
+            .setInterface(Servlet.class.getName(), null)
             .setImplementation(RepositoryServlet.class)
             .add(createConfigurationDependency()
                 .setPropagate(true)
@@ -42,7 +42,7 @@ public class Activator extends Dependenc
                 .setRequired(false)));
 
         manager.add(createComponent()
-            .setInterface(HttpServlet.class.getName(), null)
+            .setInterface(Servlet.class.getName(), null)
             .setImplementation(RepositoryReplicationServlet.class)
             .add(createConfigurationDependency()
                 .setPropagate(true)

Modified: incubator/ace/trunk/ace-target-devserver/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-target-devserver/pom.xml?rev=1161455&r1=1161454&r2=1161455&view=diff
==============================================================================
--- incubator/ace/trunk/ace-target-devserver/pom.xml (original)
+++ incubator/ace/trunk/ace-target-devserver/pom.xml Thu Aug 25 09:18:13 2011
@@ -186,6 +186,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.ace</groupId>
+            <artifactId>org.apache.ace.client.rest</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ace</groupId>
             <artifactId>org.apache.ace.configurator</artifactId>
             <scope>runtime</scope>
         </dependency>

Modified: incubator/ace/trunk/ace-target-devserver/src/main/resources/conf/org.apache.ace.webui.vaadin.cfg
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-target-devserver/src/main/resources/conf/org.apache.ace.webui.vaadin.cfg?rev=1161455&r1=1161454&r2=1161455&view=diff
==============================================================================
--- incubator/ace/trunk/ace-target-devserver/src/main/resources/conf/org.apache.ace.webui.vaadin.cfg
(original)
+++ incubator/ace/trunk/ace-target-devserver/src/main/resources/conf/org.apache.ace.webui.vaadin.cfg
Thu Aug 25 09:18:13 2011
@@ -1,2 +1,3 @@
+org.apache.ace.server.servlet.endpoint=/ace
 aceHost = http://localhost:8080/
 obrUrl = http://localhost:8080/obr/
\ No newline at end of file

Modified: incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/Activator.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/Activator.java?rev=1161455&r1=1161454&r2=1161455&view=diff
==============================================================================
--- incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/Activator.java
(original)
+++ incubator/ace/trunk/ace-webui-vaadin/src/main/java/org/apache/ace/webui/vaadin/Activator.java
Thu Aug 25 09:18:13 2011
@@ -21,7 +21,7 @@ package org.apache.ace.webui.vaadin;
 import java.util.Map;
 import java.util.Properties;
 
-import javax.servlet.http.HttpServlet;
+import javax.servlet.Servlet;
 
 import org.apache.ace.client.repository.stateful.StatefulGatewayObject;
 import org.apache.ace.http.listener.constants.HttpConstants;
@@ -30,9 +30,6 @@ import org.apache.ace.webui.UIExtensionF
 import org.apache.felix.dm.DependencyActivatorBase;
 import org.apache.felix.dm.DependencyManager;
 import org.osgi.framework.BundleContext;
-import org.osgi.service.event.Event;
-import org.osgi.service.event.EventConstants;
-import org.osgi.service.event.EventHandler;
 import org.osgi.service.http.HttpService;
 
 import com.vaadin.ui.Component;
@@ -50,12 +47,11 @@ public class Activator extends Dependenc
             )
         );
         // register the main application for the ACE UI client
-        Properties props = new Properties();
-        props.put(HttpConstants.ENDPOINT, "/ace");
         manager.add(createComponent()
-            .setInterface(HttpServlet.class.getName(), props)
+            .setInterface(Servlet.class.getName(), null)
             .setImplementation(VaadinServlet.class)
-            .add(createConfigurationDependency().setPid(VaadinServlet.PID))
+            .add(createConfigurationDependency()
+                .setPid(VaadinServlet.PID).setPropagate(true))
         );
         
         // shows off components that are contributed by extensions



Mime
View raw message