/*
 * Copyright 2013-2015 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.cloud.client.discovery.event;

/**
 * Heartbeat Event that a Parent ApplicationContext can send to a child Context. Useful
 * when config server is located via DiscoveryClient
 * @author Spencer Gibb
 */
@SuppressWarnings("serial")
public class ParentHeartbeatEvent extends HeartbeatEvent {

	public ParentHeartbeatEvent(Object source, Object value) {
		super(source, value);
	}

}

@@ -674,16 +674,70 @@
 event;%0A%0A
+import org.springframework.context.ApplicationEvent;%0A%0A
 /**%0A * H
@@ -933,150 +933,385 @@
 l%22)%0A
-public class ParentHeartbeatEvent extends HeartbeatEvent %7B%0A%0A%09public ParentHeartbeatEvent(Object source, Object value) %7B%0A%09%09super(source, value)
+//WARNING: do not extend HearbeatEvent because of a parent context forwarding%0A//Heartbeat events to a child.  Avoids a stack overflow.%0Apublic class ParentHeartbeatEvent extends ApplicationEvent %7B%0A%0A%09private final Object value;%0A%0A%09public ParentHeartbeatEvent(Object source, Object value) %7B%0A%09%09super(source);%0A%09%09this.value = value;%0A%09%7D%0A%0A%09public Object getValue() %7B%0A%09%09return this.value
 ;%0A%09%7D

undo ParentHeartbeatEvent extends HeartbeatEvent