You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by nt...@apache.org on 2008/03/20 23:44:17 UTC
svn commit: r639491 -
/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
Author: nthaker
Date: Thu Mar 20 15:44:16 2008
New Revision: 639491
URL: http://svn.apache.org/viewvc?rev=639491&view=rev
Log:
Axis2-3644
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=639491&r1=639490&r2=639491&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 Thu Mar 20 15:44:16 2008
@@ -22,6 +22,7 @@
import org.apache.axiom.attachments.Attachments;
import org.apache.axiom.attachments.CachedFileDataSource;
+import org.apache.axiom.attachments.lifecycle.LifecycleManager;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMException;
import org.apache.axiom.om.OMOutputFormat;
@@ -36,6 +37,7 @@
import org.apache.axis2.builder.Builder;
import org.apache.axis2.builder.BuilderUtil;
import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.deployment.DeploymentConstants;
import org.apache.axis2.description.Parameter;
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.transport.http.ApplicationXMLFormatter;
@@ -479,7 +481,8 @@
}
Attachments attachments = msgContext.getAttachmentMap();
- if (attachments != null && BuilderUtil.isAttachmentsCacheEnabled(msgContext)) {
+ LifecycleManager lcm = (LifecycleManager)msgContext.getRootContext().getAxisConfiguration().getParameterValue(DeploymentConstants.ATTACHMENTS_LIFECYCLE_MANAGER);
+ if (attachments != null) {
String [] keys = attachments.getAllContentIDs();
if (keys != null) {
String key = null;
@@ -493,13 +496,33 @@
file = ((CachedFileDataSource)dataSource).getFile();
if (log.isDebugEnabled()) {
log.debug("Delete cache attachment file: "+file.getName());
- }
- file.delete();
+ }
+ if(lcm!=null){
+ if(log.isDebugEnabled()){
+ log.debug("deleting file using lifecyclemanager");
+ }
+ lcm.delete(file);
+ }else{
+ file.delete();
+ }
}
}
catch (Exception e) {
+ if (log.isDebugEnabled()) {
+ log.debug("Delete cache attachment file failed"+ e.getMessage());
+ }
+
if (file != null) {
- file.deleteOnExit();
+ if(lcm!=null){
+ try{
+ lcm.deleteOnExit(file);
+ }catch(Exception ex){
+ file.deleteOnExit();
+ }
+ }
+ else{
+ file.deleteOnExit();
+ }
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org