/*
 * Copyright 2002-2019 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
 *
 *      https://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.context;

import java.util.EventObject;

/**
 * Class to be extended by all application events. Abstract as it
 * doesn't make sense for generic events to be published directly.
 *
 * @author Rod Johnson
 * @author Juergen Hoeller
 * @see org.springframework.context.ApplicationListener
 * @see org.springframework.context.event.EventListener
 */
public abstract class ApplicationEvent extends EventObject {

	/** use serialVersionUID from Spring 1.2 for interoperability. */
	private static final long serialVersionUID = 7099057708183571937L;

	/** System time when the event happened. */
	private final long timestamp;


	/**
	 * Create a new {@code ApplicationEvent}.
	 * @param source the object on which the event initially occurred or with
	 * which the event is associated (never {@code null})
	 */
	public ApplicationEvent(Object source) {
		super(source);
		this.timestamp = System.currentTimeMillis();
	}


	/**
	 * Return the system time in milliseconds when the event occurred.
	 */
	public final long getTimestamp() {
		return this.timestamp;
	}

}

@@ -654,16 +654,40 @@
 ntext;%0A%0A
+import java.time.Clock;%0A
 import j
@@ -1584,16 +1584,391 @@
 ();%0A%09%7D%0A%0A
+%09/**%0A%09 * Create a new %7B@code ApplicationEvent%7D with a fixed timestamp.%0A%09 * @param source the object on which the event initially occurred or with%0A%09 * which the event is associated (never %7B@code null%7D)%0A%09 * @param clock a clock which will provide the timestamp%0A%09 */%0A%09public ApplicationEvent(Object source, Clock clock) %7B%0A%09%09super(source);%0A%09%09this.timestamp = clock.millis();%0A%09%7D%0A%0A
 %0A%09/**%0A%09 

Add ApplicationEvent constructor for specifying timestamp