Home / Function/ onlyRegisteredOnceWhenThereIsAChildContext() — spring-boot Function Reference

onlyRegisteredOnceWhenThereIsAChildContext() — spring-boot Function Reference

Architecture documentation for the onlyRegisteredOnceWhenThereIsAChildContext() function in SpringApplicationAdminJmxAutoConfigurationTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  cd290cc3_c512_348f_0aea_acc9eedcb653["onlyRegisteredOnceWhenThereIsAChildContext()"]
  67bae297_b590_f5e5_2666_5d557e3b57b1["SpringApplicationBuilder()"]
  cd290cc3_c512_348f_0aea_acc9eedcb653 -->|calls| 67bae297_b590_f5e5_2666_5d557e3b57b1
  96180309_d35f_64e9_f339_53aa62a53500["web()"]
  cd290cc3_c512_348f_0aea_acc9eedcb653 -->|calls| 96180309_d35f_64e9_f339_53aa62a53500
  51fff311_cd5f_0d1a_785f_e21bb701b042["sources()"]
  cd290cc3_c512_348f_0aea_acc9eedcb653 -->|calls| 51fff311_cd5f_0d1a_785f_e21bb701b042
  a64bbc22_3f73_434d_d720_26462030b670["child()"]
  cd290cc3_c512_348f_0aea_acc9eedcb653 -->|calls| a64bbc22_3f73_434d_d720_26462030b670
  3613e214_49bf_015b_c43f_7f8a1274fb0b["run()"]
  cd290cc3_c512_348f_0aea_acc9eedcb653 -->|calls| 3613e214_49bf_015b_c43f_7f8a1274fb0b
  style cd290cc3_c512_348f_0aea_acc9eedcb653 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/admin/SpringApplicationAdminJmxAutoConfigurationTests.java lines 108–121

	@Test
	void onlyRegisteredOnceWhenThereIsAChildContext() {
		SpringApplicationBuilder parentBuilder = new SpringApplicationBuilder().web(WebApplicationType.NONE)
			.sources(MultipleMBeanExportersConfiguration.class, SpringApplicationAdminJmxAutoConfiguration.class);
		SpringApplicationBuilder childBuilder = parentBuilder
			.child(MultipleMBeanExportersConfiguration.class, SpringApplicationAdminJmxAutoConfiguration.class)
			.web(WebApplicationType.NONE);
		try (ConfigurableApplicationContext parent = parentBuilder.run("--" + ENABLE_ADMIN_PROP);
				ConfigurableApplicationContext child = childBuilder.run("--" + ENABLE_ADMIN_PROP)) {
			BeanFactoryUtils.beanOfType(parent.getBeanFactory(), SpringApplicationAdminMXBeanRegistrar.class);
			assertThatExceptionOfType(NoSuchBeanDefinitionException.class).isThrownBy(() -> BeanFactoryUtils
				.beanOfType(child.getBeanFactory(), SpringApplicationAdminMXBeanRegistrar.class));
		}
	}

Domain

Subdomains

Frequently Asked Questions

What does onlyRegisteredOnceWhenThereIsAChildContext() do?
onlyRegisteredOnceWhenThereIsAChildContext() is a function in the spring-boot codebase.
What does onlyRegisteredOnceWhenThereIsAChildContext() call?
onlyRegisteredOnceWhenThereIsAChildContext() calls 5 function(s): SpringApplicationBuilder, child, run, sources, web.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free