Package com.tangosol.net.topic
Class NamedTopicEvent
- java.lang.Object
-
- java.util.EventObject
-
- com.tangosol.net.topic.NamedTopicEvent
-
- All Implemented Interfaces:
PortableObject,Serializable
public class NamedTopicEvent extends EventObject implements PortableObject
An event related to aNamedTopic.- Author:
- Jonathan Knight 2024.11.26
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNamedTopicEvent.Type
-
Field Summary
Fields Modifier and Type Field Description protected NamedTopicEvent.Typem_typeThe event's type.-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description NamedTopicEvent()Default constructor for serialization.NamedTopicEvent(NamedTopic<?> source, NamedTopicEvent.Type type)Create an event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispatch(NamedTopicListener listener)Dispatch this event to the specified MapListener.voiddispatch(Listeners listeners)Dispatch this event to the specified listener collection.voiddispatch(Listeners listeners, boolean fStrict)Dispatch this event to the specified listener collection.NamedTopic<?>getSource()NamedTopicEvent.TypegetType()Returns the type of the event.voidreadExternal(PofReader in)Restore the contents of a user type instance by reading its state using the specified PofReader object.NamedTopicEventreplaceSource(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.StringtoString()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 Detail
-
m_type
protected NamedTopicEvent.Type m_type
The event's type.
-
-
Constructor Detail
-
NamedTopicEvent
public NamedTopicEvent()
Default constructor for serialization.
-
NamedTopicEvent
public NamedTopicEvent(NamedTopic<?> source, NamedTopicEvent.Type type)
Create an event.- Parameters:
source- the source of the eventtype- the type of the event
-
-
Method Detail
-
getSource
public NamedTopic<?> getSource()
- Overrides:
getSourcein classEventObject
-
getType
public NamedTopicEvent.Type getType()
Returns the type of the event.- Returns:
- the type of the event
-
readExternal
public void readExternal(PofReader in) throws IOException
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
public void writeExternal(PofWriter out) throws IOException
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
public String toString()
Return a String representation of this MapEvent object.- Overrides:
toStringin classEventObject- Returns:
- a String representation of this MapEvent object
-
dispatch
public void dispatch(Listeners listeners)
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
public void dispatch(Listeners listeners, boolean fStrict)
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
public void dispatch(NamedTopicListener listener)
Dispatch this event to the specified MapListener.- Parameters:
listener- the listener
-
shouldDispatch
protected boolean shouldDispatch(NamedTopicListener listener)
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
public NamedTopicEvent replaceSource(NamedTopic<?> source)
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
-
-