Class EventDescriptor

java.lang.Object
net.jini.entry.AbstractEntry
org.jini.rio.event.EventDescriptor
All Implemented Interfaces:
Serializable, Entry

public class EventDescriptor extends AbstractEntry
The EventDescriptor describes an event that an EventProducer will advertise as part of it's attribute set in a Jini Lookup Service.
See Also:
  • Field Details

    • eventClass

      public Class eventClass
      The event classes Class that this EventDescriptor describes
    • eventID

      public Long eventID
      The event class event identifier. Care should be taken that this identifier is unique
  • Constructor Details

    • EventDescriptor

      public EventDescriptor()
      Construct an EventDescriptor with attributes set to null
    • EventDescriptor

      public EventDescriptor(Class eventClass)
      Construct an EventDescriptor with a class
    • EventDescriptor

      public EventDescriptor(long eventID)
      Construct an EventDescriptor with a long event ID.
    • EventDescriptor

      public EventDescriptor(Long eventID)
      Construct an EventDescriptor with a Long event ID.
    • EventDescriptor

      public EventDescriptor(Class eventClass, long eventID)
      Construct an EventDescriptor with a class and long event ID. The eventID will be turned into a Long
    • EventDescriptor

      public EventDescriptor(Class eventClass, Long eventID)
      Construct an EventDescriptor with a class and an event ID.
  • Method Details

    • matches

      public boolean matches(EventDescriptor template)
      Determine whether the provided EventDescriptor matches properties of this EventDescriptor
      Returns:
      The following logic determines EventDescriptor matching semantics :
      • If the provided EventDescriptor properties eventID and eventClass are null, return true.
      • If the provided EventDescriptor property eventID is null, and the eventClass property is not null, return whether the provided EventDescriptor property eventClass is equal to the eventClass property
      • If the eventID property is null, return false.
      • If the eventID property is not null, and the provided EventDescriptor eventID property is not null, return whether the provided EventDescriptor property eventID is equal to the eventID property
      Throws:
      NullPointerException - if the the provided EventDescriptor is null
    • toString

      public String toString()
      Produce a String representation of an EventDescriptor
      Overrides:
      toString in class AbstractEntry
      Returns:
      the result of calling AbstractEntry.toString(this)