You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by in...@apache.org on 2007/05/22 11:12:35 UTC

svn commit: r540501 - /webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java

Author: indika
Date: Tue May 22 02:12:34 2007
New Revision: 540501

URL: http://svn.apache.org/viewvc?view=rev&rev=540501
Log:
fixed NPE in the throttle mediator 

Modified:
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java

Modified: webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java?view=diff&rev=540501&r1=540500&r2=540501
==============================================================================
--- webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java (original)
+++ webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java Tue May 22 02:12:34 2007
@@ -83,10 +83,11 @@
      * @return boolean which indicate whether this caller can or not access
      */
     protected boolean canAccess(MessageContext synContext, boolean shouldTrace) {
-        boolean canAccess = true;
         if (throttle == null) {
             log.debug("Can not find a throttle");
+            return true;
         }
+        boolean canAccess = true;               
         org.apache.axis2.context.MessageContext axis2MessageContext
                 = ((Axis2MessageContext) synContext).getAxis2MessageContext();
         //IP based throttling
@@ -173,16 +174,16 @@
         if (policyKey != null) {
             Entry entry = synContext.getConfiguration().getEntryDefinition(policyKey);
             if (entry == null) {
-                log.warn("Cant not find a Entry from the Entry key " + policyKey);
+                log.debug("Cant not find a Entry from the Entry key " + policyKey);
                 return;
             }
             Object entryValue = entry.getValue();
             if (entryValue == null) {
-                log.warn("Cant not find a Policy(Enrty value) from the Entry key " + policyKey);
+                log.debug("Cant not find a Policy(Enrty value) from the Entry key " + policyKey);
                 return;
             }
             if (!(entryValue instanceof OMElement)) {
-                log.warn("Entry value which is refered from the key " + policyKey + " is Incompatible " +
+                log.debug("Entry value which is refered from the key " + policyKey + " is Incompatible " +
                         "for the policy element");
                 return;
             }
@@ -195,7 +196,7 @@
             policyOmElement = inLinePolicy;
         }
         if (policyOmElement == null) {
-            log.warn("Cant not find a Policy - Throttling will not occur");
+            log.debug("Cant not find a Policy - Throttling will not occur");
             return;
         }
         if (shouldTrace) {



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