Hi devs,

in both methods
1. setServiceOperationPolicy(String serviceName, String operationName,
String policyString)
2. setServicePolicy(String serviceName, String policyString)
in org.wso2.carbon.service.mgt.ServiceAdmin,

Currently in n, we use,
        axisService.getAxisConfiguration().notifyObservers(new
AxisEvent(CarbonConstants.POLICY_ADDED , axisService), axisService);

Here in both methods AxisEvent is created as, new
AxisEvent(CarbonConstants.POLICY_ADDED , axisService), i.e. by using
axisService as the second parameter. But due to this its hard to identify
the correct cause of the axisEvent. Rather we can use, new
AxisEvent(CarbonConstants.POLICY_ADDED , axisOperation) in the first method
mentioned above. IMO this should be the correct way of doin it as well, as
AxisEvent takes an AxisDescription as the arguement.

In brief, change I'm suggesting is [1],

Any concerns of doing it this way? Please advice.

[1],

org.wso2.carbon.service.mgt$ svn diff
Index: src/main/java/org/wso2/carbon/service/mgt/ServiceAdmin.java
===================================================================
--- src/main/java/org/wso2/carbon/service/mgt/ServiceAdmin.java    (revision
90844)
+++ src/main/java/org/wso2/carbon/service/mgt/ServiceAdmin.java    (working
copy)
@@ -1782,10 +1782,11 @@
         }

         // at axis2
-        axisService.getOperation(new
QName(operationName)).getPolicySubject().clear();
-        axisService.getOperation(new
QName(operationName)).getPolicySubject().attachPolicy(policy);
+        AxisOperation axisOperation = axisService.getOperation(new
QName(operationName));
+        axisOperation.getPolicySubject().clear();
+        axisOperation.getPolicySubject().attachPolicy(policy);
         axisService.getAxisConfiguration().notifyObservers(new
AxisEvent(CarbonConstants.POLICY_ADDED
-                , axisService), axisService);
+                , axisOperation), axisService);
     }


regards,
-- 
Supun Malinga,

Software Engineer,
WSO2 Inc.
http://wso2.com
http://wso2.org
email - [email protected] <[email protected]>
mobile - 071 56 91 321
_______________________________________________
Carbon-dev mailing list
[email protected]
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to