axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From damr...@apache.org
Subject svn commit: r684894 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
Date Mon, 11 Aug 2008 19:50:25 GMT
Author: damrhei
Date: Mon Aug 11 12:50:25 2008
New Revision: 684894

URL: http://svn.apache.org/viewvc?rev=684894&view=rev
Log:
This fix will provide a method that Axis2 consumers may call in order to have the 'detach'
logic called on the DetachableInputStream that may exist on a response MessageContext.

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java?rev=684894&r1=684893&r2=684894&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
Mon Aug 11 12:50:25 2008
@@ -565,4 +565,33 @@
                log.debug("Exiting deleteAttachments()");
            }
        }
+       
+       /**
+        * This method can be called by components wishing to detach the DetachableInputStream
+        * object that is present on the MessageContext. This is meant to shield components
+        * from any logic that needs to be executed on the DetachableInputStream in order
to 
+        * have it effectively detached. If the DetachableInputStream is not present, or if
+        * the supplied MessageContext is null, no action will be taken.
+        */
+       public static void detachInputStream(MessageContext msgContext) throws AxisFault {
+           try {
+               if(msgContext != null
+                       &&
+                       msgContext.getProperty(Constants.DETACHABLE_INPUT_STREAM) != null)
{
+                   DetachableInputStream dis = (DetachableInputStream) msgContext.getProperty(Constants.DETACHABLE_INPUT_STREAM);
+                   if(log.isDebugEnabled()) {
+                       log.debug("Detaching DetachableInputStream: " + dis);
+                   }
+                   dis.detach();
+               }
+               else {
+                   if(log.isDebugEnabled()) {
+                       log.debug("Detach not performed for MessageContext: " + msgContext);
+                   }
+               }  
+           }
+           catch(Throwable t) {
+               throw AxisFault.makeFault(t);
+           }
+       }
 }



Mime
View raw message