Author: dims
Date: Tue Mar  4 11:51:11 2008
New Revision: 633609

URL: http://svn.apache.org/viewvc?rev=633609&view=rev
Log:
create an instance if there isn't one. ensures that there's only one instance 
of lifecycle manager in the system

Modified:
    
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/BuilderUtil.java

Modified: 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/BuilderUtil.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/BuilderUtil.java?rev=633609&r1=633608&r2=633609&view=diff
==============================================================================
--- 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/BuilderUtil.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/builder/BuilderUtil.java
 Tue Mar  4 11:51:11 2008
@@ -21,6 +21,7 @@
 
 import org.apache.axiom.attachments.Attachments;
 import org.apache.axiom.attachments.lifecycle.LifecycleManager;
+import org.apache.axiom.attachments.lifecycle.impl.LifecycleManagerImpl;
 import org.apache.axiom.attachments.utils.IOUtils;
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
@@ -548,8 +549,13 @@
                                                  int contentLength) {
         LifecycleManager manager = null;
         try {
-            manager = (LifecycleManager) 
msgContext.getRootContext().getAxisConfiguration()
+            AxisConfiguration configuration = 
msgContext.getRootContext().getAxisConfiguration();
+            manager = (LifecycleManager) configuration
                     
.getParameterValue(DeploymentConstants.ATTACHMENTS_LIFECYCLE_MANAGER);
+            if(manager == null){
+                manager = new LifecycleManagerImpl();
+                
configuration.addParameter(DeploymentConstants.ATTACHMENTS_LIFECYCLE_MANAGER, 
manager);
+            }
         } catch (Exception e){
             if(log.isDebugEnabled()){
                 log.debug("Exception getting Attachments LifecycleManager", e);



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to