Return-Path: X-Original-To: apmail-chemistry-commits-archive@www.apache.org Delivered-To: apmail-chemistry-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6F120EBC8 for ; Fri, 15 Feb 2013 10:02:26 +0000 (UTC) Received: (qmail 73361 invoked by uid 500); 15 Feb 2013 10:02:25 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 73250 invoked by uid 500); 15 Feb 2013 10:02:23 -0000 Mailing-List: contact commits-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list commits@chemistry.apache.org Received: (qmail 73196 invoked by uid 99); 15 Feb 2013 10:02:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Feb 2013 10:02:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Feb 2013 10:02:18 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DC81B23888D2; Fri, 15 Feb 2013 10:01:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@chemistry.apache.org From: fmui@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130215100158.DC81B23888D2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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"); + } + } + } }