File tree Expand file tree Collapse file tree 5 files changed +53
-0
lines changed
main/java/com/alibaba/dubbo/config
test/java/com/alibaba/dubbo/config
test/java/com/alibaba/dubbo/config/spring Expand file tree Collapse file tree 5 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,19 @@ public abstract class AbstractMethodConfig extends AbstractConfig {
6464 // customized parameters
6565 protected Map <String , String > parameters ;
6666
67+ /**
68+ * forks for forking cluster
69+ */
70+ protected Integer forks ;
71+
72+ public Integer getForks () {
73+ return forks ;
74+ }
75+
76+ public void setForks (Integer forks ) {
77+ this .forks = forks ;
78+ }
79+
6780 public Integer getTimeout () {
6881 return timeout ;
6982 }
Original file line number Diff line number Diff line change @@ -35,6 +35,13 @@ public void testTimeout() throws Exception {
3535 assertThat (methodConfig .getTimeout (), equalTo (10 ));
3636 }
3737
38+ @ Test
39+ public void testForks () throws Exception {
40+ MethodConfig methodConfig = new MethodConfig ();
41+ methodConfig .setForks (10 );
42+ assertThat (methodConfig .getForks (), equalTo (10 ));
43+ }
44+
3845 @ Test
3946 public void testRetries () throws Exception {
4047 MethodConfig methodConfig = new MethodConfig ();
Original file line number Diff line number Diff line change 101101 <xsd : documentation ><![CDATA[ Use cluster strategy. ]]> </xsd : documentation >
102102 </xsd : annotation >
103103 </xsd : attribute >
104+ <xsd : attribute name =" forks" type =" xsd:string" >
105+ <xsd : annotation >
106+ <xsd : documentation ><![CDATA[ ForkingCluster forks. ]]> </xsd : documentation >
107+ </xsd : annotation >
108+ </xsd : attribute >
104109 <xsd : attribute name =" filter" type =" xsd:string" use =" optional" >
105110 <xsd : annotation >
106111 <xsd : documentation ><![CDATA[ The filter. ]]> </xsd : documentation >
480485 <xsd : documentation ><![CDATA[ The registry cluster type. ]]> </xsd : documentation >
481486 </xsd : annotation >
482487 </xsd : attribute >
488+ <xsd : attribute name =" forks" type =" xsd:string" >
489+ <xsd : annotation >
490+ <xsd : documentation ><![CDATA[ ForkingCluster forks. ]]> </xsd : documentation >
491+ </xsd : annotation >
492+ </xsd : attribute >
483493 <xsd : attribute name =" group" type =" xsd:string" use =" optional" >
484494 <xsd : annotation >
485495 <xsd : documentation ><![CDATA[ The registry group. ]]> </xsd : documentation >
Original file line number Diff line number Diff line change 101101 <xsd : documentation ><![CDATA[ Use cluster strategy. ]]> </xsd : documentation >
102102 </xsd : annotation >
103103 </xsd : attribute >
104+ <xsd : attribute name =" forks" type =" xsd:string" >
105+ <xsd : annotation >
106+ <xsd : documentation ><![CDATA[ ForkingCluster forks. ]]> </xsd : documentation >
107+ </xsd : annotation >
108+ </xsd : attribute >
104109 <xsd : attribute name =" filter" type =" xsd:string" use =" optional" >
105110 <xsd : annotation >
106111 <xsd : documentation ><![CDATA[ The filter. ]]> </xsd : documentation >
480485 <xsd : documentation ><![CDATA[ The registry cluster type. ]]> </xsd : documentation >
481486 </xsd : annotation >
482487 </xsd : attribute >
488+ <xsd : attribute name =" forks" type =" xsd:string" >
489+ <xsd : annotation >
490+ <xsd : documentation ><![CDATA[ ForkingCluster forks. ]]> </xsd : documentation >
491+ </xsd : annotation >
492+ </xsd : attribute >
483493 <xsd : attribute name =" group" type =" xsd:string" use =" optional" >
484494 <xsd : annotation >
485495 <xsd : documentation ><![CDATA[ The registry group. ]]> </xsd : documentation >
Original file line number Diff line number Diff line change @@ -148,6 +148,19 @@ public void testToString() {
148148 assertTrue (str .endsWith (" />" ));
149149 }
150150
151+ @ Test
152+ public void testForks () {
153+ ReferenceConfig <DemoService > reference = new ReferenceConfig <DemoService >();
154+ reference .setApplication (new ApplicationConfig ("consumer" ));
155+ reference .setRegistry (new RegistryConfig (RegistryConfig .NO_AVAILABLE ));
156+ reference .setInterface (DemoService .class );
157+ reference .setUrl ("dubbo://127.0.0.1:20881" );
158+ int forks = 10 ;
159+ reference .setForks (forks );
160+ String str = reference .toString ();
161+ assertTrue (str .contains ("forks=\" " + forks + "\" " ));
162+ }
163+
151164 @ Test
152165 public void testMultiProtocol () {
153166 ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext (ConfigTest .class .getPackage ().getName ().replace ('.' , '/' ) + "/multi-protocol.xml" );
You can’t perform that action at this time.
0 commit comments