Author: indika
Date: Tue Jan 20 01:03:40 2009
New Revision: 29025
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=29025

Log:
update throttle samples

Modified:
   
branches/synapse/1.2.wso2v1/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java
   
branches/synapse/1.2.wso2v1/modules/extensions/src/test/java/org/apache/synapse/mediators/throttle/ThrottleMediatorTest.java
   
branches/synapse/1.2.wso2v1/repository/conf/sample/resources/policy/throttle_policy.xml
   branches/synapse/1.2.wso2v1/repository/conf/sample/synapse_sample_370.xml
   branches/synapse/1.2.wso2v1/repository/conf/sample/synapse_sample_371.xml
   branches/synapse/1.2.wso2v1/repository/conf/sample/synapse_sample_372.xml

Modified: 
branches/synapse/1.2.wso2v1/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java
URL: 
http://wso2.org/svn/browse/wso2/branches/synapse/1.2.wso2v1/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java?rev=29025&r1=29024&r2=29025&view=diff
==============================================================================
--- 
branches/synapse/1.2.wso2v1/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java
    (original)
+++ 
branches/synapse/1.2.wso2v1/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java
    Tue Jan 20 01:03:40 2009
@@ -125,7 +125,7 @@
                         }
                         try {
                             // process the policy
-                            throttle = 
ThrottleFactory.createServiceThrottle(PolicyEngine.getPolicy(inLinePolicy));
+                            throttle = 
ThrottleFactory.createMediatorThrottle(PolicyEngine.getPolicy(inLinePolicy));
 
                             //At this point concurrent access controller 
definitely 'null'
                             // f the clustering is disable.
@@ -186,7 +186,7 @@
 
                                     try {
                                         // Creates the throttle from the policy
-                                        throttle = 
ThrottleFactory.createServiceThrottle(
+                                        throttle = 
ThrottleFactory.createMediatorThrottle(
                                                 
PolicyEngine.getPolicy((OMElement) entryValue));
 
                                         //For non-clustered  environment , 
must re-initiates

Modified: 
branches/synapse/1.2.wso2v1/modules/extensions/src/test/java/org/apache/synapse/mediators/throttle/ThrottleMediatorTest.java
URL: 
http://wso2.org/svn/browse/wso2/branches/synapse/1.2.wso2v1/modules/extensions/src/test/java/org/apache/synapse/mediators/throttle/ThrottleMediatorTest.java?rev=29025&r1=29024&r2=29025&view=diff
==============================================================================
--- 
branches/synapse/1.2.wso2v1/modules/extensions/src/test/java/org/apache/synapse/mediators/throttle/ThrottleMediatorTest.java
        (original)
+++ 
branches/synapse/1.2.wso2v1/modules/extensions/src/test/java/org/apache/synapse/mediators/throttle/ThrottleMediatorTest.java
        Tue Jan 20 01:03:40 2009
@@ -296,7 +296,7 @@
         protected void createThrottleMetaData(OMElement policyOmElement) {
 
             try {
-                throttle = 
ThrottleFactory.createServiceThrottle(PolicyEngine.getPolicy(policyOmElement));
+                throttle = 
ThrottleFactory.createMediatorThrottle(PolicyEngine.getPolicy(policyOmElement));
             }
             catch (ThrottleException e) {
 

Modified: 
branches/synapse/1.2.wso2v1/repository/conf/sample/resources/policy/throttle_policy.xml
URL: 
http://wso2.org/svn/browse/wso2/branches/synapse/1.2.wso2v1/repository/conf/sample/resources/policy/throttle_policy.xml?rev=29025&r1=29024&r2=29025&view=diff
==============================================================================
--- 
branches/synapse/1.2.wso2v1/repository/conf/sample/resources/policy/throttle_policy.xml
     (original)
+++ 
branches/synapse/1.2.wso2v1/repository/conf/sample/resources/policy/throttle_policy.xml
     Tue Jan 20 01:03:40 2009
@@ -1,50 +1,31 @@
 <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy";
             xmlns:throttle="http://www.wso2.org/products/wso2commons/throttle";>
-    <throttle:ThrottleAssertion>
+
+    <throttle:MediatorThrottleAssertion>
         <throttle:MaximumConcurrentAccess>10</throttle:MaximumConcurrentAccess>
-        <wsp:All>
+        <wsp:Policy>
             <throttle:ID throttle:type="IP">other</throttle:ID>
-            <wsp:ExactlyOne>
-                <wsp:All>
-                    <throttle:MaximumCount>4</throttle:MaximumCount>
-                    <throttle:UnitTime>800000</throttle:UnitTime>
-                    <throttle:ProhibitTimePeriod 
wsp:Optional="true">1000</throttle:ProhibitTimePeriod>
-                </wsp:All>
-                <throttle:IsAllow>true</throttle:IsAllow>
-            </wsp:ExactlyOne>
-        </wsp:All>
-        <wsp:All>
-            <throttle:ID 
throttle:type="IP">10.100.1.150-10.100.1.152</throttle:ID>
-            <wsp:ExactlyOne>
-                <wsp:All>
-                    <throttle:MaximumCount>5</throttle:MaximumCount>
-                    <throttle:UnitTime>800000</throttle:UnitTime>
-                    <throttle:ProhibitTimePeriod 
wsp:Optional="true">100000</throttle:ProhibitTimePeriod>
-                </wsp:All>
-                <throttle:IsAllow>true</throttle:IsAllow>
-            </wsp:ExactlyOne>
-        </wsp:All>
-        <wsp:All>
-            <throttle:ID throttle:type="IP">192.168.8.201</throttle:ID>
-            <wsp:ExactlyOne>
-                <wsp:All>
-                    <throttle:MaximumCount>200</throttle:MaximumCount>
-                    <throttle:UnitTime>600000</throttle:UnitTime>
-                    <throttle:ProhibitTimePeriod 
wsp:Optional="true"></throttle:ProhibitTimePeriod>
-                </wsp:All>
-                <throttle:IsAllow>true</throttle:IsAllow>
-            </wsp:ExactlyOne>
-        </wsp:All>
-        <wsp:All>
-            <throttle:ID throttle:type="IP">192.168.8.198</throttle:ID>
-            <wsp:ExactlyOne>
-                <wsp:All>
-                    <throttle:MaximumCount>50</throttle:MaximumCount>
-                    <throttle:UnitTime>500000</throttle:UnitTime>
-                    <throttle:ProhibitTimePeriod 
wsp:Optional="true"></throttle:ProhibitTimePeriod>
-                </wsp:All>
-                <throttle:IsAllow>true</throttle:IsAllow>
-            </wsp:ExactlyOne>
-        </wsp:All>
-    </throttle:ThrottleAssertion>
+            <wsp:Policy>
+                <throttle:Control>
+                    <wsp:Policy>
+                        <throttle:MaximumCount>4</throttle:MaximumCount>
+                        <throttle:UnitTime>800000</throttle:UnitTime>
+                        <throttle:ProhibitTimePeriod 
wsp:Optional="true">1000</throttle:ProhibitTimePeriod>
+                    </wsp:Policy>
+                </throttle:Control>
+            </wsp:Policy>
+        </wsp:Policy>
+        <wsp:Policy>
+            <throttle:ID throttle:type="IP">10.100.1.160 - 
10.100.1.165</throttle:ID>
+            <wsp:Policy>
+                <throttle:Control>
+                    <wsp:Policy>
+                        <throttle:MaximumCount>5</throttle:MaximumCount>
+                        <throttle:UnitTime>800000</throttle:UnitTime>
+                        <throttle:ProhibitTimePeriod 
wsp:Optional="true">100000</throttle:ProhibitTimePeriod>
+                    </wsp:Policy>
+                </throttle:Control>
+            </wsp:Policy>
+        </wsp:Policy>
+    </throttle:MediatorThrottleAssertion>
 </wsp:Policy>
\ No newline at end of file

Modified: 
branches/synapse/1.2.wso2v1/repository/conf/sample/synapse_sample_370.xml
URL: 
http://wso2.org/svn/browse/wso2/branches/synapse/1.2.wso2v1/repository/conf/sample/synapse_sample_370.xml?rev=29025&r1=29024&r2=29025&view=diff
==============================================================================
--- branches/synapse/1.2.wso2v1/repository/conf/sample/synapse_sample_370.xml   
(original)
+++ branches/synapse/1.2.wso2v1/repository/conf/sample/synapse_sample_370.xml   
Tue Jan 20 01:03:40 2009
@@ -26,9 +26,10 @@
                     <!-- define throttle policy -->
                     <wsp:Policy 
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy";
                                 
xmlns:throttle="http://www.wso2.org/products/wso2commons/throttle";>
-                        <throttle:ThrottleAssertion>
-                            
<throttle:MaximumConcurrentAccess>10</throttle:MaximumConcurrentAccess>         
                   
-                        </throttle:ThrottleAssertion>
+
+                        <throttle:MediatorThrottleAssertion>
+                            
<throttle:MaximumConcurrentAccess>10</throttle:MaximumConcurrentAccess>
+                        </throttle:MediatorThrottleAssertion>
                     </wsp:Policy>
                 </policy>
                 <onAccept>
@@ -37,7 +38,7 @@
                     </log>
                     <send>
                         <endpoint>
-                            <address 
uri="http://localhost:9000/soap/SimpleStockQuoteService"/>
+                            <address 
uri="http://localhost:9000/services/SimpleStockQuoteService"/>
                         </endpoint>
                     </send>
                 </onAccept>

Modified: 
branches/synapse/1.2.wso2v1/repository/conf/sample/synapse_sample_371.xml
URL: 
http://wso2.org/svn/browse/wso2/branches/synapse/1.2.wso2v1/repository/conf/sample/synapse_sample_371.xml?rev=29025&r1=29024&r2=29025&view=diff
==============================================================================
--- branches/synapse/1.2.wso2v1/repository/conf/sample/synapse_sample_371.xml   
(original)
+++ branches/synapse/1.2.wso2v1/repository/conf/sample/synapse_sample_371.xml   
Tue Jan 20 01:03:40 2009
@@ -26,52 +26,35 @@
                     <!-- define throttle policy -->
                     <wsp:Policy 
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy";
                                 
xmlns:throttle="http://www.wso2.org/products/wso2commons/throttle";>
-                        <throttle:ThrottleAssertion>
-                            <wsp:All>
+
+                        <throttle:MediatorThrottleAssertion>
+                            <wsp:Policy>
                                 <throttle:ID 
throttle:type="IP">other</throttle:ID>
-                                <wsp:ExactlyOne>
-                                    <wsp:All>
-                                        
<throttle:MaximumCount>4</throttle:MaximumCount>
-                                        
<throttle:UnitTime>800000</throttle:UnitTime>
-                                        <throttle:ProhibitTimePeriod 
wsp:Optional="true">10000</throttle:ProhibitTimePeriod>
-                                    </wsp:All>
-                                    <throttle:IsAllow>true</throttle:IsAllow>
-                                </wsp:ExactlyOne>
-                            </wsp:All>
-                            <wsp:All>
-                                <throttle:ID 
throttle:type="IP">192.168.8.200-192.168.8.222</throttle:ID>
-                                <wsp:ExactlyOne>
-                                    <wsp:All>
-                                        
<throttle:MaximumCount>8</throttle:MaximumCount>
-                                        
<throttle:UnitTime>800000</throttle:UnitTime>
-                                        <throttle:ProhibitTimePeriod 
wsp:Optional="true">10</throttle:ProhibitTimePeriod>
-                                    </wsp:All>
-                                    <throttle:IsAllow>true</throttle:IsAllow>
-                                </wsp:ExactlyOne>
-                            </wsp:All>
-                            <wsp:All>
-                                <throttle:ID 
throttle:type="IP">192.168.8.201</throttle:ID>
-                                <wsp:ExactlyOne>
-                                    <wsp:All>
-                                        
<throttle:MaximumCount>200</throttle:MaximumCount>
-                                        
<throttle:UnitTime>600000</throttle:UnitTime>
-                                        <throttle:ProhibitTimePeriod 
wsp:Optional="true"></throttle:ProhibitTimePeriod>
-                                    </wsp:All>
-                                    <throttle:IsAllow>true</throttle:IsAllow>
-                                </wsp:ExactlyOne>
-                            </wsp:All>
-                            <wsp:All>
-                                <throttle:ID 
throttle:type="IP">192.168.8.198</throttle:ID>
-                                <wsp:ExactlyOne>
-                                    <wsp:All>
-                                        
<throttle:MaximumCount>50</throttle:MaximumCount>
-                                        
<throttle:UnitTime>500000</throttle:UnitTime>
-                                        <throttle:ProhibitTimePeriod 
wsp:Optional="true"></throttle:ProhibitTimePeriod>
-                                    </wsp:All>
-                                    <throttle:IsAllow>true</throttle:IsAllow>
-                                </wsp:ExactlyOne>
-                            </wsp:All>
-                        </throttle:ThrottleAssertion>
+                                <wsp:Policy>
+                                    <throttle:Control>
+                                        <wsp:Policy>
+                                            
<throttle:MaximumCount>4</throttle:MaximumCount>
+                                            
<throttle:UnitTime>800000</throttle:UnitTime>
+                                            <throttle:ProhibitTimePeriod 
wsp:Optional="true">1000
+                                            </throttle:ProhibitTimePeriod>
+                                        </wsp:Policy>
+                                    </throttle:Control>
+                                </wsp:Policy>
+                            </wsp:Policy>
+                            <wsp:Policy>
+                                <throttle:ID throttle:type="IP">10.100.1.160 - 
10.100.1.165</throttle:ID>
+                                <wsp:Policy>
+                                    <throttle:Control>
+                                        <wsp:Policy>
+                                            
<throttle:MaximumCount>5</throttle:MaximumCount>
+                                            
<throttle:UnitTime>800000</throttle:UnitTime>
+                                            <throttle:ProhibitTimePeriod 
wsp:Optional="true">100000
+                                            </throttle:ProhibitTimePeriod>
+                                        </wsp:Policy>
+                                    </throttle:Control>
+                                </wsp:Policy>
+                            </wsp:Policy>
+                        </throttle:MediatorThrottleAssertion>
                     </wsp:Policy>
                 </policy>
                 <onAccept>
@@ -80,7 +63,7 @@
                     </log>
                     <send>
                         <endpoint>
-                            <address 
uri="http://localhost:9000/soap/SimpleStockQuoteService"/>
+                            <address 
uri="http://localhost:9000/services/SimpleStockQuoteService"/>
                         </endpoint>
                     </send>
                 </onAccept>

Modified: 
branches/synapse/1.2.wso2v1/repository/conf/sample/synapse_sample_372.xml
URL: 
http://wso2.org/svn/browse/wso2/branches/synapse/1.2.wso2v1/repository/conf/sample/synapse_sample_372.xml?rev=29025&r1=29024&r2=29025&view=diff
==============================================================================
--- branches/synapse/1.2.wso2v1/repository/conf/sample/synapse_sample_372.xml   
(original)
+++ branches/synapse/1.2.wso2v1/repository/conf/sample/synapse_sample_372.xml   
Tue Jan 20 01:03:40 2009
@@ -33,7 +33,7 @@
         </log>
         <send>
             <endpoint>
-                <address 
uri="http://localhost:9000/soap/SimpleStockQuoteService"/>
+                <address 
uri="http://localhost:9000/services/SimpleStockQuoteService"/>
             </endpoint>
         </send>
     </sequence>
@@ -53,7 +53,7 @@
     </sequence>
     <proxy name="StockQuoteProxy">
         <target>
-             <inSequence>
+            <inSequence>
                 <throttle onReject="onRejectSequence" 
onAccept="onAcceptSequence" id="A">
                     <policy 
key="conf/sample/resources/policy/throttle_policy.xml"/>
                 </throttle>

_______________________________________________
Esb-java-dev mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev

Reply via email to