Package com.tangosol.net.topic
Class NamedTopicEvent
java.lang.Object
java.util.EventObject
com.tangosol.net.topic.NamedTopicEvent
- All Implemented Interfaces:
PortableObject,Serializable
An event related to a
NamedTopic.- Author:
- Jonathan Knight 2024.11.26
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for serialization.NamedTopicEvent(NamedTopic<?> source, NamedTopicEvent.Type type) Create an event. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispatch(NamedTopicListener listener) Dispatch this event to the specified MapListener.voidDispatch this event to the specified listener collection.voidDispatch this event to the specified listener collection.NamedTopic<?> getType()Returns the type of the event.voidRestore the contents of a user type instance by reading its state using the specified PofReader object.replaceSource(NamedTopic<?> source) Create a newNamedTopicEventthe same as this event, but with a different source.protected booleanshouldDispatch(NamedTopicListener listener) Return true if the providedMapListenershould receive this event.toString()Return a String representation of this MapEvent object.voidwriteExternal(PofWriter out) Save the contents of a POF user type instance by writing its state using the specified PofWriter object.
-
Field Details
-
m_type
The event's type.
-
-
Constructor Details
-
NamedTopicEvent
public NamedTopicEvent()Default constructor for serialization. -
NamedTopicEvent
Create an event.- Parameters:
source- the source of the eventtype- the type of the event
-
-
Method Details
-
getSource
- Overrides:
getSourcein classEventObject
-
getType
Returns the type of the event.- Returns:
- the type of the event
-
readExternal
Description copied from interface:PortableObjectRestore the contents of a user type instance by reading its state using the specified PofReader object.- Specified by:
readExternalin interfacePortableObject- Parameters:
in- the PofReader from which to read the object's state- Throws:
IOException- if an I/O error occurs
-
writeExternal
Description copied from interface:PortableObjectSave the contents of a POF user type instance by writing its state using the specified PofWriter object.- Specified by:
writeExternalin interfacePortableObject- Parameters:
out- the PofWriter to which to write the object's state- Throws:
IOException- if an I/O error occurs
-
toString
Return a String representation of this MapEvent object.- Overrides:
toStringin classEventObject- Returns:
- a String representation of this MapEvent object
-
dispatch
Dispatch this event to the specified listener collection. This call is equivalent todispatch(listeners, true);
- Parameters:
listeners- the listeners collection- Throws:
ClassCastException- if any of the targets is not an instance of MapListener interface
-
dispatch
Dispatch this event to the specified listener collection.- Parameters:
listeners- the listeners collectionfStrict- if true then any RuntimeException thrown by event handlers stops all further event processing and the exception is re-thrown; if false then all exceptions are logged and the process continues- Throws:
ClassCastException- if any of the targets is not an instance of MapListener interface
-
dispatch
Dispatch this event to the specified MapListener.- Parameters:
listener- the listener
-
shouldDispatch
Return true if the providedMapListenershould receive this event.- Parameters:
listener- the MapListener to dispatch this event to- Returns:
- true if the provided MapListener should receive the event
-
replaceSource
Create a newNamedTopicEventthe same as this event, but with a different source.- Parameters:
source- the new event source- Returns:
- a new
NamedTopicEventthe same as this event, but with a different source - Throws:
NullPointerException- if thesourceparameter isnull
-