eventcenter.builder.dubbo.DubboSubscriberConfigBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ec-builder Show documentation
Show all versions of ec-builder Show documentation
使用ec-builder能够简化事件中心构建实例的配置复杂度
The newest version!
package eventcenter.builder.dubbo;
import eventcenter.builder.SubscriberConfig;
import eventcenter.builder.SubscriberConfigBuilder;
import eventcenter.remote.SubscriberGroup;
/**
*
* @author liumingjian
* @date 2017/9/6
*/
public class DubboSubscriberConfigBuilder extends SubscriberConfigBuilder {
@Override
protected SubscriberConfig createSubscriberConfig() {
return new DubboSubscriberConfig();
}
DubboSubscriberConfig getDubboSubscriberConfig(){
return (DubboSubscriberConfig)this.subscriberConfig;
}
public DubboSubscriberConfigBuilder eventSubscriberServiceConfig(EventSubscriberServiceConfig serviceConfig){
getDubboSubscriberConfig().setServiceConfig(serviceConfig);
return this;
}
public DubboSubscriberConfigBuilder addSubscriber(String remoteEvents){
SubscriberGroup group = new SubscriberGroup();
group.setRemoteEvents(remoteEvents);
getDubboSubscriberConfig().getSubscriberGroups().add(group);
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy