tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r1042506 - /tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTServiceBindingProvider.java
Date Mon, 06 Dec 2010 01:37:37 GMT
Author: lresende
Date: Mon Dec  6 01:37:36 2010
New Revision: 1042506

URL: http://svn.apache.org/viewvc?rev=1042506&view=rev
Log:
Minor cleanup

Modified:
    tuscany/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTServiceBindingProvider.java

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=1042506&r1=1042505&r2=1042506&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
Mon Dec  6 01:37:36 2010
@@ -157,6 +157,42 @@ public class RESTServiceBindingProvider 
 
     }
 
+    public InterfaceContract getBindingInterfaceContract() {
+        return serviceContract;
+    }
+
+
+    /**
+     * Add specific rest interceptor to invocation chain
+     */
+    public void configure() {
+
+        InvocationChain bindingChain = endpoint.getBindingInvocationChain();
+
+        if (wfProvider != null) {
+            Interceptor interceptor = wfProvider.createInterceptor();
+            if (interceptor != null) {
+                bindingChain.addInterceptor(Phase.SERVICE_BINDING_WIREFORMAT, interceptor);
+            }
+        }
+
+        if (wfResponseProvider != null) {
+            Interceptor interceptor = wfResponseProvider.createInterceptor();
+            if (interceptor != null) {
+                bindingChain.addInterceptor(Phase.SERVICE_BINDING_WIREFORMAT, interceptor);
+            }
+
+        }
+
+        if (osProvider != null) {
+            Interceptor interceptor = osProvider.createInterceptor();
+            if (interceptor != null) {
+                bindingChain.addInterceptor(Phase.SERVICE_BINDING_OPERATION_SELECTOR, interceptor);
+            }
+        }
+
+    }
+
     public void start() {
         InvocationChain bindingChain = endpoint.getBindingInvocationChain();
 
@@ -214,7 +250,21 @@ public class RESTServiceBindingProvider 
         servletMapping = registerServlet(servlet);
     }
 
-    public String registerServlet(Servlet servlet) {
+    public void stop() {
+        if (application != null) {
+            application.destroy();
+        }
+        // Unregister the Servlet from the Servlet host
+        servletHost.removeServletMapping(servletMapping);
+    }
+
+
+    public boolean supportsOneWayInvocation() {
+        return false;
+    }
+
+
+    private String registerServlet(Servlet servlet) {
         // Create our HTTP service listener Servlet and register it with the
         // Servlet host
         String servletMapping = binding.getURI();
@@ -234,22 +284,6 @@ public class RESTServiceBindingProvider 
         return mappedURI;
     }
 
-    public void stop() {
-        if (application != null) {
-            application.destroy();
-        }
-        // Unregister the Servlet from the Servlet host
-        servletHost.removeServletMapping(servletMapping);
-    }
-
-    public InterfaceContract getBindingInterfaceContract() {
-        return serviceContract;
-    }
-
-    public boolean supportsOneWayInvocation() {
-        return false;
-    }
-
     /**
      * Register a Tuscany REST Servlet to handle JAX-RS Resources on a binding endpoint
      * @return
@@ -269,7 +303,7 @@ public class RESTServiceBindingProvider 
                 TuscanyRESTServlet restServlet = new TuscanyRESTServlet(extensionPoints,
binding, application.resourceClass);
 
                 servletMapping = registerServlet(restServlet);
-                
+
                 RegistrationUtils.registerApplication(application, restServlet.getServletContext());
                 return application;
             } else {
@@ -338,35 +372,4 @@ public class RESTServiceBindingProvider 
         }
     }
 
-    /**
-     * Add specific rest interceptor to invocation chain
-     */
-    public void configure() {
-
-        InvocationChain bindingChain = endpoint.getBindingInvocationChain();
-
-        if (wfProvider != null) {
-            Interceptor interceptor = wfProvider.createInterceptor();
-            if (interceptor != null) {
-                bindingChain.addInterceptor(Phase.SERVICE_BINDING_WIREFORMAT, interceptor);
-            }
-        }
-
-        if (wfResponseProvider != null) {
-            Interceptor interceptor = wfResponseProvider.createInterceptor();
-            if (interceptor != null) {
-                bindingChain.addInterceptor(Phase.SERVICE_BINDING_WIREFORMAT, interceptor);
-            }
-
-        }
-
-        if (osProvider != null) {
-            Interceptor interceptor = osProvider.createInterceptor();
-            if (interceptor != null) {
-                bindingChain.addInterceptor(Phase.SERVICE_BINDING_OPERATION_SELECTOR, interceptor);
-            }
-        }
-
-    }
-
 }



Mime
View raw message