com.netflix.appinfo
Class ApplicationInfoManager

java.lang.Object
  extended by com.netflix.appinfo.ApplicationInfoManager

public class ApplicationInfoManager
extends java.lang.Object

The class that initializes information required for registration with Eureka Server and to be discovered by other components.

The information required for registration is provided by the user by passing the configuration defined by the contract in EurekaInstanceConfig }.AWS clients can either use or extend CloudInstanceConfig.Other non-AWS clients can use or extend either MyDataCenterInstanceConfig or very basic AbstractInstanceConfig.


Method Summary
 InstanceInfo getInfo()
          Gets the information about this instance that is registered with eureka.
static ApplicationInfoManager getInstance()
           
 void initComponent(EurekaInstanceConfig config)
           
 void refreshDataCenterInfoIfRequired()
          Refetches the hostname to check if it has changed.
 void registerAppMetadata(java.util.Map<java.lang.String,java.lang.String> appMetadata)
          Register user-specific instance meta data.
 void setInstanceStatus(InstanceInfo.InstanceStatus status)
          Set the status of this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ApplicationInfoManager getInstance()

initComponent

public void initComponent(EurekaInstanceConfig config)

getInfo

public InstanceInfo getInfo()
Gets the information about this instance that is registered with eureka.

Returns:
information about this instance that is registered with eureka.

registerAppMetadata

public void registerAppMetadata(java.util.Map<java.lang.String,java.lang.String> appMetadata)
Register user-specific instance meta data. Application can send any other additional meta data that need to be accessed for other reasons.The data will be periodically sent to the eureka server.

Parameters:
appMetadata - application specific meta data.

setInstanceStatus

public void setInstanceStatus(InstanceInfo.InstanceStatus status)
Set the status of this instance. Application can use this to indicate whether it is ready to receive traffic.

Parameters:
status - Status of the instance

refreshDataCenterInfoIfRequired

public void refreshDataCenterInfoIfRequired()
Refetches the hostname to check if it has changed. If it has, the entire DataCenterInfo is refetched and passed on to the eureka server on next heartbeat.