本文整理汇总了Java中reactor.bus.EventBus类的典型用法代码示例。如果您正苦于以下问题:Java EventBus类的具体用法?Java EventBus怎么用?Java EventBus使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EventBus类属于reactor.bus包,在下文中一共展示了EventBus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import reactor.bus.EventBus; //导入依赖的package包/类
@Before
public void setUp() {
reset(reactor);
reset(eventFactory);
when(reactor.notify((Object) anyObject(), any(Event.class))).thenReturn(new EventBus(new ThreadPoolExecutorDispatcher(1, 1)));
Acceptable acceptable = new Acceptable() {
@Override
public Promise<Boolean> accepted() {
Promise<Boolean> a = new Promise<>();
a.accept(true);
return a;
}
@Override
public Long getStackId() {
return stackId;
}
};
Stack stack = TestUtil.stack();
stack.setCluster(TestUtil.cluster());
when(stackService.get(anyLong())).thenReturn(stack);
when(stackService.getById(anyLong())).thenReturn(TestUtil.stack());
when(stackService.getByIdView(anyLong())).thenReturn(TestUtil.stackView());
when(eventFactory.createEventWithErrHandler(anyObject())).thenReturn(new Event<>(acceptable));
}
示例2: eventBusIsAvailable
import reactor.bus.EventBus; //导入依赖的package包/类
@Test
public void eventBusIsAvailable() {
this.context.register(ReactorAutoConfiguration.class);
this.context.refresh();
EventBus eventBus = this.context.getBean(EventBus.class);
assertThat(eventBus.getDispatcher()).isInstanceOf(RingBufferDispatcher.class);
this.context.close();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:ReactorAutoConfigurationTests.java
示例3: customEventBus
import reactor.bus.EventBus; //导入依赖的package包/类
@Test
public void customEventBus() {
this.context.register(TestConfiguration.class, ReactorAutoConfiguration.class);
this.context.refresh();
EventBus eventBus = this.context.getBean(EventBus.class);
assertThat(eventBus.getDispatcher()).isInstanceOf(MpscDispatcher.class);
this.context.close();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:ReactorAutoConfigurationTests.java
示例4: eventBusIsAvailable
import reactor.bus.EventBus; //导入依赖的package包/类
@Test
public void eventBusIsAvailable() {
this.context.register(ReactorAutoConfiguration.class);
this.context.refresh();
EventBus eventBus = this.context.getBean(EventBus.class);
assertThat(eventBus.getDispatcher(), instanceOf(RingBufferDispatcher.class));
this.context.close();
}
示例5: customEventBus
import reactor.bus.EventBus; //导入依赖的package包/类
@Test
public void customEventBus() {
this.context.register(TestConfiguration.class, ReactorAutoConfiguration.class);
this.context.refresh();
EventBus eventBus = this.context.getBean(EventBus.class);
assertThat(eventBus.getDispatcher(), instanceOf(MpscDispatcher.class));
this.context.close();
}
示例6: ViolationJpaPersister
import reactor.bus.EventBus; //导入依赖的package包/类
public ViolationJpaPersister(final EventBus eventBus, final ViolationRepository violationRepository,
final ViolationTypeRepository violationTypeRepository,
final CounterService counterService, final WhitelistRules whitelistRules,
final ApplicationVersionService applicationVersionService) {
super(eventBus);
this.violationRepository = violationRepository;
this.violationTypeRepository = violationTypeRepository;
this.counterService = counterService;
this.whitelistRules = whitelistRules;
this.applicationVersionService = applicationVersionService;
}
示例7: reactor
import reactor.bus.EventBus; //导入依赖的package包/类
@Bean
public EventBus reactor(Environment env) {
return new EventBusSpec()
.env(env)
.dispatcher(getEventBusDispatcher())
.traceEventPath()
.consumerNotFoundHandler(new ConsumerNotFoundHandler())
.get();
}
示例8: createEventBus
import reactor.bus.EventBus; //导入依赖的package包/类
@Bean
public EventBus createEventBus(Environment env) {
return EventBus.create(env, Environment.THREAD_POOL);
}
示例9: ReactorEventService
import reactor.bus.EventBus; //导入依赖的package包/类
public ReactorEventService(final EventBus eventBus) {
this.eventBus = notNull(eventBus);
}
示例10: eventBus
import reactor.bus.EventBus; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(EventBus.class)
public EventBus eventBus(Environment environment) {
return EventBus.create(environment);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:6,代码来源:ReactorAutoConfiguration.java
示例11: createEventBus
import reactor.bus.EventBus; //导入依赖的package包/类
@Bean
EventBus createEventBus(Environment env) {
return EventBus.create(env,Environment.WORK_QUEUE);
}
示例12: createEventBus
import reactor.bus.EventBus; //导入依赖的package包/类
@Bean
EventBus createEventBus(Environment env) {
return EventBus.create(env, Environment.THREAD_POOL);
}
示例13: EventBusViolationHandler
import reactor.bus.EventBus; //导入依赖的package包/类
public EventBusViolationHandler(final EventBus eventBus) {
this.eventBus = eventBus;
}
示例14: eventBus
import reactor.bus.EventBus; //导入依赖的package包/类
@Bean
public EventBus eventBus() {
return EventBus.create(Environment.initializeIfEmpty());
}
示例15: EventBusViolationSink
import reactor.bus.EventBus; //导入依赖的package包/类
public EventBusViolationSink(final EventBus eventBus, final CounterService counterService) {
this.eventBus = eventBus;
this.counterService = counterService;
}