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 na...@apache.org on 2007/02/26 01:54:22 UTC

svn commit: r511681 - in /webservices/axis2/trunk/java/modules: addressing/src/org/apache/axis2/handlers/addressing/ kernel/src/org/apache/axis2/addressing/ kernel/src/org/apache/axis2/context/ kernel/src/org/apache/axis2/dispatchers/ kernel/src/org/ap...

Author: nagy
Date: Sun Feb 25 16:54:21 2007
New Revision: 511681

URL: http://svn.apache.org/viewvc?view=rev&rev=511681
Log:
Added a logging controller class that enables a performant short circuiting of logging tests without sacrificing the ability to enable tracing without requiring recycling of the JVM or flushing classes.  To disable the ability to turn on debug/trace level logging and thereby increase performance, set the system property Axis2.prohibitDebugLogging 

Added:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/LoggingControl.java
Modified:
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/AddressingHelper.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/AbstractOperationDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/AbstractServiceDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/ActionBasedOperationDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RelatesToBasedOperationDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RelatesToBasedServiceDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RequestURIBasedServiceDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedOperationDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedServiceDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AbstractDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/Phase.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java Sun Feb 25 16:54:21 2007
@@ -35,6 +35,7 @@
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.handlers.AbstractHandler;
 import org.apache.axis2.util.JavaUtils;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -43,13 +44,12 @@
     protected String addressingNamespace = Final.WSA_NAMESPACE;  // defaulting to final version
     protected String addressingVersion = null;
     private static final Log log = LogFactory.getLog(AddressingInHandler.class);
-    private static final boolean isDebugEnabled = log.isDebugEnabled();
 
 
     public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
         // if another handler has already processed the addressing headers, do not do anything here.
         if (JavaUtils.isTrueExplicitly(msgContext.getProperty(IS_ADDR_INFO_ALREADY_PROCESSED))) {
-            if(isDebugEnabled) {
+            if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug("Another handler has processed the addressing headers. Nothing to do here.");
             }
             return InvocationResponse.CONTINUE;
@@ -61,7 +61,7 @@
             namespace = addressingNamespace;
         }
         else if (!namespace.equals(addressingNamespace)) {
-            if(isDebugEnabled) {
+            if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug("This addressing handler does not match the specified namespace, " + namespace);
             }
 
@@ -79,7 +79,7 @@
             return InvocationResponse.CONTINUE;
         }
 
-        if(isDebugEnabled) {
+        if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
             log.debug("Starting " + addressingVersion + " IN handler ...");
         }
 
@@ -90,7 +90,7 @@
             msgContext.setProperty(WS_ADDRESSING_VERSION, namespace);
             msgContext.setProperty(DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.FALSE);
 
-            if(isDebugEnabled) {
+            if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug(addressingVersion + " Headers present in the SOAP message. Starting to process ...");
             }
 
@@ -98,7 +98,7 @@
             msgContext.setProperty(IS_ADDR_INFO_ALREADY_PROCESSED, Boolean.TRUE);
         } else {
             msgContext.setProperty(DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.TRUE);
-            if(isDebugEnabled) {
+            if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug("No Headers present corresponding to " + addressingVersion);
             }
         }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/AddressingHelper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/AddressingHelper.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/AddressingHelper.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/AddressingHelper.java Sun Feb 25 16:54:21 2007
@@ -20,6 +20,7 @@
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.Parameter;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.axis2.util.Utils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -29,7 +30,6 @@
 public class AddressingHelper {
 
     private static final Log log = LogFactory.getLog(AddressingHelper.class);
-    private static final boolean isDebugEnabled = log.isDebugEnabled();
 
     /**
      * Returns true if the ReplyTo address does not match one of the supported
@@ -42,7 +42,7 @@
     public static boolean isReplyRedirected(MessageContext messageContext) {
         EndpointReference replyTo = messageContext.getReplyTo();
         if (replyTo == null) {
-            if (isDebugEnabled) {
+            if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug(messageContext.getLogIDString()+" isReplyRedirected: ReplyTo is null. Returning false");
             }
             return false;
@@ -62,7 +62,7 @@
     public static boolean isFaultRedirected(MessageContext messageContext) {
         EndpointReference faultTo = messageContext.getFaultTo();
         if (faultTo == null) {
-            if (isDebugEnabled) {
+            if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug(messageContext.getLogIDString()+" isReplyRedirected: FaultTo is null. Returning isReplyRedirected");
             }
             return isReplyRedirected(messageContext);
@@ -101,7 +101,7 @@
         String value = "";
         if (axisOperation != null) {
             value = Utils.getParameterValue(axisOperation.getParameter(AddressingConstants.WSAW_ANONYMOUS_PARAMETER_NAME));
-            if (isDebugEnabled) {
+            if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug("getAnonymousParameterValue: value: '" + value + "'");
             }
         }
@@ -122,7 +122,7 @@
      */
     public static void setAnonymousParameterValue(AxisOperation axisOperation, String value) {
         if (value == null) {
-            if (isDebugEnabled) {
+            if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug("setAnonymousParameterValue: value passed in is null. return");
             }
             return;
@@ -131,12 +131,12 @@
         Parameter param = axisOperation.getParameter(AddressingConstants.WSAW_ANONYMOUS_PARAMETER_NAME);
         // If an existing parameter exists
         if (param != null) {
-            if (isDebugEnabled) {
+            if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug("setAnonymousParameterValue: Parameter already exists");
             }
             // and is not locked
             if (!param.isLocked()) {
-                if (isDebugEnabled) {
+                if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                     log.debug("setAnonymousParameterValue: Parameter not locked. Setting value: " + value);
                 }
                 // set the value
@@ -144,7 +144,7 @@
             }
         } else {
             // otherwise, if no Parameter exists
-            if (isDebugEnabled) {
+            if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug("setAnonymousParameterValue: Parameter does not exist");
             }
             // Create new Parameter with correct name/value
@@ -152,7 +152,7 @@
             param.setName(AddressingConstants.WSAW_ANONYMOUS_PARAMETER_NAME);
             param.setValue(value);
             try {
-                if (isDebugEnabled) {
+                if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                     log.debug("setAnonymousParameterValue: Adding parameter with value: " + value);
                 }
                 // and add it to the AxisOperation object
@@ -161,7 +161,7 @@
                 // This should not happen. AxisFault is only ever thrown when a locked Parameter
                 // of the same name already exists and this should be dealt with by the outer
                 // if statement.
-                if (isDebugEnabled) {
+                if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                     log.debug("setAnonymousParameterValue: addParameter failed: " + af.getMessage());
                 }
             }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java Sun Feb 25 16:54:21 2007
@@ -46,6 +46,7 @@
 import org.apache.axis2.engine.Handler;
 import org.apache.axis2.engine.Phase;
 import org.apache.axis2.util.Builder;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.axis2.util.MetaDataEntry;
 import org.apache.axis2.util.ObjectStateUtils;
 import org.apache.axis2.util.SelfManagedDataHolder;
@@ -79,7 +80,6 @@
      * setup for logging
      */
     private static final Log log = LogFactory.getLog(MessageContext.class);
-    private transient static final boolean isDebugEnabled = log.isDebugEnabled();
 
     /**
      * @serial An ID which can be used to correlate operations on a single
@@ -545,14 +545,14 @@
     }
 
     public AxisOperation getAxisOperation() {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed) {
             checkActivateWarning("getAxisOperation");
         }
         return axisOperation;
     }
 
     public AxisService getAxisService() {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed) {
             checkActivateWarning("getAxisService");
         }
         return axisService;
@@ -564,14 +564,14 @@
      * so the service might not match up with this serviceGroup
     */
     public AxisServiceGroup getAxisServiceGroup() {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed) {
             checkActivateWarning("getAxisServiceGroup");
         }
         return axisServiceGroup;
     }
 
     public ConfigurationContext getConfigurationContext() {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed) {
             checkActivateWarning("getConfigurationContext");
         }
         return configurationContext;
@@ -593,7 +593,7 @@
     }
 
     public ArrayList getExecutionChain() {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed) {
             checkActivateWarning("getExecutionChain");
         }
         return executionChain;
@@ -628,7 +628,7 @@
      * @return An Iterator over the LIFO data structure.
      */
     public Iterator getInboundExecutedPhases() {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed) {
             checkActivateWarning("getInboundExecutedPhases");
         }
         if (inboundExecutedPhases == null) {
@@ -677,7 +677,7 @@
      * @return An Iterator over the LIFO data structure.
      */
     public Iterator getOutboundExecutedPhases() {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed) {
             checkActivateWarning("getOutboundExecutedPhases");
         }
         if (outboundExecutedPhases == null) {
@@ -849,7 +849,7 @@
     }
 
     public OperationContext getOperationContext() {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed) {
             checkActivateWarning("getOperationContext");
         }
         return operationContext;
@@ -912,7 +912,7 @@
      * @return the value of the property, or null if the property is not found
      */
     public Object getProperty(String name) {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed) {
             checkActivateWarning("getProperty");
         }
 
@@ -1009,7 +1009,7 @@
      * @return Returns ServiceContext.
      */
     public ServiceContext getServiceContext() {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed) {
             checkActivateWarning("getServiceContext");
         }
         return serviceContext;
@@ -1023,7 +1023,7 @@
     }
 
     public ServiceGroupContext getServiceGroupContext() {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed) {
             checkActivateWarning("getServiceGroupContext");
         }
         return serviceGroupContext;
@@ -1063,7 +1063,7 @@
      * @return Returns TransportInDescription.
      */
     public TransportInDescription getTransportIn() {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed) {
             checkActivateWarning("getTransportIn");
         }
         return transportIn;
@@ -1073,7 +1073,7 @@
      * @return Returns TransportOutDescription.
      */
     public TransportOutDescription getTransportOut() {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed) {
             checkActivateWarning("getTransportOut");
         }
         return transportOut;
@@ -1453,7 +1453,7 @@
     }
 
     public Options getOptions() {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed) {
             checkActivateWarning("getOptions");
         }
         return options;
@@ -1485,7 +1485,7 @@
 
 
     public Policy getEffectivePolicy() {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed) {
             checkActivateWarning("getEffectivePolicy");
         }
         if (axisMessage != null) {
@@ -1502,7 +1502,7 @@
 
 
     public boolean isEngaged(QName moduleName) {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed) {
             checkActivateWarning("isEngaged");
         }
         boolean enegage;
@@ -1766,7 +1766,7 @@
             }
         }
 
-        if (log.isTraceEnabled()) {
+        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
             Iterator it2 = map.keySet().iterator();
             while (it2.hasNext()) {
                 Object key = it2.next();
@@ -1838,8 +1838,11 @@
                     || (selfManagedDataMap.size() == 0)
                     || (executionChain.size() == 0)) {
                 out.writeBoolean(ObjectStateUtils.EMPTY_OBJECT);
-
-                log.trace(getLogIDString() + ":serializeSelfManagedData(): No data : END");
+                
+                if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled())
+                {
+                  log.trace(getLogIDString() + ":serializeSelfManagedData(): No data : END");
+                }
 
                 return;
             }
@@ -1852,8 +1855,11 @@
 
             if (selfManagedDataHolderList.size() == 0) {
                 out.writeBoolean(ObjectStateUtils.EMPTY_OBJECT);
-
-                log.trace(getLogIDString() + ":serializeSelfManagedData(): No data : END");
+                
+                if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled())
+                {
+                  log.trace(getLogIDString() + ":serializeSelfManagedData(): No data : END");
+                }
 
                 return;
             }
@@ -1901,7 +1907,9 @@
                 if (SelfManagedDataManager.class.isAssignableFrom(handler.getClass())) {
                     // only call the handler's serializeSelfManagedData if it implements SelfManagedDataManager
 
-                    log.trace("MessageContext:serializeSelfManagedDataHelper(): calling handler  [" + handler.getClass().getName() + "]  name [" + handler.getName() + "]   serializeSelfManagedData method");
+                    if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+                      log.trace("MessageContext:serializeSelfManagedDataHelper(): calling handler  [" + handler.getClass().getName() + "]  name [" + handler.getName() + "]   serializeSelfManagedData method");
+                    }
 
                     ByteArrayOutputStream baos_fromHandler = ((SelfManagedDataManager) handler).serializeSelfManagedData(this);
 
@@ -1988,8 +1996,10 @@
                 SelfManagedDataManager handler = deserialize_getHandlerFromExecutionChain(executionChain.iterator(), classname, qNameAsString);
 
                 if (handler == null) {
-                    log.trace(getLogIDString() + ":deserializeSelfManagedData():  [" + classname + "]  was not found in the executionChain associated with the message context.");
-
+                    if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+                      log.trace(getLogIDString() + ":deserializeSelfManagedData():  [" + classname + "]  was not found in the executionChain associated with the message context.");
+                    }
+                    
                     throw new IOException("The class [" + classname + "] was not found in the executionChain associated with the message context.");
                 }
 
@@ -1997,15 +2007,19 @@
 
                 // the handler implementing SelfManagedDataManager is responsible for repopulating
                 // the SelfManagedData in the MessageContext (this)
-
-                log.trace(getLogIDString() + ":deserializeSelfManagedData(): calling handler [" + classname + "] [" + qNameAsString + "]  deserializeSelfManagedData method");
+                
+                if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+                  log.trace(getLogIDString() + ":deserializeSelfManagedData(): calling handler [" + classname + "] [" + qNameAsString + "]  deserializeSelfManagedData method");
+                }
 
                 handler.deserializeSelfManagedData(handlerData, this);
                 handler.restoreTransientData(this);
             }
         }
         catch (IOException ioe) {
-            log.trace(getLogIDString() + ":deserializeSelfManagedData(): IOException thrown: " + ioe.getMessage(), ioe);
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(getLogIDString() + ":deserializeSelfManagedData(): IOException thrown: " + ioe.getMessage(), ioe);
+            }
             throw ioe;
         }
 
@@ -2031,7 +2045,10 @@
      */
     public void writeExternal(ObjectOutput out) throws IOException {
         String logCorrelationIDString = getLogIDString();
-        log.trace(logCorrelationIDString + ":writeExternal(): writing to output stream");
+
+        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+          log.trace(logCorrelationIDString + ":writeExternal(): writing to output stream");
+        }
 
         //---------------------------------------------------------
         // in order to handle future changes to the message 
@@ -2109,7 +2126,9 @@
 
                 msgBuffer.write(msgData.toByteArray(), 0, msgData.size());
 
-                log.trace(logCorrelationIDString + ":writeExternal(): msg data [" + msgData + "]");
+                if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+                  log.trace(logCorrelationIDString + ":writeExternal(): msg data [" + msgData + "]");
+                }
 
             }
             catch (Exception e) {
@@ -2153,12 +2172,16 @@
                 out.writeInt(msgSize);
                 out.write(msgBuffer.toByteArray());
 
-                log.trace(logCorrelationIDString + ":writeExternal(): msg  charSetEnc=[" + charSetEnc + "]  namespaceURI=[" + namespaceURI + "]  msgSize=[" + msgSize + "]");
+                if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+                  log.trace(logCorrelationIDString + ":writeExternal(): msg  charSetEnc=[" + charSetEnc + "]  namespaceURI=[" + namespaceURI + "]  msgSize=[" + msgSize + "]");
+                }
             } else {
                 // the envelope is null
                 out.writeBoolean(ObjectStateUtils.EMPTY_OBJECT);
 
-                log.trace(logCorrelationIDString + ":writeExternal(): msg  is Empty");
+                if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+                  log.trace(logCorrelationIDString + ":writeExternal(): msg  is Empty");
+                }
             }
 
             // close out internal stream
@@ -2168,7 +2191,9 @@
             out.writeUTF("MessageContext.envelope");
             out.writeBoolean(ObjectStateUtils.EMPTY_OBJECT);
 
-            log.trace(logCorrelationIDString + ":writeExternal(): msg  is Empty");
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":writeExternal(): msg  is Empty");
+            }
         }
 
         //---------------------------------------------------------
@@ -2248,7 +2273,9 @@
 
                 // update the index for the entry in the chain
 
-                log.trace(logCorrelationIDString + ":writeExternal(): ***BEFORE OBJ WRITE*** executionChain entry class [" + objClass + "] qname [" + qnameAsString + "]");
+                if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+                  log.trace(logCorrelationIDString + ":writeExternal(): ***BEFORE OBJ WRITE*** executionChain entry class [" + objClass + "] qname [" + qnameAsString + "]");
+                }
 
                 ObjectStateUtils.writeObject(out, mdEntry, logCorrelationIDString + ".executionChain:entry class [" + objClass + "] qname [" + qnameAsString + "]");
 
@@ -2257,7 +2284,9 @@
                 // will be attempted
                 nextIndex++;
 
-                log.trace(logCorrelationIDString + ":writeExternal(): ***AFTER OBJ WRITE*** executionChain entry class [" + objClass + "] qname [" + qnameAsString + "]");
+                if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+                  log.trace(logCorrelationIDString + ":writeExternal(): ***AFTER OBJ WRITE*** executionChain entry class [" + objClass + "] qname [" + qnameAsString + "]");
+                }
 
             } // end while entries in execution chain
 
@@ -2280,7 +2309,9 @@
             out.writeUTF(execChainDesc);
             out.writeBoolean(ObjectStateUtils.EMPTY_OBJECT);
 
-            log.trace(logCorrelationIDString + ":writeExternal(): executionChain is NULL");
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":writeExternal(): executionChain is NULL");
+            }
         }
 
         //---------------------------------------------------------
@@ -2353,7 +2384,9 @@
                 inMdEntry.setQName(inQnameAsString);
 
 
-                log.trace(logCorrelationIDString + ":writeExternal(): ***BEFORE Inbound Executed List OBJ WRITE*** inboundExecutedPhases entry class [" + inObjClass + "] qname [" + inQnameAsString + "]");
+                if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+                  log.trace(logCorrelationIDString + ":writeExternal(): ***BEFORE Inbound Executed List OBJ WRITE*** inboundExecutedPhases entry class [" + inObjClass + "] qname [" + inQnameAsString + "]");
+                }
 
                 ObjectStateUtils.writeObject(out, inMdEntry, logCorrelationIDString + ".inboundExecutedPhases:entry class [" + inObjClass + "] qname [" + inQnameAsString + "]");
 
@@ -2362,11 +2395,12 @@
                 // will be attempted
                 inExecNextIndex++;
 
-                log.trace(logCorrelationIDString + ":writeExternal(): " +
+                if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+                  log.trace(logCorrelationIDString + ":writeExternal(): " +
                         "***AFTER Inbound Executed List OBJ WRITE*** " +
                         "inboundExecutedPhases entry class [" + inObjClass + "] " +
                         "qname [" + inQnameAsString + "]");
-
+                }
             } // end while entries in execution chain
 
             // done with the entries in the execution chain
@@ -2388,7 +2422,9 @@
             out.writeUTF(inExecListDesc);
             out.writeBoolean(ObjectStateUtils.EMPTY_OBJECT);
 
-            log.trace(logCorrelationIDString + ":writeExternal(): inboundExecutedPhases is NULL");
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":writeExternal(): inboundExecutedPhases is NULL");
+            }
         }
 
         //---------------------------------------------------------
@@ -2460,7 +2496,9 @@
 
                 outMdEntry.setQName(outQnameAsString);
 
-                log.trace(logCorrelationIDString + ":writeExternal(): ***BEFORE Outbound Executed List OBJ WRITE*** outboundExecutedPhases entry class [" + outObjClass + "] qname [" + outQnameAsString + "]");
+                if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+                  log.trace(logCorrelationIDString + ":writeExternal(): ***BEFORE Outbound Executed List OBJ WRITE*** outboundExecutedPhases entry class [" + outObjClass + "] qname [" + outQnameAsString + "]");
+                }
 
                 ObjectStateUtils.writeObject(out, outMdEntry, logCorrelationIDString + ".outboundExecutedPhases:entry class [" + outObjClass + "] qname [" + outQnameAsString + "]");
 
@@ -2469,7 +2507,9 @@
                 // will be attempted
                 outExecNextIndex++;
 
-                log.trace(logCorrelationIDString + ":writeExternal(): ***AFTER Outbound Executed List OBJ WRITE*** outboundExecutedPhases entry class [" + outObjClass + "] qname [" + outQnameAsString + "]");
+                if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+                  log.trace(logCorrelationIDString + ":writeExternal(): ***AFTER Outbound Executed List OBJ WRITE*** outboundExecutedPhases entry class [" + outObjClass + "] qname [" + outQnameAsString + "]");
+                }
 
             } // end while entries 
 
@@ -2492,7 +2532,9 @@
             out.writeUTF(outExecListDesc);
             out.writeBoolean(ObjectStateUtils.EMPTY_OBJECT);
 
-            log.trace(logCorrelationIDString + ":writeExternal(): outboundExecutedPhases is NULL");
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":writeExternal(): outboundExecutedPhases is NULL");
+            }
         }
 
         //---------------------------------------------------------
@@ -2770,7 +2812,9 @@
         // done
         //---------------------------------------------------------
 
-        log.trace(logCorrelationIDString + ":writeExternal(): completed writing to output stream for " + logCorrelationIDString);
+        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+          log.trace(logCorrelationIDString + ":writeExternal(): completed writing to output stream for " + logCorrelationIDString);
+        }
 
     }
 
@@ -2794,7 +2838,9 @@
         needsToBeReconciled = true;
 
         // trace point
-        log.trace(myClassName + ":readExternal():  BEGIN  bytes available in stream [" + in.available() + "]  ");
+        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+          log.trace(myClassName + ":readExternal():  BEGIN  bytes available in stream [" + in.available() + "]  ");
+        }
 
         //---------------------------------------------------------
         // object level identifiers
@@ -2842,7 +2888,9 @@
         logCorrelationIDString = "[MessageContext: logID=" + logCorrelationID + "]";
 
         // trace point
-        log.trace(myClassName + ":readExternal():  reading the input stream for  " + logCorrelationIDString);
+        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+          log.trace(myClassName + ":readExternal():  reading the input stream for  " + logCorrelationIDString);
+        }
 
         boolean persistedWithOptimizedMTOM = in.readBoolean();
 
@@ -2874,7 +2922,9 @@
                 if (numberOfBytesLastRead == -1) {
                     // TODO: What should we do if the reconstitution fails?
                     // For now, log the event
+                  if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
                     log.trace(logCorrelationIDString + ":readExternal(): ***WARNING*** unexpected end to message   bytesRead [" + bytesRead + "]    msgSize [" + msgSize + "]");
+                  }
                     break;
                 }
 
@@ -2884,9 +2934,11 @@
 
             String tmpMsg = new String(buffer);
 
-            log.trace(logCorrelationIDString + ":readExternal(): msg  charSetEnc=[" + charSetEnc + "]  namespaceURI=[" + namespaceURI + "]  msgSize=[" + msgSize + "]   bytesRead [" + bytesRead + "]");
-            log.trace(logCorrelationIDString + ":readExternal(): msg  [" + tmpMsg + "]");
-
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":readExternal(): msg  charSetEnc=[" + charSetEnc + "]  namespaceURI=[" + namespaceURI + "]  msgSize=[" + msgSize + "]   bytesRead [" + bytesRead + "]");
+              log.trace(logCorrelationIDString + ":readExternal(): msg  [" + tmpMsg + "]");
+            }
+            
             ByteArrayInputStream msgBuffer ;
 
             if (bytesRead > 0) {
@@ -2919,14 +2971,18 @@
                 // no message
                 envelope = null;
 
-                log.trace(logCorrelationIDString + ":readExternal(): no message from the input stream");
+                if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+                  log.trace(logCorrelationIDString + ":readExternal(): no message from the input stream");
+                }
             }
 
         } else {
             // no message
             envelope = null;
 
-            log.trace(logCorrelationIDString + ":readExternal(): no message present");
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":readExternal(): no message present");
+            }
         }
 
         //---------------------------------------------------------
@@ -2972,7 +3028,9 @@
 
             int expectedNumberEntries = in.readInt();
 
-            log.trace(logCorrelationIDString + ":readExternal(): execution chain:  expected number of entries [" + expectedNumberEntries + "]");
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":readExternal(): execution chain:  expected number of entries [" + expectedNumberEntries + "]");
+            }
 
             // setup the list
             metaExecutionChain = new ArrayList();
@@ -3012,7 +3070,9 @@
                             tmpHasList = "has list";
                         }
 
-                        log.trace(logCorrelationIDString + ":readExternal(): meta data class [" + tmpClassNameStr + "] qname [" + tmpQNameAsStr + "]  index [" + count + "]   [" + tmpHasList + "]");
+                        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+                          log.trace(logCorrelationIDString + ":readExternal(): meta data class [" + tmpClassNameStr + "] qname [" + tmpQNameAsStr + "]  index [" + count + "]   [" + tmpHasList + "]");
+                        }
                     }
                 } else {
                     // some error occurred
@@ -3023,11 +3083,15 @@
 
             int adjustedNumberEntries = in.readInt();
 
-            log.trace(logCorrelationIDString + ":readExternal(): adjusted number of entries ExecutionChain [" + adjustedNumberEntries + "]    ");
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":readExternal(): adjusted number of entries ExecutionChain [" + adjustedNumberEntries + "]    ");
+            }
         }
 
         if ((metaExecutionChain == null) || (metaExecutionChain.isEmpty())) {
+          if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
             log.trace(logCorrelationIDString + ":readExternal(): meta data for Execution Chain is NULL");
+          }
         }
 
         //---------------------------------------------------------
@@ -3065,7 +3129,9 @@
         if (gotInExecList == ObjectStateUtils.ACTIVE_OBJECT) {
             int expectedNumberInExecList = in.readInt();
 
-            log.trace(logCorrelationIDString + ":readExternal(): inbound executed phases:  expected number of entries [" + expectedNumberInExecList + "]");
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":readExternal(): inbound executed phases:  expected number of entries [" + expectedNumberInExecList + "]");
+            }
 
             // setup the list
             metaInboundExecuted = new LinkedList();
@@ -3105,7 +3171,9 @@
                             tmpHasList = "has list";
                         }
 
-                        log.trace(logCorrelationIDString + ":readExternal(): meta data class [" + tmpClassNameStr + "] qname [" + tmpQNameAsStr + "]  index [" + count + "]   [" + tmpHasList + "]");
+                        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+                          log.trace(logCorrelationIDString + ":readExternal(): meta data class [" + tmpClassNameStr + "] qname [" + tmpQNameAsStr + "]  index [" + count + "]   [" + tmpHasList + "]");
+                        }
                     }
                 } else {
                     // some error occurred
@@ -3116,11 +3184,15 @@
 
             int adjustedNumberInExecList = in.readInt();
 
-            log.trace(logCorrelationIDString + ":readExternal(): adjusted number of entries InboundExecutedPhases [" + adjustedNumberInExecList + "]    ");
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":readExternal(): adjusted number of entries InboundExecutedPhases [" + adjustedNumberInExecList + "]    ");
+            }
         }
 
         if ((metaInboundExecuted == null) || (metaInboundExecuted.isEmpty())) {
+          if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
             log.trace(logCorrelationIDString + ":readExternal(): meta data for InboundExecutedPhases list is NULL");
+          }
         }
 
         //---------------------------------------------------------
@@ -3158,7 +3230,9 @@
         if (gotOutExecList == ObjectStateUtils.ACTIVE_OBJECT) {
             int expectedNumberOutExecList = in.readInt();
 
-            log.trace(logCorrelationIDString + ":readExternal(): outbound executed phases:  expected number of entries [" + expectedNumberOutExecList + "]");
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":readExternal(): outbound executed phases:  expected number of entries [" + expectedNumberOutExecList + "]");
+            }
 
             // setup the list
             metaOutboundExecuted = new LinkedList();
@@ -3198,7 +3272,9 @@
                             tmpHasList = "has list";
                         }
 
-                        log.trace(logCorrelationIDString + ":readExternal(): OutboundExecutedPhases: meta data class [" + tmpClassNameStr + "] qname [" + tmpQNameAsStr + "]  index [" + count + "]   [" + tmpHasList + "]");
+                        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+                          log.trace(logCorrelationIDString + ":readExternal(): OutboundExecutedPhases: meta data class [" + tmpClassNameStr + "] qname [" + tmpQNameAsStr + "]  index [" + count + "]   [" + tmpHasList + "]");
+                        }
                     }
                 } else {
                     // some error occurred
@@ -3209,11 +3285,15 @@
 
             int adjustedNumberOutExecList = in.readInt();
 
-            log.trace(logCorrelationIDString + ":readExternal(): adjusted number of entries OutboundExecutedPhases [" + adjustedNumberOutExecList + "]    ");
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":readExternal(): adjusted number of entries OutboundExecutedPhases [" + adjustedNumberOutExecList + "]    ");
+            }
         }
 
         if ((metaOutboundExecuted == null) || (metaOutboundExecuted.isEmpty())) {
+          if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
             log.trace(logCorrelationIDString + ":readExternal(): meta data for OutboundExecutedPhases list is NULL");
+          }
         }
 
         //---------------------------------------------------------
@@ -3223,7 +3303,9 @@
         options = (Options) ObjectStateUtils.readObject(in, "MessageContext.options");
 
         if (options != null) {
+          if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
             log.trace(logCorrelationIDString + ":readExternal(): restored Options [" + options.getLogCorrelationIDString() + "]");
+          }
         }
 
         //---------------------------------------------------------
@@ -3248,7 +3330,9 @@
         operationContext = (OperationContext) ObjectStateUtils.readObject(in, "MessageContext.operationContext");
 
         if (operationContext != null) {
+          if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
             log.trace(logCorrelationIDString + ":readExternal(): restored OperationContext [" + operationContext.getLogCorrelationIDString() + "]");
+          }
         }
 
         //---------------------------------------------------------
@@ -3442,7 +3526,9 @@
         //---------------------------------------------------------
 
         // trace point
-        log.trace(logCorrelationIDString + ":readExternal():  message context object created for  " + logCorrelationIDString);
+        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+          log.trace(logCorrelationIDString + ":readExternal():  message context object created for  " + logCorrelationIDString);
+        }
     }
 
 
@@ -3567,7 +3653,9 @@
         String tmpID = getMessageID();
         String logCorrelationIDString = getLogIDString();
 
-        log.trace(logCorrelationIDString + ":activate():   message ID [" + tmpID + "] for " + logCorrelationIDString);
+        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+          log.trace(logCorrelationIDString + ":activate():   message ID [" + tmpID + "] for " + logCorrelationIDString);
+        }
 
         //---------------------------------------------------------------------
         // transports
@@ -3619,7 +3707,9 @@
         // reconcile the execution chain
         //-------------------------------------------------------
         if (metaExecutionChain != null) {
-            log.trace(logCorrelationIDString + ":activate(): reconciling the execution chain...");
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":activate(): reconciling the execution chain...");
+            }
 
             currentHandlerIndex = metaHandlerIndex;
             currentPhaseIndex = metaPhaseIndex;
@@ -3639,7 +3729,9 @@
         // reconcile the lists for the executed phases
         //-------------------------------------------------------
         if (metaInboundExecuted != null) {
-            log.trace(logCorrelationIDString + ":activate(): reconciling the inbound executed chain...");
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":activate(): reconciling the inbound executed chain...");
+            }
 
             if (!(inboundReset)) {
                 inboundExecutedPhases = restoreExecutedList(inboundExecutedPhases, metaInboundExecuted);
@@ -3652,7 +3744,9 @@
 
 
         if (metaOutboundExecuted != null) {
-            log.trace(logCorrelationIDString + ":activate(): reconciling the outbound executed chain...");
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":activate(): reconciling the outbound executed chain...");
+            }
 
             if (!(outboundReset)) {
                 outboundExecutedPhases = restoreExecutedList(outboundExecutedPhases, metaOutboundExecuted);
@@ -3700,7 +3794,9 @@
 
         String logCorrelationIDString = getLogIDString();
         // trace point
-        log.trace(logCorrelationIDString + ":activateWithOperationContext():  BEGIN");
+        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+          log.trace(logCorrelationIDString + ":activateWithOperationContext():  BEGIN");
+        }
 
         if (operationCtx == null) {
             // won't be able to finish
@@ -3772,7 +3868,9 @@
 
         String tmpID = getMessageID();
 
-        log.trace(logCorrelationIDString + ":activateWithOperationContext():   message ID [" + tmpID + "]");
+        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+          log.trace(logCorrelationIDString + ":activateWithOperationContext():   message ID [" + tmpID + "]");
+        }
 
         //---------------------------------------------------------------------
         // transports
@@ -3826,7 +3924,9 @@
         // reconcile the execution chain
         //-------------------------------------------------------
         if (metaExecutionChain != null) {
-            log.trace(logCorrelationIDString + ":activateWithOperationContext(): reconciling the execution chain...");
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":activateWithOperationContext(): reconciling the execution chain...");
+            }
 
             currentHandlerIndex = metaHandlerIndex;
             currentPhaseIndex = metaPhaseIndex;
@@ -3846,7 +3946,9 @@
         // reconcile the lists for the executed phases
         //-------------------------------------------------------
         if (metaInboundExecuted != null) {
-            log.trace(logCorrelationIDString + ":activateWithOperationContext(): reconciling the inbound executed chain...");
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":activateWithOperationContext(): reconciling the inbound executed chain...");
+            }
 
             if (!(inboundReset)) {
                 inboundExecutedPhases = restoreExecutedList(inboundExecutedPhases, metaInboundExecuted);
@@ -3859,7 +3961,9 @@
 
 
         if (metaOutboundExecuted != null) {
-            log.trace(logCorrelationIDString + ":activateWithOperationContext(): reconciling the outbound executed chain...");
+            if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+              log.trace(logCorrelationIDString + ":activateWithOperationContext(): reconciling the outbound executed chain...");
+            }
 
             if (!(outboundReset)) {
                 outboundExecutedPhases = restoreExecutedList(outboundExecutedPhases, metaOutboundExecuted);
@@ -3875,7 +3979,9 @@
         //-------------------------------------------------------
         needsToBeReconciled = false;
 
-        log.trace(logCorrelationIDString + ":activateWithOperationContext():  END");
+        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+          log.trace(logCorrelationIDString + ":activateWithOperationContext():  END");
+        }
     }
 
 
@@ -4021,7 +4127,9 @@
                 // so add it to the parent
                 mdPhase.addToList(mdEntry);
 
-                log.trace(getLogIDString() + ":setupPhaseList(): list entry class [" + objClass + "] qname [" + qnameAsString + "]");
+                if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+                  log.trace(getLogIDString() + ":setupPhaseList(): list entry class [" + objClass + "] qname [" + qnameAsString + "]");
+                }
 
             } // end while entries in list
         } else {
@@ -4048,7 +4156,9 @@
     public MessageContext extractCopyMessageContext() {
         MessageContext copy = new MessageContext();
         String logCorrelationIDString = getLogIDString();
-        log.trace(logCorrelationIDString + ":extractCopyMessageContext():  based on " + logCorrelationIDString + "   into copy " + copy.getLogIDString());
+        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+          log.trace(logCorrelationIDString + ":extractCopyMessageContext():  based on " + logCorrelationIDString + "   into copy " + copy.getLogIDString());
+        }
 
         //---------------------------------------------------------
         // various simple fields

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/AbstractOperationDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/AbstractOperationDispatcher.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/AbstractOperationDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/AbstractOperationDispatcher.java Sun Feb 25 16:54:21 2007
@@ -21,6 +21,7 @@
 import org.apache.axis2.description.HandlerDescription;
 import org.apache.axis2.handlers.AbstractHandler;
 import org.apache.axis2.i18n.Messages;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -29,7 +30,6 @@
 
     public static final String NAME = "AbstractOperationDispatcher";
     private static final Log log = LogFactory.getLog(AbstractOperationDispatcher.class);
-    private static final boolean isDebugEnabled = log.isDebugEnabled();
 
     public AbstractOperationDispatcher() {
         init(new HandlerDescription(NAME));
@@ -57,7 +57,7 @@
             AxisOperation axisOperation = findOperation(msgctx.getAxisService(), msgctx);
 
             if (axisOperation != null) {
-                if (isDebugEnabled) {
+                if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                     log.debug(msgctx.getLogIDString()+" "+Messages.getMessage("operationfound",
                             axisOperation.getName().getLocalPart()));
                 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/AbstractServiceDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/AbstractServiceDispatcher.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/AbstractServiceDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/AbstractServiceDispatcher.java Sun Feb 25 16:54:21 2007
@@ -20,6 +20,7 @@
 import org.apache.axis2.description.HandlerDescription;
 import org.apache.axis2.handlers.AbstractHandler;
 import org.apache.axis2.i18n.Messages;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -27,7 +28,6 @@
 
     public static final String NAME = "AbstractServiceDispatcher";
     private static final Log log = LogFactory.getLog(AbstractServiceDispatcher.class);
-    private static final boolean isDebugEnabled = log.isDebugEnabled();
 
     public AbstractServiceDispatcher() {
         init(new HandlerDescription(NAME));
@@ -55,7 +55,7 @@
             axisService = findService(msgctx);
 
             if (axisService != null) {
-                if (isDebugEnabled) {
+                if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                     log.debug(msgctx.getLogIDString()+" "+Messages.getMessage("servicefound",
                             axisService.getName()));
                 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/ActionBasedOperationDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/ActionBasedOperationDispatcher.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/ActionBasedOperationDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/ActionBasedOperationDispatcher.java Sun Feb 25 16:54:21 2007
@@ -19,6 +19,7 @@
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -26,13 +27,12 @@
 
     public static final String NAME = "ActionBasedOperationDispatcher";
     private static final Log log = LogFactory.getLog(ActionBasedOperationDispatcher.class);
-    private static final boolean isDebugEnabled = log.isDebugEnabled();
 
     public AxisOperation findOperation(AxisService service, MessageContext messageContext)
             throws AxisFault {
         String action = messageContext.getSoapAction();
 
-        if(isDebugEnabled){
+        if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
         log.debug(messageContext.getLogIDString()+" Checking for Operation using Action : " + action);
         }
         if (action != null) {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RelatesToBasedOperationDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RelatesToBasedOperationDispatcher.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RelatesToBasedOperationDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RelatesToBasedOperationDispatcher.java Sun Feb 25 16:54:21 2007
@@ -22,6 +22,7 @@
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -29,18 +30,17 @@
 
     public static final String NAME = "RelatesToBasedOperationDispatcher";
     private static final Log log = LogFactory.getLog(RelatesToBasedOperationDispatcher.class);
-    private static final boolean isDebugEnabled = log.isDebugEnabled();
 
     public AxisOperation findOperation(AxisService service, MessageContext messageContext) throws AxisFault {
         RelatesTo relatesTo = messageContext.getRelatesTo();
-        if(isDebugEnabled){
+        if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
             log.debug(messageContext.getLogIDString()+" Checking for OperationContext using RelatesTo : " + relatesTo);
         }
         if((relatesTo!=null) && (relatesTo.getValue()!=null)){
             ConfigurationContext configurationContext = messageContext.getConfigurationContext();
             OperationContext operationContext = configurationContext.getOperationContext(relatesTo.getValue());
             if(operationContext != null){
-                if(isDebugEnabled){
+                if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
                     log.debug(messageContext.getLogIDString()+" Found OperationContext: " + operationContext);
                 }
                 return operationContext.getAxisOperation();

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RelatesToBasedServiceDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RelatesToBasedServiceDispatcher.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RelatesToBasedServiceDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RelatesToBasedServiceDispatcher.java Sun Feb 25 16:54:21 2007
@@ -21,6 +21,7 @@
 import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -28,18 +29,17 @@
 
     public static final String NAME = "RelatesToBasedServiceDispatcher";
     private static final Log log = LogFactory.getLog(RelatesToBasedServiceDispatcher.class);
-    private static final boolean isDebugEnabled = log.isDebugEnabled();
 
     public AxisService findService(MessageContext messageContext) throws AxisFault {
         RelatesTo relatesTo = messageContext.getRelatesTo();
-        if(isDebugEnabled){
+        if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
             log.debug(messageContext.getLogIDString()+" Checking for OperationContext using RelatesTo : " + relatesTo);
         }
         if((relatesTo!=null) && (relatesTo.getValue()!=null)){
             ConfigurationContext configurationContext = messageContext.getConfigurationContext();
             OperationContext operationContext = configurationContext.getOperationContext(relatesTo.getValue());
             if(operationContext != null){
-                if(isDebugEnabled){
+                if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
                     log.debug(messageContext.getLogIDString()+" Found OperationContext: " + operationContext);
                 }
                 return operationContext.getServiceContext().getAxisService();

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RequestURIBasedServiceDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RequestURIBasedServiceDispatcher.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RequestURIBasedServiceDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/RequestURIBasedServiceDispatcher.java Sun Feb 25 16:54:21 2007
@@ -20,6 +20,7 @@
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.HandlerDescription;
 import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.axis2.util.Utils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -28,7 +29,6 @@
 
     public static final String NAME = "RequestURIBasedServiceDispatcher";
     private static final Log log = LogFactory.getLog(RequestURIBasedServiceDispatcher.class);
-    private static final boolean isDebugEnabled = log.isDebugEnabled();
 
     /*
      *  (non-Javadoc)
@@ -38,7 +38,7 @@
         EndpointReference toEPR = messageContext.getTo();
 
         if (toEPR != null) {
-            if(isDebugEnabled){
+            if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
                 log.debug(messageContext.getLogIDString()+" Checking for Service using target endpoint address : " + toEPR.getAddress());
             }
             String filePart = toEPR.getAddress();
@@ -52,13 +52,13 @@
 
                 return registry.getService(values[0]);
             } else {
-                if(isDebugEnabled){
+                if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
                     log.debug(messageContext.getLogIDString()+" Attempted to check for Service using target endpoint URI, but the service fragment was missing");
                 }
                 return null;
             }
         } else {
-            if(isDebugEnabled){
+            if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
                 log.debug(messageContext.getLogIDString()+" Attempted to check for Service using null target endpoint URI");
             }
             return null;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedOperationDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedOperationDispatcher.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedOperationDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedOperationDispatcher.java Sun Feb 25 16:54:21 2007
@@ -20,6 +20,7 @@
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -29,7 +30,6 @@
 
     public static final String NAME = "SOAPMessageBodyBasedOperationDispatcher";
     private static final Log log = LogFactory.getLog(SOAPMessageBodyBasedOperationDispatcher.class);
-    private static final boolean isDebugEnabled = log.isDebugEnabled();
 
     public AxisOperation findOperation(AxisService service, MessageContext messageContext)
             throws AxisFault {
@@ -38,7 +38,7 @@
         if (bodyFirstChild == null) {
             return null;
         } else {
-            if(isDebugEnabled){
+            if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
             log.debug(messageContext.getLogIDString()+
                     " Checking for Operation using SOAP message body's first child's local name : "
                             + bodyFirstChild.getLocalName());

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedServiceDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedServiceDispatcher.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedServiceDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dispatchers/SOAPMessageBodyBasedServiceDispatcher.java Sun Feb 25 16:54:21 2007
@@ -21,6 +21,7 @@
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.HandlerDescription;
 import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.axis2.util.Utils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -29,7 +30,6 @@
 
     public static final String NAME = "SOAPMessageBodyBasedServiceDispatcher";
     private static final Log log = LogFactory.getLog(SOAPMessageBodyBasedServiceDispatcher.class);
-    private static final boolean isDebugEnabled = log.isDebugEnabled();
 
     public AxisService findService(MessageContext messageContext) throws AxisFault {
         String serviceName = null;
@@ -41,7 +41,7 @@
             if (ns != null) {
                 String filePart = ns.getNamespaceURI();
 
-                if(isDebugEnabled){
+                if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
                 log.debug(messageContext.getLogIDString()+
                         "Checking for Service using SOAP message body's first child's namespace : "
                                 + filePart);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AbstractDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AbstractDispatcher.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AbstractDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AbstractDispatcher.java Sun Feb 25 16:54:21 2007
@@ -28,6 +28,7 @@
 import org.apache.axis2.description.WSDL2Constants;
 import org.apache.axis2.handlers.AbstractHandler;
 import org.apache.axis2.i18n.Messages;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -46,7 +47,6 @@
      */
     public static final String NAME = "AbstractDispatcher";
     private static final Log log = LogFactory.getLog(AbstractDispatcher.class);
-    private static final boolean isDebugEnabled = log.isDebugEnabled();
 
     public AbstractDispatcher() {
         init(new HandlerDescription(NAME));
@@ -85,7 +85,7 @@
             axisService = findService(msgctx);
 
             if (axisService != null) {
-                if (isDebugEnabled) {
+                if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                     log.debug(msgctx.getLogIDString()+" "+Messages.getMessage("servicefound",
                             axisService.getName()));
                 }
@@ -97,7 +97,7 @@
             AxisOperation axisOperation = findOperation(axisService, msgctx);
 
             if (axisOperation != null) {
-                if (isDebugEnabled) {
+                if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                     log.debug(msgctx.getLogIDString() + " " + Messages.getMessage("operationfound",
                                                                                   axisOperation
                                                                                           .getName().getLocalPart()));

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java Sun Feb 25 16:54:21 2007
@@ -29,6 +29,7 @@
 import org.apache.axis2.description.HandlerDescription;
 import org.apache.axis2.description.WSDL2Constants;
 import org.apache.axis2.i18n.Messages;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.axis2.util.Utils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -46,12 +47,11 @@
      */
     public static final String NAME = "AddressingBasedDispatcher";
     private static final Log log = LogFactory.getLog(AddressingBasedDispatcher.class);
-    private static final boolean isDebugEnabled = log.isDebugEnabled();
 
     // TODO this logic needed to be improved, as the Dispatching is almost guaranteed to fail
     public AxisOperation findOperation(AxisService service, MessageContext messageContext)
             throws AxisFault {
-        if(isDebugEnabled){
+        if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
         log.debug(messageContext.getLogIDString()+" "+Messages.getMessage("checkingoperation",
                 messageContext.getWSAAction()));
         }
@@ -75,7 +75,7 @@
             }
 
             String address = toEPR.getAddress();
-            if(isDebugEnabled){
+            if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
             log.debug(messageContext.getLogIDString()+" "+Messages.getMessage("checkingserviceforepr", address));
             }
             QName serviceName;
@@ -86,7 +86,7 @@
                 return null;
             }
 
-            if(isDebugEnabled){
+            if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
             log.debug(messageContext.getLogIDString()+" "+Messages.getMessage("checkingserviceforepr", values[0]));
             }
             if (values[0] != null) {
@@ -133,7 +133,7 @@
         if (msgctx.getRelatesTo() != null) {
             String relatesTo = msgctx.getRelatesTo().getValue();
 
-            if(isDebugEnabled){
+            if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
                 log.debug(msgctx.getLogIDString()+" "+Messages.getMessage("checkingrelatesto",
                     relatesTo));
             }
@@ -157,7 +157,7 @@
                     msgctx.setServiceGroupContextId(
                             ((ServiceGroupContext) msgctx.getServiceContext().getParent()).getId());
                     
-                    if(isDebugEnabled){
+                    if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
                         log.debug(msgctx.getLogIDString()+" Dispatched successfully on the RelatesTo. operation="+operationContext.getAxisOperation());
                     }
                     return InvocationResponse.CONTINUE;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java Sun Feb 25 16:54:21 2007
@@ -33,6 +33,7 @@
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.transport.TransportSender;
 import org.apache.axis2.util.CallbackReceiver;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.axis2.util.MessageContextBuilder;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -50,8 +51,6 @@
      * Field log
      */
     private static final Log log = LogFactory.getLog(AxisEngine.class);
-    private static final boolean isTraceEnabled = log.isTraceEnabled();
-    private static final boolean isDebugEnabled = log.isDebugEnabled();
     private ConfigurationContext engineContext;
 
     private static boolean RESUMING_EXECUTION = true;
@@ -156,7 +155,7 @@
      * @see Handler
      */
     public InvocationResponse receive(MessageContext msgContext) throws AxisFault {
-        if(isTraceEnabled){
+        if(LoggingControl.debugLoggingAllowed && log.isTraceEnabled()){
             log.trace(msgContext.getLogIDString()+" receive:"+msgContext.getMessageID());
         }
         ConfigurationContext confContext = msgContext.getConfigurationContext();
@@ -300,7 +299,7 @@
      * @throws AxisFault
      */
     public InvocationResponse resumeReceive(MessageContext msgContext) throws AxisFault {
-        if(isTraceEnabled){
+        if(LoggingControl.debugLoggingAllowed && log.isTraceEnabled()){
             log.trace(msgContext.getLogIDString()+" resumeReceive:"+msgContext.getMessageID());
         }
 
@@ -342,7 +341,7 @@
      * @throws AxisFault
      */
     public InvocationResponse resumeSend(MessageContext msgContext) throws AxisFault {
-        if(isTraceEnabled){
+        if(LoggingControl.debugLoggingAllowed && log.isTraceEnabled()){
             log.trace(msgContext.getLogIDString()+" resumeSend:"+msgContext.getMessageID());
         }
 
@@ -374,7 +373,7 @@
      * @throws AxisFault
      */
     public InvocationResponse receiveFault(MessageContext msgContext) throws AxisFault {
-        if(isDebugEnabled) {
+        if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
             log.debug(msgContext.getLogIDString()+" "+Messages.getMessage("receivederrormessage",
                     msgContext.getMessageID()));
         }
@@ -428,7 +427,7 @@
      * @throws AxisFault
      */
     public InvocationResponse resume(MessageContext msgctx) throws AxisFault {
-        if(isTraceEnabled){
+        if(LoggingControl.debugLoggingAllowed && log.isTraceEnabled()){
             log.trace(msgctx.getLogIDString()+" resume:"+msgctx.getMessageID());
         }
 
@@ -452,7 +451,7 @@
      * @see Handler
      */
     public void send(MessageContext msgContext) throws AxisFault {
-        if(isTraceEnabled){
+        if(LoggingControl.debugLoggingAllowed && log.isTraceEnabled()){
             log.trace(msgContext.getLogIDString()+" send:"+msgContext.getMessageID());
         }
         // find and invoke the Phases
@@ -510,7 +509,7 @@
      * @throws AxisFault
      */
     public void sendFault(MessageContext msgContext) throws AxisFault {
-        if(isTraceEnabled){
+        if(LoggingControl.debugLoggingAllowed && log.isTraceEnabled()){
             log.trace(msgContext.getLogIDString()+" sendFault:"+msgContext.getMessageID());
         }
         OperationContext opContext = msgContext.getOperationContext();

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/Phase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/Phase.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/Phase.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/Phase.java Sun Feb 25 16:54:21 2007
@@ -23,6 +23,7 @@
 import org.apache.axis2.description.Parameter;
 import org.apache.axis2.description.PhaseRule;
 import org.apache.axis2.phaseresolver.PhaseException;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -90,8 +91,6 @@
         this(null);
     }
 
-    public static boolean isDebugEnabled = log.isDebugEnabled();
-    
     /**
      * Constructor Phase.
      *
@@ -357,7 +356,7 @@
      * @throws org.apache.axis2.AxisFault
      */
     public final InvocationResponse invoke(MessageContext msgctx) throws AxisFault {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
             log.debug(msgctx.getLogIDString()+" Checking pre-condition for Phase \"" + phaseName + "\"");
         }
         
@@ -369,14 +368,14 @@
             checkPreconditions(msgctx);
         }
 
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
             log.debug(msgctx.getLogIDString()+" Invoking phase \"" + phaseName + "\"");
         }
 
         while (currentIndex < handlers.size()) {
             Handler handler = (Handler) handlers.get(currentIndex);
 
-            if (isDebugEnabled) {
+            if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug(msgctx.getLogIDString()+" Invoking Handler '" + handler.getName() + "' in Phase '" + phaseName + "'");
             }
             pi = handler.invoke(msgctx);
@@ -389,7 +388,7 @@
             msgctx.setCurrentPhaseIndex(currentIndex);
         }
 
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
             log.debug(msgctx.getLogIDString()+" Checking post-conditions for phase \"" + phaseName + "\"");
         }
 
@@ -399,7 +398,7 @@
     }
 
     public void flowComplete(MessageContext msgContext) {
-        if (isDebugEnabled) {
+        if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
         log.debug(msgContext.getLogIDString()+" Invoking flowComplete() in Phase \"" + phaseName + "\"");
       }
       
@@ -417,7 +416,7 @@
         for (; currentHandlerIndex > 0; currentHandlerIndex--) {
         Handler handler = (Handler) handlers.get(currentHandlerIndex-1);
         
-            if (isDebugEnabled) {
+            if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
           log.debug(msgContext.getLogIDString()+" Invoking flowComplete() for Handler '" + handler.getName() + "' in Phase '" + phaseName + "'");
         }
         

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java Sun Feb 25 16:54:21 2007
@@ -25,6 +25,7 @@
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.HandlerDescription;
 import org.apache.axis2.description.WSDL2Constants;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.axis2.util.Utils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -38,7 +39,6 @@
 
     public static final String NAME = "RequestURIBasedDispatcher";
     private static final Log log = LogFactory.getLog(RequestURIBasedDispatcher.class);
-    private static final boolean isDebugEnabled = log.isDebugEnabled();
 
     /*
      *  (non-Javadoc)
@@ -59,13 +59,13 @@
         EndpointReference toEPR = messageContext.getTo();
 
         if (toEPR != null) {
-            if (isDebugEnabled) {
+            if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug(messageContext.getLogIDString() +
                         " Checking for Service using target endpoint address : " +
                         toEPR.getAddress());
             }
             String filePart = toEPR.getAddress();
-            //REVIEW: (nagy) Parsing the RequestURI will also give us the operationName if present, so we could conceivably store it in the MessageContext, but doing so and retrieving it is probably no faster than simply reparsing the URI
+            //REVIEW: Parsing the RequestURI will also give us the operationName if present, so we could conceivably store it in the MessageContext, but doing so and retrieving it is probably no faster than simply reparsing the URI
             ConfigurationContext configurationContext = messageContext.getConfigurationContext();
             String[] values = Utils.parseRequestURLForServiceAndOperation(filePart,
                                                                           configurationContext.getServiceContextPath());
@@ -95,14 +95,14 @@
 
                 return axisService;
             } else {
-                if (isDebugEnabled) {
+                if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                     log.debug(messageContext.getLogIDString() +
                             " Attempted to check for Service using target endpoint URI, but the service fragment was missing");
                 }
                 return null;
             }
         } else {
-            if (isDebugEnabled) {
+            if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug(messageContext.getLogIDString() +
                         " Attempted to check for Service using null target endpoint URI");
             }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java Sun Feb 25 16:54:21 2007
@@ -22,6 +22,7 @@
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -37,13 +38,12 @@
      */
     public static final String NAME = "SOAPActionBasedDispatcher";
     private static final Log log = LogFactory.getLog(SOAPActionBasedDispatcher.class);
-    private static final boolean isDebugEnabled = log.isDebugEnabled();
 
     public AxisOperation findOperation(AxisService service, MessageContext messageContext)
             throws AxisFault {
         String action = messageContext.getSoapAction();
 
-        if(isDebugEnabled){
+        if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
             log.debug(messageContext.getLogIDString() +
                     " Checking for Operation using SOAPAction : " + action);
         }
@@ -75,7 +75,7 @@
      * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
      */
     public AxisService findService(MessageContext messageContext) throws AxisFault {
-        if(isDebugEnabled){
+        if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
         log.debug(messageContext.getLogIDString()+" Checking for Service using SOAPAction is a TODO item");
         }
         return null;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java Sun Feb 25 16:54:21 2007
@@ -25,6 +25,7 @@
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.util.LoggingControl;
 import org.apache.axis2.util.Utils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -42,7 +43,6 @@
      */
     public static final String NAME = "SOAPMessageBodyBasedDispatcher";
     private static final Log log = LogFactory.getLog(SOAPMessageBodyBasedDispatcher.class);
-    private static final boolean isDebugEnabled = log.isDebugEnabled();
 
     public AxisOperation findOperation(AxisService service, MessageContext messageContext)
             throws AxisFault {
@@ -53,7 +53,7 @@
         if (bodyFirstChild == null) {
             return null;
         } else {
-            if(isDebugEnabled){
+            if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
             log.debug(messageContext.getLogIDString()+
                     " Checking for Operation using SOAP message body's first child's local name : "
                             + bodyFirstChild.getLocalName());
@@ -84,7 +84,7 @@
             if (ns != null) {
                 String filePart = ns.getNamespaceURI();
 
-                if(isDebugEnabled){
+                if(LoggingControl.debugLoggingAllowed && log.isDebugEnabled()){
                 log.debug(messageContext.getLogIDString()+
                         " Checking for Service using SOAP message body's first child's namespace : "
                                 + filePart);

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/LoggingControl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/LoggingControl.java?view=auto&rev=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/LoggingControl.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/LoggingControl.java Sun Feb 25 16:54:21 2007
@@ -0,0 +1,39 @@
+/*
+* Copyright 2007 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+package org.apache.axis2.util;
+
+/**
+ * This class provides a more efficient means of control over logging than
+ * do most providers of the Common's logging API at the cost of runtime
+ * flexibility.
+ */
+public class LoggingControl
+{
+  /**
+   * If this flag is set to false then debug messages will not be logged,
+   * irrespective of the level set for the logger itself.  This can only
+   * be changed as the result of a JVM restart or a purge and reloading
+   * of this class.
+   * 
+   * Usage: if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled())...
+   *        or
+   *        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled())...
+   */
+  public static final boolean debugLoggingAllowed =
+    (System.getProperty("Axis2.prohibitDebugLogging") == null);
+}

Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java?view=diff&rev=511681&r1=511680&r2=511681
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/engine/MessageContextChangeTest.java Sun Feb 25 16:54:21 2007
@@ -132,7 +132,6 @@
         new FieldDescription("java.lang.String", "selfManagedDataDelimiter"),
         new FieldDescription("java.lang.Class", "class$org$apache$axis2$context$MessageContext"),
         new FieldDescription("java.lang.Class", "class$org$apache$axis2$context$SelfManagedDataManager"),
-        new FieldDescription("boolean", "isDebugEnabled"),
     };
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org