Rio Project 4.2 API Documentation



org.rioproject.event
Class RoundRobinEventHandler

java.lang.Object
  extended by org.rioproject.event.EventHandler
      extended by org.rioproject.event.RoundRobinEventHandler

public class RoundRobinEventHandler
extends EventHandler

The RoundRobinEventHandler provides an implementation of an EventHandler which supports the notification of events using round-robin semantic. This event handler will send notification of an event to a valid remote event listener (one that has an active lease) is the collection of event registrants. For each subsequent notification the next listener in the list will be notified.

If remote event listeners are removed from the collection of event registrants and the notification ordinal references the removed registrant, then the notification ordinal will reference the next registrant in the collection.

The sequence number for events is incremented after each subsequent fire invocation.

Author:
Dennis Reedy

Nested Class Summary
 
Nested classes/interfaces inherited from class org.rioproject.event.EventHandler
EventHandler.EventRegistrationResource
 
Field Summary
 
Fields inherited from class org.rioproject.event.EventHandler
descriptor, ektime, landlord, resourceMgr, RESPONSE_WATCH, responseWatch, sendTime, sent, sequenceNumber, sktime, step, t0, t1, tmp, watchRegistry
 
Constructor Summary
RoundRobinEventHandler(EventDescriptor descriptor)
          Construct a RoundRobinEventHandler with an EventDescriptor and default lease maximum and time allocation
RoundRobinEventHandler(EventDescriptor descriptor, Configuration config)
          Construct a RoundRobinEventHandler with an EventDescriptor and a Configuration object
 
Method Summary
 void fire(RemoteServiceEvent event)
          Implement the fire method from EventHandler.
 
Methods inherited from class org.rioproject.event.EventHandler
createWatch, destroyWatch, getNextServiceResource, getRegistrantCount, getWatch, printStats, register, terminate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoundRobinEventHandler

public RoundRobinEventHandler(EventDescriptor descriptor)
                       throws Exception
Construct a RoundRobinEventHandler with an EventDescriptor and default lease maximum and time allocation

Parameters:
descriptor - The EventDescriptor
Throws:
Exception - If a landlord lease manager cannot be created

RoundRobinEventHandler

public RoundRobinEventHandler(EventDescriptor descriptor,
                              Configuration config)
                       throws Exception
Construct a RoundRobinEventHandler with an EventDescriptor and a Configuration object

Parameters:
descriptor - The EventDescriptor
config - The configuration object
Throws:
Exception - If a landlord lease manager cannot be created
Method Detail

fire

public void fire(RemoteServiceEvent event)
          throws NoEventConsumerException
Implement the fire method from EventHandler. This method will get the next available listener and send it an event. If there are no event registrants a NoEventConsumerException is thrown

Specified by:
fire in class EventHandler
Parameters:
event - The event to send
Throws:
NoEventConsumerException - is there are no event registrants to send the event to

Copyright © Rio Project.

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