de.codecentric.boot.admin.server.notify.Notifier Java Examples

The following examples show how to use de.codecentric.boot.admin.server.notify.Notifier. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AdminServerNotifierAutoConfigurationTest.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Test
public void test_notifierListener() {
    contextRunner.withUserConfiguration(TestSingleNotifierConfig.class).run(context -> {
        assertThat(context).getBean(Notifier.class).isInstanceOf(TestNotifier.class);
        assertThat(context).getBeans(Notifier.class).hasSize(1);
    });
}
 
Example #2
Source File: AdminServerNotifierAutoConfigurationTest.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Test
public void test_multipleNotifiers() {
    contextRunner.withUserConfiguration(TestMultipleNotifierConfig.class).run(context -> {
        assertThat(context.getBean(Notifier.class)).isInstanceOf(CompositeNotifier.class);
        assertThat(context).getBeans(Notifier.class).hasSize(3);
    });
}
 
Example #3
Source File: AdminServerNotifierAutoConfigurationTest.java    From Moss with Apache License 2.0 5 votes vote down vote up
@Test
public void test_multipleNotifiersWithPrimary() {
    contextRunner.withUserConfiguration(TestMultipleWithPrimaryNotifierConfig.class).run(context -> {
        assertThat(context.getBean(Notifier.class)).isInstanceOf(TestNotifier.class);
        assertThat(context).getBeans(Notifier.class).hasSize(2);
    });
}
 
Example #4
Source File: AdminServerNotifierAutoConfigurationTest.java    From spring-boot-admin with Apache License 2.0 5 votes vote down vote up
@Test
public void test_multipleNotifiersWithPrimary() {
	this.contextRunner.withUserConfiguration(TestMultipleWithPrimaryNotifierConfig.class).run((context) -> {
		assertThat(context.getBean(Notifier.class)).isInstanceOf(TestNotifier.class);
		assertThat(context).getBeans(Notifier.class).hasSize(2);
	});
}
 
Example #5
Source File: AdminServerHazelcastAutoConfiguration.java    From spring-boot-admin with Apache License 2.0 5 votes vote down vote up
@Bean(initMethod = "start", destroyMethod = "stop")
@ConditionalOnMissingBean(NotificationTrigger.class)
public NotificationTrigger notificationTrigger(HazelcastInstance hazelcastInstance, Notifier notifier,
		Publisher<InstanceEvent> events) {
	return new HazelcastNotificationTrigger(notifier, events,
			hazelcastInstance.getMap(this.nameSentNotificationsMap));
}
 
Example #6
Source File: AdminServerNotifierAutoConfigurationTest.java    From spring-boot-admin with Apache License 2.0 5 votes vote down vote up
@Test
public void test_multipleNotifiers() {
	this.contextRunner.withUserConfiguration(TestMultipleNotifierConfig.class).run((context) -> {
		assertThat(context.getBean(Notifier.class)).isInstanceOf(CompositeNotifier.class);
		assertThat(context).getBeans(Notifier.class).hasSize(3);
	});
}
 
Example #7
Source File: AdminServerNotifierAutoConfigurationTest.java    From spring-boot-admin with Apache License 2.0 5 votes vote down vote up
@Test
public void test_notifierListener() {
	this.contextRunner.withUserConfiguration(TestSingleNotifierConfig.class).run((context) -> {
		assertThat(context).getBean(Notifier.class).isInstanceOf(TestNotifier.class);
		assertThat(context).getBeans(Notifier.class).hasSize(1);
	});
}
 
Example #8
Source File: NotifierConfigurationIntegrationTest.java    From tutorials with MIT License 4 votes vote down vote up
@Test
public void whenApplicationContextStart_ThenNotifierBeanExists() {
    Notifier notifier = (Notifier) applicationContext.getBean("notifier");
    assertNotEquals(notifier, null);
}
 
Example #9
Source File: AdminServerNotifierAutoConfiguration.java    From Moss with Apache License 2.0 4 votes vote down vote up
@Bean(initMethod = "start", destroyMethod = "stop")
@ConditionalOnMissingBean
public NotificationTrigger notificationTrigger(Notifier notifier, Publisher<InstanceEvent> events) {
    return new NotificationTrigger(notifier, events);
}
 
Example #10
Source File: NotifierConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
public NotifierConfiguration(InstanceRepository repository, ObjectProvider<List<Notifier>> otherNotifiers) {
    this.repository = repository;
    this.otherNotifiers = otherNotifiers;
}
 
Example #11
Source File: NotifierConfig.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
public NotifierConfig(InstanceRepository repository, ObjectProvider<List<Notifier>> otherNotifiers) {
	this.repository = repository;
	this.otherNotifiers = otherNotifiers;
}
 
Example #12
Source File: SpringBootAdminHazelcastApplication.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@Bean
public Notifier loggingNotifier() {
	return (event) -> Mono.fromRunnable(() -> log.info("Event occured: {}", event));
}
 
Example #13
Source File: AdminServerAutoConfigurationTest.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@Bean
public Notifier notifier() {
	return (e) -> Mono.empty();
}
 
Example #14
Source File: FilteringNotifier.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
public FilteringNotifier(Notifier delegate, InstanceRepository repository) {
	super(repository);
	Assert.notNull(delegate, "'delegate' must not be null!");
	this.delegate = delegate;
}
 
Example #15
Source File: AdminServerNotifierAutoConfiguration.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@Bean
@Primary
@Conditional(NoSingleNotifierCandidateCondition.class)
public CompositeNotifier compositeNotifier(List<Notifier> notifiers) {
	return new CompositeNotifier(notifiers);
}
 
Example #16
Source File: AdminServerNotifierAutoConfiguration.java    From spring-boot-admin with Apache License 2.0 4 votes vote down vote up
@Bean(initMethod = "start", destroyMethod = "stop")
@ConditionalOnMissingBean(NotificationTrigger.class)
public NotificationTrigger notificationTrigger(Notifier notifier, Publisher<InstanceEvent> events) {
	return new NotificationTrigger(notifier, events);
}
 
Example #17
Source File: NotifierConfiguration.java    From spring-boot-start-current with Apache License 2.0 4 votes vote down vote up
public NotifierConfiguration ( InstanceRepository repository , ObjectProvider< List< Notifier > > otherNotifiers ) {
	this.repository = repository;
	this.otherNotifiers = otherNotifiers;
}
 
Example #18
Source File: FilteringNotifier.java    From Moss with Apache License 2.0 4 votes vote down vote up
public FilteringNotifier(Notifier delegate, InstanceRepository repository) {
    super(repository);
    Assert.notNull(delegate, "'delegate' must not be null!");
    this.delegate = delegate;
}
 
Example #19
Source File: AdminServerNotifierAutoConfiguration.java    From Moss with Apache License 2.0 4 votes vote down vote up
@Bean
@Primary
@Conditional(NoSingleNotifierCandidateCondition.class)
public CompositeNotifier compositeNotifier(List<Notifier> notifiers) {
    return new CompositeNotifier(notifiers);
}