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 Bill Nagy <na...@watson.ibm.com> on 2007/02/05 06:53:10 UTC

[Axis2]Re: svn commit: r503499 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java

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, dims@apache.org 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: axis-cvs-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-cvs-help@ws.apache.org


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


Re: [Axis2]Re: svn commit: r503499 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java

Posted by Davanum Srinivas <da...@gmail.com>.
Sounds good Bill. Please go ahead with that change when you get a chance.

thanks,
dims

On 2/5/07, Bill Nagy <na...@watson.ibm.com> wrote:
> Hi dims,
>
> I am worried about the ease of use of developers, but not necessarily in
> this particular case.  What I am worried about, however, is requiring
> people to recycle their application server (restart their JVM) in
> production environments simply to alter logging levels to debug an
> issue.  If you want to skip the isDebugEnabled(...) etc, do something
> like:
>
> private static final boolean loggingEnabled =
> (System.getProperty("Axis2.disableLogging") == null);
>
> if (loggingEnabled && isDebugEnabled(...))
> {
>   log.debug(...);
> }
>
> (I would also put that System.getProperty(...) in a single class so that
> you don't have every class invoke it [an expensive op] on loading.)
>
> -Bill
>
>
> On Mon, 2007-02-05 at 04:29 -0500, Davanum Srinivas wrote:
> > 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 <na...@watson.ibm.com> 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, dims@apache.org 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: axis-cvs-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: axis-cvs-help@ws.apache.org
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-cvs-help@ws.apache.org
> > >
> > >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>


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

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


Re: [Axis2]Re: svn commit: r503499 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java

Posted by Bill Nagy <na...@watson.ibm.com>.
Hi dims,

I am worried about the ease of use of developers, but not necessarily in
this particular case.  What I am worried about, however, is requiring
people to recycle their application server (restart their JVM) in
production environments simply to alter logging levels to debug an
issue.  If you want to skip the isDebugEnabled(...) etc, do something
like:

private static final boolean loggingEnabled =
(System.getProperty("Axis2.disableLogging") == null);

if (loggingEnabled && isDebugEnabled(...))
{
  log.debug(...);
}

(I would also put that System.getProperty(...) in a single class so that
you don't have every class invoke it [an expensive op] on loading.)

-Bill


On Mon, 2007-02-05 at 04:29 -0500, Davanum Srinivas wrote:
> 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 <na...@watson.ibm.com> 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, dims@apache.org 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: axis-cvs-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-cvs-help@ws.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-cvs-help@ws.apache.org
> >
> >
> 
> 


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


Re: [Axis2]Re: svn commit: r503499 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java

Posted by Davanum Srinivas <da...@gmail.com>.
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 <na...@watson.ibm.com> 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, dims@apache.org 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: axis-cvs-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-cvs-help@ws.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-cvs-help@ws.apache.org
>
>


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

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


Re: [Axis2]Re: svn commit: r503499 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java

Posted by Davanum Srinivas <da...@gmail.com>.
On 2/5/07, Davanum Srinivas <da...@gmail.com> wrote:
> Sorry. As they say "All's fair in love and war" same case with performance :)
>
> -- dims
>
> On 2/5/07, Bill Nagy <na...@watson.ibm.com> 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, dims@apache.org 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: axis-cvs-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-cvs-help@ws.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-cvs-help@ws.apache.org
> >
> >
>
>
> --
> Davanum Srinivas :: http://wso2.org/ :: Oxygen for Web Services Developers
>


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

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


Re: [Axis2]Re: svn commit: r503499 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java

Posted by Davanum Srinivas <da...@gmail.com>.
Sorry. As they say "All's fair in love and war" same case with performance :)

-- dims

On 2/5/07, Bill Nagy <na...@watson.ibm.com> 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, dims@apache.org 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: axis-cvs-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-cvs-help@ws.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-cvs-help@ws.apache.org
>
>


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

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


Re: [Axis2]Re: svn commit: r503499 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java

Posted by Davanum Srinivas <da...@gmail.com>.
Sorry. As they say "All's fair in love and war" same case with performance :)

-- dims

On 2/5/07, Bill Nagy <na...@watson.ibm.com> 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, dims@apache.org 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: axis-cvs-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-cvs-help@ws.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-cvs-help@ws.apache.org
>
>


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

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