Rio Project 4.2 API Documentation



org.rioproject.event
Class EventDescriptor

java.lang.Object
  extended by net.jini.entry.AbstractEntry
      extended by org.rioproject.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.

Author:
Dennis Reedy
See Also:
Serialized Form

Field Summary
 Class eventClass
          The event classes Class that this EventDescriptor describes
 Long eventID
          The event class event identifier.
 
Constructor Summary
EventDescriptor()
          Construct an EventDescriptor with attributes set to null
EventDescriptor(Class eventClass, Long eventID)
          Construct an EventDescriptor with a class and long event ID.
 
Method Summary
 boolean matches(EventDescriptor template)
          Determine whether the provided EventDescriptor matches properties of this EventDescriptor
 String toString()
          Produce a String representation of an EventDescriptor
 
Methods inherited from class net.jini.entry.AbstractEntry
equals, equals, hashCode, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

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 Detail

EventDescriptor

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


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

Parameters:
eventClass - The event class the descriptor describes
eventID - The identifier for the event
Method Detail

matches

public boolean matches(EventDescriptor template)
Determine whether the provided EventDescriptor matches properties of this EventDescriptor

Parameters:
template - The EventDescriptor template to match
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

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.