axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r415581 - in /webservices/axis2/trunk/java/modules/core: conf/axis2.xml src/org/apache/axis2/Constants.java src/org/apache/axis2/context/ConfigurationContext.java
Date Tue, 20 Jun 2006 09:24:46 GMT
Author: chinthaka
Date: Tue Jun 20 02:24:46 2006
New Revision: 415581

URL: http://svn.apache.org/viewvc?rev=415581&view=rev
Log:
Making the service group context time out interval configurable. 
Now one can statically set it in axis2.xml or change it dynamically by setting an Integer
property "Constants.Configuration.CONFIG_CONTEXT_TIMOUT_INTERVAL" to configuration context.

Modified:
    webservices/axis2/trunk/java/modules/core/conf/axis2.xml
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java

Modified: webservices/axis2/trunk/java/modules/core/conf/axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/conf/axis2.xml?rev=415581&r1=415580&r2=415581&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/conf/axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/core/conf/axis2.xml Tue Jun 20 02:24:46 2006
@@ -6,6 +6,9 @@
     <parameter name="hotupdate" locked="false">false</parameter>
     <parameter name="enableMTOM" locked="false">false</parameter>
 
+    <!--This will give out the timout of the configuration contexts, in seconds-->
+    <parameter name="ConfigContextTimeoutInterval" locked="false">30</parameter>
+
     <!--During a fault, stacktrace can be sent with the fault message. The following flag
will control -->
     <!--that behaviour.-->
     <parameter name="sendStacktraceDetailsWithFaults" locked="false">true</parameter>

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java?rev=415581&r1=415580&r2=415581&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/Constants.java Tue Jun
20 02:24:46 2006
@@ -210,6 +210,8 @@
         public static final String CONTENT_TYPE = "ContentType";
         public static final String IS_USING_SEPARATE_LISTENER = "IsUsingSeparateListener";
 
+        public static final String CONFIG_CONTEXT_TIMOUT_INTERVAL = "ConfigContextTimeoutInterval";
+
         // this property once set to Boolean.TRUE will make the messages to skip Addressing
Handler.
         // So you will not see Addressing Headers in the OUT path.
         public static final String DISABLE_ADDRESSING_FOR_OUT_MESSAGES = "disableAddressingForOutMessages";

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java?rev=415581&r1=415580&r2=415581&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
Tue Jun 20 02:24:46 2006
@@ -21,6 +21,7 @@
 import org.apache.axis2.Constants;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.AxisServiceGroup;
+import org.apache.axis2.description.Parameter;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.DependencyManager;
 import org.apache.axis2.engine.ListenerManager;
@@ -33,7 +34,11 @@
 import org.apache.commons.logging.LogFactory;
 
 import java.io.File;
-import java.util.*;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
 
 /**
  * This contains all the configuration information for Axis2.
@@ -65,6 +70,17 @@
     public ConfigurationContext(AxisConfiguration axisConfiguration) {
         super(null);
         this.axisConfiguration = axisConfiguration;
+        initConfigContextTimeout(axisConfiguration);
+    }
+
+    private void initConfigContextTimeout(AxisConfiguration axisConfiguration) {
+        Parameter parameter = axisConfiguration.getParameter(Constants.Configuration.CONFIG_CONTEXT_TIMOUT_INTERVAL);
+        if (parameter != null) {
+            Object value = parameter.getValue();
+            if (value != null && value instanceof String) {
+                serviceGroupContextTimoutInterval = Integer.parseInt((String) value);
+            }
+        }
     }
 
     protected void finalize() throws Throwable {
@@ -324,7 +340,7 @@
                 ServiceGroupContext serviceGroupContext =
                         (ServiceGroupContext) serviceGroupContextMap.get(sgCtxtId);
                 if ((currentTime - serviceGroupContext.getLastTouchedTime()) >
-                        serviceGroupContextTimoutInterval) {
+                        getServiceGroupContextTimoutInterval()) {
                     sgCtxtMapKeyIter.remove();
                     cleanupServiceContextes(serviceGroupContext);
                 }
@@ -391,5 +407,16 @@
 
     public void setContextPath(String contextPath) {
         this.contextPath = contextPath;
+    }
+
+    /**
+     * This will be used to fetch the serviceGroupContextTimoutInterval from any place available.
+     */
+    public long getServiceGroupContextTimoutInterval() {
+        Integer serviceGroupContextTimoutIntervalParam = (Integer) getProperty(Constants.Configuration.CONFIG_CONTEXT_TIMOUT_INTERVAL);
+        if (serviceGroupContextTimoutIntervalParam != null) {
+            serviceGroupContextTimoutInterval = serviceGroupContextTimoutIntervalParam.intValue();
+        }
+        return serviceGroupContextTimoutInterval;
     }
 }



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