chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1446486 - /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.java
Date Fri, 15 Feb 2013 10:01:58 GMT
Author: fmui
Date: Fri Feb 15 10:01:58 2013
New Revision: 1446486

URL: http://svn.apache.org/r1446486
Log:
CMIS-626: extended the Web Services servlet for Glassfish

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.java?rev=1446486&r1=1446485&r2=1446486&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.java
Fri Feb 15 10:01:58 2013
@@ -18,6 +18,8 @@
  */
 package org.apache.chemistry.opencmis.server.impl.webservices;
 
+import java.lang.reflect.Method;
+
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
 import javax.xml.ws.WebServiceFeature;
@@ -94,7 +96,7 @@ public class CmisWebServicesServlet exte
                 for (WebServiceFeature ft : wsfl) {
                     if (ft instanceof StreamingAttachmentFeature) {
                         ((StreamingAttachmentFeature) ft).setDir(factory.getTempDirectory().getAbsolutePath());
-                        ((StreamingAttachmentFeature) ft).setMemoryThreshold(factory.getMemoryThreshold());
+                        setMemoryThreshold(factory, (StreamingAttachmentFeature) ft);
                     }
                 }
             }
@@ -102,4 +104,20 @@ public class CmisWebServicesServlet exte
 
         return delegate;
     }
+
+    private void setMemoryThreshold(CmisServiceFactory factory, StreamingAttachmentFeature
ft) {
+        try {
+            // JAX-WS RI 2.1
+            ft.setMemoryThreshold(factory.getMemoryThreshold());
+        } catch (NoSuchMethodError e) {
+            // JAX-WS RI 2.2 
+            // see CMIS-626
+            try {
+                Method m = ft.getClass().getMethod("setMemoryThreshold", long.class);
+                m.invoke(ft, (long) factory.getMemoryThreshold());
+            } catch (Exception e2) {
+                LOG.warn("Could not set memory threshold for streaming");
+            }
+        }
+    }
 }



Mime
View raw message