axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r500990 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: context/ConfigurationContext.java context/SessionContext.java engine/DependencyManager.java transport/http/server/SessionManager.java
Date Mon, 29 Jan 2007 10:01:00 GMT
Author: deepal
Date: Mon Jan 29 02:00:59 2007
New Revision: 500990

URL: http://svn.apache.org/viewvc?view=rev&rev=500990
Log:
fix for AXIS2-1990
 - We do not need to thw exception inside the DependencyManager

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/SessionContext.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DependencyManager.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/SessionManager.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java?view=diff&rev=500990&r1=500989&r2=500990
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
Mon Jan 29 02:00:59 2007
@@ -25,14 +25,10 @@
 import org.apache.axis2.engine.DependencyManager;
 import org.apache.axis2.engine.ListenerManager;
 import org.apache.axis2.i18n.Messages;
-import org.apache.axis2.modules.Module;
-import org.apache.axis2.transport.TransportSender;
 import org.apache.axis2.transport.http.HTTPConstants;
 import org.apache.axis2.util.SessionUtils;
 import org.apache.axis2.util.threadpool.ThreadFactory;
 import org.apache.axis2.util.threadpool.ThreadPool;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 import java.io.File;
 import java.net.URL;
@@ -43,7 +39,6 @@
  */
 public class ConfigurationContext extends AbstractContext {
 
-    private static final Log log = LogFactory.getLog(ConfigurationContext.class);
     /**
      * Map containing <code>MessageID</code> to
      * <code>OperationContext</code> mapping.
@@ -66,14 +61,10 @@
 
     private String cachedServicePath = null;
 
-    private Thread cleanupThread;
-
     public ConfigurationContext(AxisConfiguration axisConfiguration) {
         super(null);
         this.axisConfiguration = axisConfiguration;
         initConfigContextTimeout(axisConfiguration);
-        cleanupThread = new CleanupThread(this);
-        Runtime.getRuntime().addShutdownHook(cleanupThread);
     }
 
     private void initConfigContextTimeout(AxisConfiguration axisConfiguration) {
@@ -484,11 +475,7 @@
         }
         while (serviceContecxtes.hasNext()) {
             ServiceContext serviceContext = (ServiceContext) serviceContecxtes.next();
-            try {
-                DependencyManager.destroyServiceObject(serviceContext);
-            } catch (AxisFault axisFault) {
-                log.info(axisFault.getMessage());
-            }
+            DependencyManager.destroyServiceObject(serviceContext);
         }
     }
 
@@ -501,6 +488,7 @@
                         (ServiceGroupContext) applicationScopeSgs.next();
                 cleanupServiceContexts(serviceGroupContext);
             }
+            applicationSessionServiceGroupContextTable.clear();
         }
         if ((serviceGroupContextMap != null) && (serviceGroupContextMap.size() >
0)) {
             Iterator sopaSessionSgs = serviceGroupContextMap.values().iterator();
@@ -508,46 +496,17 @@
                 ServiceGroupContext serviceGroupContext = (ServiceGroupContext) sopaSessionSgs.next();
                 cleanupServiceContexts(serviceGroupContext);
             }
+            serviceGroupContextMap.clear();
         }
     }
 
     public void terminate()
             throws AxisFault {
-        Runtime.getRuntime().removeShutdownHook(cleanupThread);
         if (listenerManager != null) {
             listenerManager.stop();
         }
     }
 
-    private void performCleanup() throws AxisFault {
-        /*Stop the transport senders*/
-        HashMap transportOut = getAxisConfiguration().getTransportsOut();
-        if (transportOut.size() > 0) {
-            Iterator trsItr = transportOut.values().iterator();
-            while (trsItr.hasNext()) {
-                TransportOutDescription outDescription = (TransportOutDescription) trsItr.next();
-                TransportSender trsSededer = outDescription.getSender();
-                if (trsSededer != null) {
-                    trsSededer.stop();
-                }
-            }
-        }
-
-        /*Shut down the modules*/
-        HashMap modules = getAxisConfiguration().getModules();
-        if (modules != null) {
-            Iterator moduleitr = modules.values().iterator();
-            while (moduleitr.hasNext()) {
-                AxisModule axisModule = (AxisModule) moduleitr.next();
-                Module module = axisModule.getModule();
-                if (module != null) {
-                    module.shutdown(this);
-                }
-            }
-        }
-
-        cleanupContexts();
-    }
 
     public String getServiceContextPath() {
         if (cachedServicePath == null) {
@@ -628,22 +587,5 @@
             serviceGroupContextTimoutInterval = serviceGroupContextTimoutIntervalParam.intValue();
         }
         return serviceGroupContextTimoutInterval;
-    }
-
-    class CleanupThread extends Thread {
-        ConfigurationContext configContext;
-
-        public CleanupThread(ConfigurationContext configContext) {
-            this.configContext = configContext;
-        }
-
-        public void run() {
-            try {
-                configContext.performCleanup();
-            }
-            catch (AxisFault e) {
-                e.printStackTrace();
-            }
-        }
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/SessionContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/SessionContext.java?view=diff&rev=500990&r1=500989&r2=500990
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/SessionContext.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/SessionContext.java
Mon Jan 29 02:00:59 2007
@@ -28,9 +28,7 @@
 import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
-import java.io.ObjectInputStream;
 import java.io.ObjectOutput;
-import java.io.ObjectOutputStream;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -54,10 +52,10 @@
     private static final long serialVersionUID = -1100610673067568556L;
 
     /**
-     * @serial Tracks the revision level of a class to identify changes to the 
+     * @serial Tracks the revision level of a class to identify changes to the
      * class definition that are compatible to serialization/externalization.
      * If a class definition changes, then the serialization/externalization
-     * of the class is affected. 
+     * of the class is affected.
      * Refer to the writeExternal() and readExternal() methods.
      */
     // supported revision levels, add a new level to manage compatible changes
@@ -171,27 +169,23 @@
         Iterator serviceContecxtes = serviceGroupContext.getServiceContexts();
         while (serviceContecxtes.hasNext()) {
             ServiceContext serviceContext = (ServiceContext) serviceContecxtes.next();
-            try {
                 DependencyManager.destroyServiceObject(serviceContext);
-            } catch (AxisFault axisFault) {
-                log.info(axisFault.getMessage());
-            }
         }
     }
 
 
     /* ===============================================================
-     * Externalizable support 
+     * Externalizable support
      * ===============================================================
      */
-    
+
     /**
      * Save the contents of this object.
      * <p>
      * NOTE: Transient fields and static fields are not saved.
      *
      * @param out    The stream to write the object contents to
-     * 
+     *
      * @exception IOException
      */
     public void writeExternal(ObjectOutput out) throws IOException
@@ -254,15 +248,15 @@
 
 
     /**
-     * Restore the contents of the MessageContext that was 
-     * previously saved. 
-     * <p> 
+     * Restore the contents of the MessageContext that was
+     * previously saved.
+     * <p>
      * NOTE: The field data must read back in the same order and type
-     * as it was written.  Some data will need to be validated when 
+     * as it was written.  Some data will need to be validated when
      * resurrected.
      *
-     * @param in    The stream to read the object contents from 
-     * 
+     * @param in    The stream to read the object contents from
+     *
      * @exception IOException
      * @exception ClassNotFoundException
      */
@@ -324,7 +318,7 @@
         //---------------------------------------------------------
 
         // parent
-        Object tmpParent = ObjectStateUtils.readObject(in, "SessionContext.parent"); 
+        Object tmpParent = ObjectStateUtils.readObject(in, "SessionContext.parent");
 
         if (tmpParent != null)
         {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DependencyManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DependencyManager.java?view=diff&rev=500990&r1=500989&r2=500990
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DependencyManager.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DependencyManager.java
Mon Jan 29 02:00:59 2007
@@ -43,7 +43,7 @@
     public final static String SERVICE_DESTROY_METHOD = "destroy";
 
     public static void initServiceClass(Object obj,
-                                        ServiceContext serviceContext) throws AxisFault {
+                                        ServiceContext serviceContext) {
         try {
             Class classToLoad = obj.getClass();
             // We can not call classToLoad.getDeclaredMethed() , since there
@@ -55,17 +55,14 @@
             }
         } catch (SecurityException e) {
             log.info("Exception trying to call " + SERVICE_INIT_METHOD, e);
-            throw new AxisFault(e);
         } catch (IllegalArgumentException e) {
             log.info("Exception trying to call " + SERVICE_INIT_METHOD, e);
-            throw new AxisFault(e);
         } catch (IllegalAccessException e) {
             log.info("Exception trying to call " + SERVICE_INIT_METHOD, e);
-            throw new AxisFault(e);
         } catch (InvocationTargetException e) {
             log.info("Exception trying to call " + SERVICE_INIT_METHOD, e);
-            throw new AxisFault(e);
         } catch (NoSuchMethodException e) {
+            log.info("Exception trying to call " + SERVICE_INIT_METHOD, e);
         }
     }
 
@@ -104,7 +101,7 @@
      */
 
 
-    public static void destroyServiceObject(ServiceContext serviceContext) throws AxisFault
{
+    public static void destroyServiceObject(ServiceContext serviceContext) {
         try {
             Object obj = serviceContext.getProperty(ServiceContext.SERVICE_OBJECT);
             if (obj != null) {
@@ -126,18 +123,12 @@
             }
         } catch (SecurityException e) {
             log.info("Exception trying to call " + SERVICE_DESTROY_METHOD, e);
-            throw new AxisFault(e);
         } catch (IllegalArgumentException e) {
             log.info("Exception trying to call " + SERVICE_DESTROY_METHOD, e);
-            throw new AxisFault(e);
         } catch (IllegalAccessException e) {
             log.info("Exception trying to call " + SERVICE_DESTROY_METHOD, e);
-            throw new AxisFault(e);
         } catch (InvocationTargetException e) {
             log.info("Exception trying to call " + SERVICE_DESTROY_METHOD, e);
-            throw new AxisFault(e);
         }
     }
-
-
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/SessionManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/SessionManager.java?view=diff&rev=500990&r1=500989&r2=500990
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/SessionManager.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/SessionManager.java
Mon Jan 29 02:00:59 2007
@@ -34,18 +34,13 @@
 import java.util.Map;
 
 import org.apache.axiom.om.util.UUIDGenerator;
-import org.apache.axis2.AxisFault;
 import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.context.ServiceGroupContext;
 import org.apache.axis2.context.SessionContext;
 import org.apache.axis2.engine.DependencyManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 public class SessionManager {
 
-    private static final Log LOG = LogFactory.getLog(SessionManager.class);
-    
     private final Map sessionmap;
     
     public SessionManager() {
@@ -91,11 +86,7 @@
     private void cleanupServiceContexts(final ServiceGroupContext serviceGroupContext) {
         for (Iterator it = serviceGroupContext.getServiceContexts(); it.hasNext(); ) {
             ServiceContext serviceContext = (ServiceContext) it.next();
-            try {
-                DependencyManager.destroyServiceObject(serviceContext);
-            } catch (AxisFault axisFault) {
-                LOG.info(axisFault.getMessage());
-            }
+            DependencyManager.destroyServiceObject(serviceContext);
         }
     }
     



---------------------------------------------------------------------
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