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 TypeMethodDescriptionvoid
dispatch
(NamedTopicListener listener) Dispatch this event to the specified MapListener.void
Dispatch this event to the specified listener collection.void
Dispatch this event to the specified listener collection.NamedTopic
<?> getType()
Returns the type of the event.void
Restore the contents of a user type instance by reading its state using the specified PofReader object.replaceSource
(NamedTopic<?> source) Create a newNamedTopicEvent
the same as this event, but with a different source.protected boolean
shouldDispatch
(NamedTopicListener listener) Return true if the providedMapListener
should receive this event.toString()
Return a String representation of this MapEvent object.void
writeExternal
(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:
getSource
in classEventObject
-
getType
Returns the type of the event.- Returns:
- the type of the event
-
readExternal
Description copied from interface:PortableObject
Restore the contents of a user type instance by reading its state using the specified PofReader object.- Specified by:
readExternal
in 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:PortableObject
Save the contents of a POF user type instance by writing its state using the specified PofWriter object.- Specified by:
writeExternal
in 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:
toString
in 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 providedMapListener
should 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 newNamedTopicEvent
the same as this event, but with a different source.- Parameters:
source
- the new event source- Returns:
- a new
NamedTopicEvent
the same as this event, but with a different source - Throws:
NullPointerException
- if thesource
parameter isnull
-