public class EurekaBootStrap
extends java.lang.Object
implements javax.servlet.ServletContextListener
The eureka server is configured by using the configuration
EurekaServerConfig specified by eureka.server.props in the
classpath. The eureka client component is also initialized by using the
configuration EurekaInstanceConfig specified by
eureka.client.props. If the server runs in the AWS cloud, the eureka
server binds it to the elastic ip as specified.
| Modifier and Type | Field and Description |
|---|---|
protected AwsBinder |
awsBinder |
protected EurekaServerContext |
serverContext |
| Constructor and Description |
|---|
EurekaBootStrap() |
| Modifier and Type | Method and Description |
|---|---|
void |
contextDestroyed(javax.servlet.ServletContextEvent event)
Handles Eureka cleanup, including shutting down all monitors and yielding all EIPs.
|
void |
contextInitialized(javax.servlet.ServletContextEvent event)
Initializes Eureka, including syncing up with other Eureka peers and publishing the registry.
|
protected void |
destroyEurekaEnvironment()
Users can override to clean up the environment themselves.
|
protected void |
destroyEurekaServerContext()
Server context shutdown hook.
|
protected void |
initEurekaEnvironment()
Users can override to initialize the environment themselves.
|
protected void |
initEurekaServerContext()
init hook for server context.
|
protected boolean |
isAws(com.netflix.appinfo.InstanceInfo selfInstanceInfo) |
protected boolean |
isCloud(com.netflix.config.DeploymentContext deploymentContext) |
protected volatile EurekaServerContext serverContext
protected volatile AwsBinder awsBinder
public void contextInitialized(javax.servlet.ServletContextEvent event)
contextInitialized in interface javax.servlet.ServletContextListenerServletContextListener.contextInitialized(javax.servlet.ServletContextEvent)protected void initEurekaEnvironment()
throws java.lang.Exception
java.lang.Exceptionprotected void initEurekaServerContext()
throws java.lang.Exception
java.lang.Exceptionpublic void contextDestroyed(javax.servlet.ServletContextEvent event)
contextDestroyed in interface javax.servlet.ServletContextListenerServletContextListener.contextDestroyed(javax.servlet.ServletContextEvent)protected void destroyEurekaServerContext()
throws java.lang.Exception
java.lang.Exceptionprotected void destroyEurekaEnvironment()
throws java.lang.Exception
java.lang.Exceptionprotected boolean isAws(com.netflix.appinfo.InstanceInfo selfInstanceInfo)
protected boolean isCloud(com.netflix.config.DeploymentContext deploymentContext)