axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r478996 - in /webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2: context/ engine/ util/
Date Fri, 24 Nov 2006 21:07:24 GMT
Author: dims
Date: Fri Nov 24 13:07:23 2006
New Revision: 478996

URL: http://svn.apache.org/viewvc?view=rev&rev=478996
Log:
yet another Fix for AXIS2-1769 for performance

Modified:
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/context/AbstractContext.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/AbstractDispatcher.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/util/UUIDGenerator.java

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/context/AbstractContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/context/AbstractContext.java?view=diff&rev=478996&r1=478995&r2=478996
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/context/AbstractContext.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/context/AbstractContext.java
Fri Nov 24 13:07:23 2006
@@ -126,7 +126,7 @@
      * it will go and update operationCOntext -> serviceContext -> serviceGroupContext.
      */
     protected void touch() {
-        lastTouchedTime = new Date().getTime();
+        lastTouchedTime = System.currentTimeMillis();
         if (parent != null) {
             parent.touch();
         }

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/AbstractDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/AbstractDispatcher.java?view=diff&rev=478996&r1=478995&r2=478996
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/AbstractDispatcher.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/AbstractDispatcher.java
Fri Nov 24 13:07:23 2006
@@ -42,6 +42,7 @@
      */
     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));
@@ -80,7 +81,7 @@
             axisService = findService(msgctx);
 
             if (axisService != null) {
-                if (log.isDebugEnabled()) {
+                if (isDebugEnabled) {
                     log.debug(Messages.getMessage("servicefound",
                             axisService.getName()));
                 }
@@ -92,7 +93,7 @@
             AxisOperation axisOperation = findOperation(axisService, msgctx);
 
             if (axisOperation != null) {
-                if (log.isDebugEnabled()) {
+                if (isDebugEnabled) {
                     log.debug(Messages.getMessage("operationfound",
                             axisOperation.getName().getLocalPart()));
                 }

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java?view=diff&rev=478996&r1=478995&r2=478996
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.java
Fri Nov 24 13:07:23 2006
@@ -44,13 +44,15 @@
      */
     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 {
-        log.debug(Messages.getMessage("checkingoperation",
-                messageContext.getWSAAction()));
-
+        if(isDebugEnabled){
+            log.debug(Messages.getMessage("checkingoperation",
+                    messageContext.getWSAAction()));
+        }
         String action = messageContext.getWSAAction();
 
         if (action != null) {
@@ -70,8 +72,9 @@
             }
             
             String address = toEPR.getAddress();
-            log.debug(Messages.getMessage("checkingserviceforepr", address));
-
+            if(isDebugEnabled){
+                log.debug(Messages.getMessage("checkingserviceforepr", address));
+            }
             QName serviceName;
             String[] values = Utils.parseRequestURLForServiceAndOperation(address,
                     messageContext.getConfigurationContext().getServiceContextPath());
@@ -79,8 +82,9 @@
                 return null;
             }
 
-            log.debug(Messages.getMessage("checkingserviceforepr", values[0]));
-
+            if(isDebugEnabled){
+                log.debug(Messages.getMessage("checkingserviceforepr", values[0]));
+            }
             if (values[0] != null) {
                 serviceName = new QName(values[0]);
 
@@ -108,9 +112,10 @@
         if (msgctx.getRelatesTo() != null) {
             String relatesTo = msgctx.getRelatesTo().getValue();
 
-            log.debug(Messages.getMessage("checkingrelatesto",
-                    relatesTo));
-
+            if(isDebugEnabled){
+                log.debug(Messages.getMessage("checkingrelatesto",
+                        relatesTo));
+            }
             if ((relatesTo != null) || "".equals(relatesTo)) {
                 OperationContext operationContext =
                         msgctx.getConfigurationContext().getOperationContext(msgctx.getRelatesTo().getValue());

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java?view=diff&rev=478996&r1=478995&r2=478996
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/RequestURIBasedDispatcher.java
Fri Nov 24 13:07:23 2006
@@ -36,6 +36,7 @@
 
     public static final String NAME = "RequestURIBasedDispatcher";
     private static final Log log = LogFactory.getLog(RequestURIBasedDispatcher.class);
+    private static final boolean isDebugEnabled = log.isDebugEnabled();
 
     /*
      *  (non-Javadoc)
@@ -52,14 +53,20 @@
 
             if ((values.length >= 2) && (values[1] != null)) {
                 QName operationName = new QName(values[1]);
-                log.debug("Checking for Operation using QName(target endpoint URI fragment)
: " + operationName);
+                if(isDebugEnabled){
+                    log.debug("Checking for Operation using QName(target endpoint URI fragment)
: " + operationName);
+                }
                 return service.getOperation(operationName);
             } else {
-                log.debug("Attempted to check for Operation using target endpoint URI, but
the operation fragment was missing");
+                if(isDebugEnabled){
+                    log.debug("Attempted to check for Operation using target endpoint URI,
but the operation fragment was missing");
+                }
                 return null;
             }
         } else {
-            log.debug("Attempted to check for Operation using null target endpoint URI");
+            if(isDebugEnabled){
+                log.debug("Attempted to check for Operation using null target endpoint URI");
+            }
             return null;
         }
     }
@@ -72,8 +79,9 @@
         EndpointReference toEPR = messageContext.getTo();
 
         if (toEPR != null) {
-            log.debug("Checking for Service using target endpoint address : " + toEPR.getAddress());
-
+            if(isDebugEnabled){
+                log.debug("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
             String[] values = Utils.parseRequestURLForServiceAndOperation(filePart,
@@ -85,11 +93,15 @@
 
                 return registry.getService(values[0]);
             } else {
-                log.debug("Attempted to check for Service using target endpoint URI, but
the service fragment was missing");
+                if(isDebugEnabled){
+                    log.debug("Attempted to check for Service using target endpoint URI,
but the service fragment was missing");
+                }
                 return null;
             }
         } else {
-            log.debug("Attempted to check for Service using null target endpoint URI");
+            if(isDebugEnabled){
+                log.debug("Attempted to check for Service using null target endpoint URI");
+            }
             return null;
         }
     }

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java?view=diff&rev=478996&r1=478995&r2=478996
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/SOAPActionBasedDispatcher.java
Fri Nov 24 13:07:23 2006
@@ -37,13 +37,15 @@
      */
     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();
 
-        log.debug("Checking for Operation using SOAPAction : " + action);
-
+        if(isDebugEnabled){
+            log.debug("Checking for Operation using SOAPAction : " + action);
+        }
         if (action != null) {
             AxisOperation op = service.getOperationBySOAPAction(action);
 
@@ -72,8 +74,9 @@
      * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
      */
     public AxisService findService(MessageContext messageContext) throws AxisFault {
-        log.debug("Checking for Service using SOAPAction is a TODO item");
-
+        if(isDebugEnabled){
+            log.debug("Checking for Service using SOAPAction is a TODO item");
+        }
         return null;
     }
 

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java?view=diff&rev=478996&r1=478995&r2=478996
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/engine/SOAPMessageBodyBasedDispatcher.java
Fri Nov 24 13:07:23 2006
@@ -43,6 +43,7 @@
     private static final Log log = LogFactory.getLog(SOAPMessageBodyBasedDispatcher.class);
     String serviceName = null;
     QName operationName = null;
+    private static final boolean isDebugEnabled = log.isDebugEnabled();
 
     public AxisOperation findOperation(AxisService service, MessageContext messageContext)
             throws AxisFault {
@@ -51,9 +52,11 @@
         if (bodyFirstChild == null) {
             return null;
         } else {
-            log.debug(
-                    "Checking for Operation using SOAP message body's first child's local
name : "
-                            + bodyFirstChild.getLocalName());
+            if(isDebugEnabled){
+                log.debug(
+                        "Checking for Operation using SOAP message body's first child's local
name : "
+                                + bodyFirstChild.getLocalName());
+            }
             operationName = new QName(bodyFirstChild.getLocalName());
         }
 
@@ -73,10 +76,11 @@
             if (ns != null) {
                 String filePart = ns.getNamespaceURI();
 
-                log.debug(
-                        "Checking for Service using SOAP message body's first child's namespace
: "
-                                + filePart);
-
+                if(isDebugEnabled){
+                    log.debug(
+                            "Checking for Service using SOAP message body's first child's
namespace : "
+                                    + filePart);
+                }
                 String[] values = Utils.parseRequestURLForServiceAndOperation(filePart,
                         messageContext.getConfigurationContext().getServiceContextPath());
 

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/util/UUIDGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/util/UUIDGenerator.java?view=diff&rev=478996&r1=478995&r2=478996
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/util/UUIDGenerator.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/util/UUIDGenerator.java
Fri Nov 24 13:07:23 2006
@@ -43,11 +43,12 @@
     public static String getUUID() {
         if (baseUUID == null) {
             baseUUID = getInitialUUID();
+            baseUUID = "urn:uuid:" + baseUUID;
         }
         if(++incrementingValue >= Long.MAX_VALUE){
             incrementingValue = 0;
         }
-        return "urn:uuid:" + baseUUID + new Date().getTime() + incrementingValue;
+        return  baseUUID + (System.currentTimeMillis() + incrementingValue);
     }
 
     protected static String getInitialUUID() {



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


Mime
View raw message