类 ContextIdApplicationContextInitializer
- java.lang.Object
- org.springframework.boot.context.ContextIdApplicationContextInitializer
- 所有已实现的接口:
org.springframework.context.ApplicationContextInitializer<org.springframework.context.ConfigurableApplicationContext>
,org.springframework.core.Ordered
public class ContextIdApplicationContextInitializer extends Object implements org.springframework.context.ApplicationContextInitializer<org.springframework.context.ConfigurableApplicationContext>, org.springframework.core.Ordered
ApplicationContextInitializer
that set the SpringApplicationContext ID
. The following environment properties will be consulted to create the ID:- spring.application.name
- vcap.application.name
- spring.config.name
In addition the following environment properties will be consulted to append a relevant port or index:
- spring.application.index
- vcap.application.instance_index
- PORT
构造器概要
构造器 构造器 说明 ContextIdApplicationContextInitializer()
ContextIdApplicationContextInitializer(String name)
Create a newContextIdApplicationContextInitializer
instance.
构造器详细资料
ContextIdApplicationContextInitializer
public ContextIdApplicationContextInitializer()
ContextIdApplicationContextInitializer
public ContextIdApplicationContextInitializer(String name)
Create a newContextIdApplicationContextInitializer
instance.- 参数:
name
- the name of the application (can include placeholders)
方法详细资料
setOrder
public void setOrder(int order)
getOrder
public int getOrder()
- 指定者:
getOrder
在接口中org.springframework.core.Ordered
initialize
public void initialize(org.springframework.context.ConfigurableApplicationContext applicationContext)
- 指定者:
initialize
在接口中org.springframework.context.ApplicationContextInitializer<org.springframework.context.ConfigurableApplicationContext>