tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r950296 - in /tuscany/sca-java-2.x/trunk/modules: binding-rest-runtime/META-INF/ binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/ implementation-jaxrs-runtime/META-INF/ interface-java-jaxrs/src/main/java/org/...
Date Tue, 01 Jun 2010 22:58:01 GMT
Author: rfeng
Date: Tue Jun  1 22:58:01 2010
New Revision: 950296

URL: http://svn.apache.org/viewvc?rev=950296&view=rev
Log:
Adjust the path URI for web app deployment

Modified:
    tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/META-INF/MANIFEST.MF
    tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingInvoker.java
    tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTServiceBindingProvider.java
    tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java
    tuscany/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/META-INF/MANIFEST.MF
    tuscany/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGenerator.java

Modified: tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/META-INF/MANIFEST.MF?rev=950296&r1=950295&r2=950296&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/META-INF/MANIFEST.MF (original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/META-INF/MANIFEST.MF Tue Jun 
1 22:58:01 2010
@@ -8,8 +8,13 @@ Bundle-Version: 2.0.0
 Bundle-ManifestVersion: 2
 Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
 Bundle-Description: Apache Tuscany SCA REST Binding Runtime
-Import-Package: javax.servlet,
+Import-Package: javax.jws,
+ javax.servlet,
  javax.servlet.http,
+ javax.ws.rs,
+ javax.ws.rs.core,
+ javax.ws.rs.ext,
+ javax.xml,
  org.apache.tuscany.sca.assembly;version="2.0.0",
  org.apache.tuscany.sca.binding.rest;version="2.0.0",
  org.apache.tuscany.sca.binding.rest.operationselector.jaxrs;version="2.0.0",
@@ -28,6 +33,15 @@ Import-Package: javax.servlet,
  org.apache.tuscany.sca.invocation;version="2.0.0",
  org.apache.tuscany.sca.provider;version="2.0.0",
  org.apache.tuscany.sca.runtime;version="2.0.0",
+ org.apache.wink.client,
+ org.apache.wink.client.handlers,
+ org.apache.wink.common,
+ org.apache.wink.server.utils,
+ org.apache.wink.common.internal.registry,
+ org.apache.wink.common.internal.registry.metadata,
+ org.apache.wink.server.internal,
+ org.apache.wink.server.internal.registry,
+ org.apache.wink.server.internal.servlet,
  org.oasisopen.sca;version="2.0.0",
  org.oasisopen.sca.annotation;version="2.0.0"
 Bundle-SymbolicName: org.apache.tuscany.sca.binding.rest.runtime

Modified: tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingInvoker.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingInvoker.java?rev=950296&r1=950295&r2=950296&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingInvoker.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingInvoker.java
Tue Jun  1 22:58:01 2010
@@ -60,6 +60,7 @@ import org.apache.tuscany.sca.invocation
 import org.apache.wink.client.ClientConfig;
 import org.apache.wink.client.Resource;
 import org.apache.wink.client.RestClient;
+import org.apache.wink.client.handlers.BasicAuthSecurityHandler;
 
 /**
  * 
@@ -101,6 +102,9 @@ public class RESTBindingInvoker implemen
 
     private RestClient createRestClient() {
         ClientConfig config = new ClientConfig();
+        
+        // configureBasicAuth(config, userName, password);
+        
         config.applications(new Application() {
 
             @Override
@@ -134,6 +138,13 @@ public class RESTBindingInvoker implemen
         return client;
     }
 
+    private void configureBasicAuth(ClientConfig config, String userName, String password)
{
+        BasicAuthSecurityHandler basicAuthSecurityHandler = new BasicAuthSecurityHandler();
+        basicAuthSecurityHandler.setUserName(userName);
+        basicAuthSecurityHandler.setPassword(password);
+        config.handlers(basicAuthSecurityHandler);
+    }
+
     public Message invoke(Message msg) {
 
         Object entity = null;

Modified: tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTServiceBindingProvider.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTServiceBindingProvider.java?rev=950296&r1=950295&r2=950296&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTServiceBindingProvider.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTServiceBindingProvider.java
Tue Jun  1 22:58:01 2010
@@ -283,6 +283,11 @@ public class RESTServiceBindingProvider 
 
                 String uri = endpoint.getBinding().getURI();
                 String path = URI.create(uri).getPath();
+                
+                // FIXME: [rfeng] We need to have a better way to deal with URI template
for bindings
+                if(path.startsWith(servletHost.getContextPath())) {
+                    path = path.substring(servletHost.getContextPath().length());
+                }
                 Class<?> cls =
                     RootResourceClassGenerator.generateRootResourceClass(interfaze,
                                                                          path,

Modified: tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java?rev=950296&r1=950295&r2=950296&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java
Tue Jun  1 22:58:01 2010
@@ -54,6 +54,7 @@ public class TuscanyRESTServlet extends 
     public DeploymentConfiguration getDeploymentConfiguration() throws ClassNotFoundException,
InstantiationException,
         IllegalAccessException, IOException {
         DeploymentConfiguration config = super.getDeploymentConfiguration();
+
         // [rfeng] FIXME: This is a hack to fool Apache wink to not remove the servlet path
         config.setFilterConfig(new FilterConfig() {
 
@@ -73,6 +74,7 @@ public class TuscanyRESTServlet extends 
                 return getServletName();
             }
         });
+
         ProvidersRegistry providers = config.getProvidersRegistry();
         providers.addProvider(new DataBindingJAXRSReader(registry), 0.001, true);
         providers.addProvider(new DataBindingJAXRSWriter(registry), 0.001, true);

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/META-INF/MANIFEST.MF?rev=950296&r1=950295&r2=950296&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/META-INF/MANIFEST.MF (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/META-INF/MANIFEST.MF Tue
Jun  1 22:58:01 2010
@@ -24,6 +24,7 @@ Import-Package: javax.servlet,
  org.apache.tuscany.sca.runtime;version="2.0.0",
  org.apache.wink.server.internal,
  org.apache.wink.server.internal.handlers,
+ org.apache.wink.server.internal.registry,
  org.apache.wink.server.internal.servlet,
  org.apache.wink.server.utils,
  org.oasisopen.sca;version="2.0.0",

Modified: tuscany/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGenerator.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGenerator.java?rev=950296&r1=950295&r2=950296&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGenerator.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGenerator.java
Tue Jun  1 22:58:01 2010
@@ -22,10 +22,6 @@ package org.apache.tuscany.sca.interface
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.HEAD;
-
 import org.objectweb.asm.AnnotationVisitor;
 import org.objectweb.asm.ClassWriter;
 import org.objectweb.asm.FieldVisitor;



Mime
View raw message