当前位置: 首页>>代码示例>>Java>>正文


Java EventBus类代码示例

本文整理汇总了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));
}
 
开发者ID:hortonworks,项目名称:cloudbreak,代码行数:26,代码来源:ReactorFlowManagerTest.java

示例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();
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:9,代码来源:ReactorAutoConfigurationTests.java

示例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();
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:9,代码来源:ReactorAutoConfigurationTests.java

示例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;
}
 
开发者ID:zalando-stups,项目名称:fullstop,代码行数:12,代码来源:ViolationJpaPersister.java

示例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();
}
 
开发者ID:hortonworks,项目名称:cloudbreak,代码行数:10,代码来源:EventBusConfig.java

示例8: createEventBus

import reactor.bus.EventBus; //导入依赖的package包/类
@Bean
public EventBus createEventBus(Environment env) {
 return EventBus.create(env, Environment.THREAD_POOL);
}
 
开发者ID:xabgesagtx,项目名称:mensa-api,代码行数:5,代码来源:ReactorConfig.java

示例9: ReactorEventService

import reactor.bus.EventBus; //导入依赖的package包/类
public ReactorEventService(final EventBus eventBus) {
    this.eventBus = notNull(eventBus);
}
 
开发者ID:Omegapoint,项目名称:facepalm,代码行数:4,代码来源:ReactorEventService.java

示例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);
}
 
开发者ID:deib-polimi,项目名称:diceH2020-space4cloudsWS,代码行数:5,代码来源:ReactorConfigurator.java

示例12: createEventBus

import reactor.bus.EventBus; //导入依赖的package包/类
@Bean
EventBus createEventBus(Environment env) {
 return EventBus.create(env, Environment.THREAD_POOL);
}
 
开发者ID:danielyinanc,项目名称:spring-guides,代码行数:5,代码来源:Application.java

示例13: EventBusViolationHandler

import reactor.bus.EventBus; //导入依赖的package包/类
public EventBusViolationHandler(final EventBus eventBus) {
    this.eventBus = eventBus;
}
 
开发者ID:zalando-stups,项目名称:fullstop,代码行数:4,代码来源:EventBusViolationHandler.java

示例14: eventBus

import reactor.bus.EventBus; //导入依赖的package包/类
@Bean
public EventBus eventBus() {
    return EventBus.create(Environment.initializeIfEmpty());
}
 
开发者ID:zalando-stups,项目名称:fullstop,代码行数:5,代码来源:EventBusViolationSinkAutoConfiguration.java

示例15: EventBusViolationSink

import reactor.bus.EventBus; //导入依赖的package包/类
public EventBusViolationSink(final EventBus eventBus, final CounterService counterService) {
    this.eventBus = eventBus;
    this.counterService = counterService;
}
 
开发者ID:zalando-stups,项目名称:fullstop,代码行数:5,代码来源:EventBusViolationSink.java


注:本文中的reactor.bus.EventBus类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。