/*
 * Copyright 2013-2014 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.springframework.platform.netflix.eureka;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.ContextRefreshedEvent;

import com.netflix.appinfo.ApplicationInfoManager;
import com.netflix.appinfo.InstanceInfo.InstanceStatus;
import com.netflix.discovery.DiscoveryManager;

/**
 * @author Dave Syer
 *
 */
@Configuration
@EnableConfigurationProperties({EurekaClientConfigBean.class, EurekaInstanceConfigBean.class})
public class EurekaClientAutoConfiguration implements ApplicationListener<ContextRefreshedEvent> {

	@Autowired
	private EurekaClientConfigBean clientConfig;

	@Autowired
	private EurekaInstanceConfigBean instanceConfig;
	
	@Override
	public void onApplicationEvent(ContextRefreshedEvent event) {
		ApplicationInfoManager.getInstance().setInstanceStatus(InstanceStatus.UP);		
	}

	@PostConstruct
	public void init() {
		DiscoveryManager.getInstance().initComponent(
				instanceConfig,
				clientConfig);
	}
	
	@PreDestroy
	public void close() {
		DiscoveryManager.getInstance().shutdownComponent();
	}

}

@@ -807,16 +807,173 @@
 owired;%0A
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;%0Aimport org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;%0A
 import o
@@ -1381,16 +1381,65 @@
 Manager;
+%0Aimport com.netflix.discovery.EurekaClientConfig;
 %0A%0A/**%0A *
@@ -1574,16 +1574,120 @@
 class%7D)%0A
+@ConditionalOnClass(EurekaClientConfig.class)%0A@ConditionalOnExpression(%22$%7Beureka.client.enabled:true%7D%22)%0A
 public c

Add @Conditionals to EurekaClientAutoConfiguration