Author: sanka
Date: Fri Jun  6 12:38:40 2008
New Revision: 18091
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=18091

Log:


Modified:
   
branches/wsas/java/2.3/axis2-1.4-patched/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java
   
branches/wsas/java/2.3/axis2-1.4-patched/modules/kernel/src/org/apache/axis2/description/AxisService.java

Modified: 
branches/wsas/java/2.3/axis2-1.4-patched/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java
URL: 
http://wso2.org/svn/browse/wso2/branches/wsas/java/2.3/axis2-1.4-patched/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java?rev=18091&r1=18090&r2=18091&view=diff
==============================================================================
--- 
branches/wsas/java/2.3/axis2-1.4-patched/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java
    (original)
+++ 
branches/wsas/java/2.3/axis2-1.4-patched/modules/kernel/src/org/apache/axis2/description/AxisBindingMessage.java
    Fri Jun  6 12:38:40 2008
@@ -219,7 +219,7 @@
        }
 
        public Policy getEffectivePolicy() {
-               if (effectivePolicy == null && !policyCalculated) {
+               if (isPolicyUpdated() || !policyCalculated) {
                        effectivePolicy = calculateEffectivePolicy();
                        policyCalculated = true;
                }
@@ -289,4 +289,58 @@
 
                return PolicyUtil.getMergedPolicy(policyList, axisService);
        }
+       
+       private boolean isPolicyUpdated() {
+               boolean isUpdated = false;
+               // AxisBindingOperation
+               AxisBindingOperation axisBindingOperation = 
getAxisBindingOperation();
+               if (axisBindingOperation != null
+                               && 
axisBindingOperation.getPolicySubject().isUpdated()) {
+                       
axisBindingOperation.getPolicySubject().setUpdated(false);
+                       isUpdated = true;
+               }
+               // AxisBinding
+               AxisBinding axisBinding = (axisBindingOperation == null) ? null
+                               : axisBindingOperation.getAxisBinding();
+               if (axisBinding != null && 
axisBinding.getPolicySubject().isUpdated()) {
+                       axisBinding.getPolicySubject().setUpdated(false);
+                       isUpdated = true;
+               }
+               // AxisEndpoint
+               AxisEndpoint axisEndpoint = (axisBinding == null) ? null : 
axisBinding
+                               .getAxisEndpoint();
+               if (axisEndpoint != null && 
axisEndpoint.getPolicySubject().isUpdated()) {
+                       axisEndpoint.getPolicySubject().setUpdated(false);
+                       isUpdated = true;
+               }
+               // AxisMessage
+               if (axisMessage != null && 
axisMessage.getPolicySubject().isUpdated()) {
+                       axisMessage.getPolicySubject().setUpdated(false);
+                       isUpdated = true;
+               }
+               // AxisOperation
+               AxisOperation axisOperation = (axisMessage == null) ? null
+                               : axisMessage.getAxisOperation();
+               if (axisOperation != null
+                               && 
axisOperation.getPolicySubject().isUpdated()) {
+                       axisOperation.getPolicySubject().setUpdated(false);
+                       isUpdated = true;
+               }
+               // AxisService
+               AxisService axisService = (axisOperation == null) ? null
+                               : axisOperation.getAxisService();
+               if (axisService != null && 
axisService.getPolicySubject().isUpdated()) {
+                       axisService.getPolicySubject().setUpdated(false);
+                       isUpdated = true;
+               }
+               // AxisConfiguration
+               AxisConfiguration axisConfiguration = (axisService == null) ? 
null
+                               : axisService.getAxisConfiguration();
+               if (axisConfiguration != null
+                               && 
axisConfiguration.getPolicySubject().isUpdated()) {
+                       axisConfiguration.getPolicySubject().setUpdated(false);
+                       isUpdated = true;
+               }
+               return isUpdated;
+       }
 }

Modified: 
branches/wsas/java/2.3/axis2-1.4-patched/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: 
http://wso2.org/svn/browse/wso2/branches/wsas/java/2.3/axis2-1.4-patched/modules/kernel/src/org/apache/axis2/description/AxisService.java?rev=18091&r1=18090&r2=18091&view=diff
==============================================================================
--- 
branches/wsas/java/2.3/axis2-1.4-patched/modules/kernel/src/org/apache/axis2/description/AxisService.java
   (original)
+++ 
branches/wsas/java/2.3/axis2-1.4-patched/modules/kernel/src/org/apache/axis2/description/AxisService.java
   Fri Jun  6 12:38:40 2008
@@ -1353,55 +1353,20 @@
                        Iterator portItr = 
serviceElement.getPorts().values().iterator();
                        while (portItr.hasNext()) {
                                Port port = (Port) portItr.next();
+                               AxisEndpoint endpoint = (AxisEndpoint) 
endpointMap.get(port
+                                               .getName());
                                List list = port.getExtensibilityElements();
                                for (int i = 0; i < list.size(); i++) {
                                        Object extensibilityEle = list.get(i);
                                        if (extensibilityEle instanceof 
SOAPAddress) {
-                                               SOAPAddress soapAddress = 
(SOAPAddress) extensibilityEle;
-                                               String existingAddress = 
soapAddress.getLocationURI();
-                                               if (existingAddress == null
-                                                               || 
existingAddress
-                                                                               
.equals("REPLACE_WITH_ACTUAL_URL")) {
-                                                       ((SOAPAddress) 
extensibilityEle)
-                                                                       
.setLocationURI(getEPRs()[0]);
-                                               } else {
-                                                       if (requestIP == null) {
-                                                               ((SOAPAddress) 
extensibilityEle)
-                                                                               
.setLocationURI(getLocationURI(
-                                                                               
                getEPRs(), existingAddress));
-                                                       } else {
-                                                               ((SOAPAddress) 
extensibilityEle)
-                                                                               
.setLocationURI(getLocationURI(
-                                                                               
                calculateEPRs(requestIP),
-                                                                               
                existingAddress));
-                                                       }
-                                               }
+                                               ((SOAPAddress) extensibilityEle)
+                                                               
.setLocationURI(endpoint.calculateEndpointURL());
                                        } else if (extensibilityEle instanceof 
SOAP12Address) {
-                                               SOAP12Address soapAddress = 
(SOAP12Address) extensibilityEle;
-                                               String exsistingAddress = 
soapAddress.getLocationURI();
-                                               if (requestIP == null) {
-                                                       ((SOAP12Address) 
extensibilityEle)
-                                                                       
.setLocationURI(getLocationURI(getEPRs(),
-                                                                               
        exsistingAddress));
-                                               } else {
-                                                       ((SOAP12Address) 
extensibilityEle)
-                                                                       
.setLocationURI(getLocationURI(
-                                                                               
        calculateEPRs(requestIP),
-                                                                               
        exsistingAddress));
-                                               }
+                                               ((SOAP12Address) 
extensibilityEle)
+                                                               
.setLocationURI(endpoint.calculateEndpointURL());
                                        } else if (extensibilityEle instanceof 
HTTPAddress) {
-                                               HTTPAddress httpAddress = 
(HTTPAddress) extensibilityEle;
-                                               String exsistingAddress = 
httpAddress.getLocationURI();
-                                               if (requestIP == null) {
-                                                       ((HTTPAddress) 
extensibilityEle)
-                                                                       
.setLocationURI(getLocationURI(getEPRs(),
-                                                                               
        exsistingAddress));
-                                               } else {
-                                                       ((HTTPAddress) 
extensibilityEle)
-                                                                       
.setLocationURI(getLocationURI(
-                                                                               
        calculateEPRs(requestIP),
-                                                                               
        exsistingAddress));
-                                               }
+                                               ((HTTPAddress) extensibilityEle)
+                                                               
.setLocationURI(endpoint.calculateEndpointURL());
                                        }
                                        // TODO : change the Endpoint refrence 
addess as well.
                                }

_______________________________________________
Wsas-java-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/wsas-java-dev

Reply via email to