定义在接口方法上,需要指定code,code应用内全局唯一。可自定义指定扩展点策略
定义在接口实现类或方法上,定义在方法上会覆盖定义在类上的,需要填写扩展点实现自身的维度特征
@ExtensionPoint的属性,默认已经实现全匹配和取最优两种策略,如果需要自定义,可实现RouterStrategy接口,在@ExtensionPoint上指定具体实现即可
@ExtensionPoint的属性,默认实现为List结果合并策略
@ExtensionPoint的属性,默认实现为不处理
@Extension的属性,用于解析@Extension的dimensions()值,默认实现为DefaultDimensionHandler
-
使用简介
1. 使用@ExtensionPointAutowired替换@Autowire注入扩展点 2. 与正常接口调用使用无异
-
Sample
com.springframework.extensionpoint.sample.businessIdentity.ExtensionPointAutowiredTest
-
使用简介
1. 直接调用静态类ExtensionExecutor.execute执行 2. 需要显示传入扩展点接口code、接口调用参数数组
-
Sample
com.springframework.extensionpoint.sample.businessIdentity.ExtensionPointExecutorTest