Package org.springframework.context
Class ApplicationEvent
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- AbstractSubProtocolEvent,- ApplicationContextEvent,- BrokerAvailabilityEvent,- PayloadApplicationEvent,- RequestHandledEvent,- TestContextEvent
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, Juergen Hoeller
- See Also:
- 
Field SummaryFields inherited from class java.util.EventObjectsource
- 
Constructor SummaryConstructorsConstructorDescriptionApplicationEvent(Object source) ApplicationEvent(Object source, Clock clock) Create a newApplicationEventwith itstimestampset to the value returned byClock.millis()in the providedClock.
- 
Method SummaryModifier and TypeMethodDescriptionfinal longReturn the time in milliseconds when the event occurred.Methods inherited from class java.util.EventObjectgetSource, toString
- 
Constructor Details- 
ApplicationEvent- Parameters:
- source- the object on which the event initially occurred or with which the event is associated (never- null)
- See Also:
 
- 
ApplicationEventCreate a newApplicationEventwith itstimestampset to the value returned byClock.millis()in the providedClock.This constructor is typically used in testing scenarios. - Parameters:
- source- the object on which the event initially occurred or with which the event is associated (never- null)
- clock- a clock which will provide the timestamp
- Since:
- 5.3.8
- See Also:
 
 
- 
- 
Method Details- 
getTimestamppublic final long getTimestamp()Return the time in milliseconds when the event occurred.
 
-