|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.domain.EventBase
org.axonframework.domain.ApplicationEvent
public abstract class ApplicationEvent
Represents an event that does not represent a state change of an application but does have functional meaning to the application.
This implementation will maintain a loose reference to the source of the event. However, this source will not be serialized with the event. This means the source will not be available after deserialization. Instead, you can access thesource type and source description.
Note: Do not confuse the type of reference used by this class with Java's weak reference. The reference
maintained by this event will prevent the garbage collector from cleaning up the source instance. However,
the reference will not survive serialization of the event.
Design consideration: Be cautious when using application events. Make sure you did not overlook an
opportunity to use a domain event.
DomainEvent,
Serialized Form| Constructor Summary | |
|---|---|
protected |
ApplicationEvent(Object source)
Initialize an application event with the given source. |
| Method Summary | |
|---|---|
Object |
getSource()
Returns the instance that reported this event. |
String |
getSourceDescription()
Returns the description of the instance that reported this event. |
Class |
getSourceType()
Returns the type of the instance that reported this event. |
| Methods inherited from class org.axonframework.domain.EventBase |
|---|
addMetaData, equals, getEventIdentifier, getEventRevision, getMetaData, getMetaDataValue, getTimestamp, hashCode, setEventRevision |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected ApplicationEvent(Object source)
source. Source may be null. In that case, the source
type and source description will be set to Object.class and [unknown source]
respectively.
source - the instance that reported this event. If any.| Method Detail |
|---|
public Object getSource()
public Class getSourceType()
null, this method will return Object.class.
public String getSourceDescription()
source.toString(). Unlike the source itself, this value will survive serialization. If the source
was null, this method will return [unknown source].
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||