org.springframework.boot.context.initializer
Class ContextIdApplicationContextInitializer
java.lang.Object
org.springframework.boot.context.initializer.ContextIdApplicationContextInitializer
- All Implemented Interfaces:
- 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 Spring
ApplicationContext ID. The following environment
properties will be consulted to create the ID:
- spring.application.name
- vcap.application.name
- spring.config.name
If no property is set the ID 'application' will be used.
In addition the following environment properties will be consulted to append a relevant
port or index:
- spring.application.index
- vcap.application.instance_index
- PORT
- Author:
- Dave Syer
| Fields inherited from interface org.springframework.core.Ordered |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
|
Method Summary |
int |
getOrder()
|
void |
initialize(org.springframework.context.ConfigurableApplicationContext applicationContext)
|
void |
setOrder(int order)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ContextIdApplicationContextInitializer
public ContextIdApplicationContextInitializer()
setOrder
public void setOrder(int order)
getOrder
public int getOrder()
- Specified by:
getOrder in interface org.springframework.core.Ordered
initialize
public void initialize(org.springframework.context.ConfigurableApplicationContext applicationContext)
- Specified by:
initialize in interface org.springframework.context.ApplicationContextInitializer<org.springframework.context.ConfigurableApplicationContext>
Copyright © 2013. All Rights Reserved.