axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r565927 - /webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java
Date Tue, 14 Aug 2007 21:40:38 GMT
Author: scheu
Date: Tue Aug 14 14:40:37 2007
New Revision: 565927

URL: http://svn.apache.org/viewvc?view=rev&rev=565927
Log:
AXIS2-3122
Contributor: Dan Sedov
Added missing doPriv to JAXB marshalling code in the JAXWS module.

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java?view=diff&rev=565927&r1=565926&r2=565927
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java
Tue Aug 14 14:40:37 2007
@@ -250,31 +250,35 @@
      * @param m Marshaller
      * @param writer XMLStreamWriter
      */
-    private static void marshalByElement(Object b, Marshaller m, XMLStreamWriter writer,
-                                         boolean optimize) throws WebServiceException {
-        // Marshalling directly to the output stream is faster than marshalling through the
-        // XMLStreamWriter. Take advantage of this optimization if there is an output stream.
-        try {
-            OutputStream os = (optimize) ? getOutputStream(writer) : null;
-            if (os != null) {
-                if (DEBUG_ENABLED) {
-                    log.debug("Invoking marshalByElement.  Marshaling to an OutputStream.
" +
-                                "Object is "
-                            + getDebugName(b));
+    private static void marshalByElement(final Object b, final Marshaller m, final XMLStreamWriter
writer,
+                                         final boolean optimize) throws WebServiceException
{
+        AccessController.doPrivileged(new PrivilegedAction() {
+            public Object run() {
+                // Marshalling directly to the output stream is faster than marshalling through
the
+                // XMLStreamWriter. Take advantage of this optimization if there is an output
stream.
+                try {
+                    OutputStream os = (optimize) ? getOutputStream(writer) : null;
+                    if (os != null) {
+                        if (DEBUG_ENABLED) {
+                            log.debug("Invoking marshalByElement.  Marshaling to an OutputStream.
" +
+                                      "Object is "
+                                      + getDebugName(b));
+                        }
+                        writer.flush();
+                        m.marshal(b, os);
+                    } else {
+                        if (DEBUG_ENABLED) {
+                            log.debug("Invoking marshalByElement.  Marshaling to an XMLStreamWriter.
" +
+                                      "Object is "
+                                      + getDebugName(b));
+                        }
+                        m.marshal(b, writer);
+                    }
+                } catch (Exception e) {
+                    throw ExceptionFactory.makeWebServiceException(e);
                 }
-                writer.flush();
-                m.marshal(b, os);
-            } else {
-                if (DEBUG_ENABLED) {
-                    log.debug("Invoking marshalByElement.  Marshaling to an XMLStreamWriter.
" +
-                                "Object is "
-                            + getDebugName(b));
-                }
-                m.marshal(b, writer);
-            }
-        } catch (Exception e) {
-            throw ExceptionFactory.makeWebServiceException(e);
-        }
+                return null;
+            }});
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message