Bill,

Am not worried about ease of use of the developers. This thing needs
to perform in a production environment. If it wastes 5 mins of
developer time in editing code. So be it!

thanks,
dims

On 2/5/07, Bill Nagy <[EMAIL PROTECTED]> wrote:
Hi dims,

Thank you for wrapping those, but 2 points: (1) they need to be wrapped
with a log.isWarnEnabled(...) and not a log.isDebugEnabled(...), as the
output message is log.warn(...) and not log.debug(...) and (2) please
don't use a static (and especially a static final) to control logging,
because that prevents users from changing log levels after a class has
been loaded.  Thanks.

-Bill


On Sun, 2007-02-04 at 22:49 +0000, [EMAIL PROTECTED] wrote:
> Author: dims
> Date: Sun Feb  4 14:49:15 2007
> New Revision: 503499
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=503499
> Log:
> no need to call no-op methods that prints warnings unless debug is enabled
>
> Modified:
>     
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java
>
> 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=503499&r1=503498&r2=503499
> ==============================================================================
> --- 
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  4 14:49:15 2007
> @@ -88,6 +88,7 @@
>       * setup for logging
>       */
>      private static final Log log = LogFactory.getLog(MessageContext.class);
> +    private static final boolean isDebugEnabled = log.isDebugEnabled();
>
>      /**
>       * @serial An ID which can be used to correlate operations on a single
> @@ -570,12 +571,16 @@
>      }
>
>      public AxisOperation getAxisOperation() {
> -        checkActivateWarning("getAxisOperation");
> +        if(isDebugEnabled) {
> +            checkActivateWarning("getAxisOperation");
> +        }
>          return axisOperation;
>      }
>
>      public AxisService getAxisService() {
> -        checkActivateWarning("getAxisService");
> +        if(isDebugEnabled) {
> +            checkActivateWarning("getAxisService");
> +        }
>          return axisService;
>      }
>
> @@ -585,12 +590,16 @@
>       * so the service might not match up with this serviceGroup
>      */
>      public AxisServiceGroup getAxisServiceGroup() {
> -        checkActivateWarning("getAxisServiceGroup");
> +        if(isDebugEnabled) {
> +            checkActivateWarning("getAxisServiceGroup");
> +        }
>          return axisServiceGroup;
>      }
>
>      public ConfigurationContext getConfigurationContext() {
> -        checkActivateWarning("getConfigurationContext");
> +        if(isDebugEnabled) {
> +            checkActivateWarning("getConfigurationContext");
> +        }
>          return configurationContext;
>      }
>
> @@ -610,7 +619,9 @@
>      }
>
>      public ArrayList getExecutionChain() {
> -        checkActivateWarning("getExecutionChain");
> +        if(isDebugEnabled) {
> +            checkActivateWarning("getExecutionChain");
> +        }
>          return executionChain;
>      }
>
> @@ -646,7 +657,9 @@
>       */
>      public Iterator getInboundExecutedPhases()
>      {
> -        checkActivateWarning("getInboundExecutedPhases");
> +        if(isDebugEnabled) {
> +            checkActivateWarning("getInboundExecutedPhases");
> +        }
>          if (inboundExecutedPhases == null)
>          {
>              inboundExecutedPhases = new LinkedList();
> @@ -698,7 +711,9 @@
>       */
>      public Iterator getOutboundExecutedPhases()
>      {
> -        checkActivateWarning("getOutboundExecutedPhases");
> +        if(isDebugEnabled) {
> +            checkActivateWarning("getOutboundExecutedPhases");
> +        }
>          if (outboundExecutedPhases == null)
>          {
>              outboundExecutedPhases = new LinkedList();
> @@ -870,7 +885,9 @@
>      }
>
>      public OperationContext getOperationContext() {
> -        checkActivateWarning("getOperationContext");
> +        if(isDebugEnabled) {
> +            checkActivateWarning("getOperationContext");
> +        }
>          return operationContext;
>      }
>
> @@ -931,7 +948,9 @@
>       * @return the value of the property, or null if the property is not 
found
>       */
>      public Object getProperty(String name) {
> -        checkActivateWarning("getProperty");
> +        if(isDebugEnabled) {
> +            checkActivateWarning("getProperty");
> +        }
>
>          // search in my own options
>          Object obj = options.getProperty(name);
> @@ -1026,7 +1045,9 @@
>       * @return Returns ServiceContext.
>       */
>      public ServiceContext getServiceContext() {
> -        checkActivateWarning("getServiceContext");
> +        if(isDebugEnabled) {
> +            checkActivateWarning("getServiceContext");
> +        }
>          return serviceContext;
>      }
>
> @@ -1038,7 +1059,9 @@
>      }
>
>      public ServiceGroupContext getServiceGroupContext() {
> -        checkActivateWarning("getServiceGroupContext");
> +        if(isDebugEnabled) {
> +            checkActivateWarning("getServiceGroupContext");
> +        }
>          return serviceGroupContext;
>      }
>
> @@ -1076,7 +1099,9 @@
>       * @return Returns TransportInDescription.
>       */
>      public TransportInDescription getTransportIn() {
> -        checkActivateWarning("getTransportIn");
> +        if(isDebugEnabled) {
> +            checkActivateWarning("getTransportIn");
> +        }
>          return transportIn;
>      }
>
> @@ -1084,7 +1109,9 @@
>       * @return Returns TransportOutDescription.
>       */
>      public TransportOutDescription getTransportOut() {
> -        checkActivateWarning("getTransportOut");
> +        if(isDebugEnabled) {
> +            checkActivateWarning("getTransportOut");
> +        }
>          return transportOut;
>      }
>
> @@ -1462,7 +1489,9 @@
>      }
>
>      public Options getOptions() {
> -        checkActivateWarning("getOptions");
> +        if(isDebugEnabled) {
> +            checkActivateWarning("getOptions");
> +        }
>          return options;
>      }
>
> @@ -1492,7 +1521,9 @@
>
>
>      public Policy getEffectivePolicy() {
> -        checkActivateWarning("getEffectivePolicy");
> +        if(isDebugEnabled) {
> +            checkActivateWarning("getEffectivePolicy");
> +        }
>          if (axisMessage != null) {
>              return axisMessage.getPolicyInclude().getEffectivePolicy();
>          }
> @@ -1507,7 +1538,9 @@
>
>
>      public boolean isEngaged(QName moduleName) {
> -        checkActivateWarning("isEngaged");
> +        if(isDebugEnabled) {
> +            checkActivateWarning("isEngaged");
> +        }
>          boolean enegage;
>          if (configurationContext != null) {
>              AxisConfiguration axisConfig = 
configurationContext.getAxisConfiguration();
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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




--
Davanum Srinivas :: http://wso2.org/ :: Oxygen for Web Services Developers

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

Reply via email to