Class MulticastEvent

java.lang.Object
java.util.EventObject
cl.netswitch.lib.client.MulticastEvent
All Implemented Interfaces:
Serializable

public final class MulticastEvent extends EventObject
MulticastEvent is used to notify that a multicast message has arrived.
See Also:
  • Constructor Details

    • MulticastEvent

      public MulticastEvent(ClientChannel channel, Message message)
      Constructs a new MulticastEvent instance.
      Parameters:
      channel - the object on which the event occurred.
      message - the multicast message of this event.
      Throws:
      NullPointerException - if an argument is null.
  • Method Details

    • getClientChannel

      public ClientChannel getClientChannel()
      Returns the client channel of this MulticastEvent.
      Returns:
      the client channel of this MulticastEvent.
    • getName

      public String getName()
      Returns the multicast name of this MulticastEvent.
      Returns:
      the multicast name of this MulticastEvent.
    • getMessage

      public Message getMessage()
      Returns the multicast message of this MulticastEvent.
      Returns:
      the multicast message of this MulticastEvent.
    • getObject

      public <T extends Serializable> T getObject(Class<T> type)
      Returns the object contained in the message of this MulticastEvent.

      Warning: to reduce memory consumption, this method returns a reference to (not a copy of) the mutable object stored in the request message. If the returned object is later modified, the request message object will be modified.

      Type Parameters:
      T - the type of the returned object.
      Parameters:
      type - the class of the returned object.
      Returns:
      a typed object or null if not defined.
      Throws:
      NullPointerException - if type is null.
      ClassCastException - if object is not an instance of type.