Rio Project 4.2 API Documentation



org.rioproject.event
Class DynamicEventConsumer

java.lang.Object
  extended by org.rioproject.event.BasicEventConsumer
      extended by org.rioproject.event.DynamicEventConsumer
All Implemented Interfaces:
Remote, EventListener, RemoteEventListener, ServerProxyTrust, EventConsumer

public class DynamicEventConsumer
extends BasicEventConsumer

A DynamicEventConsumer extends BasicEventConsumer and provides the capability to discover when EventProducer instances join and leave the network

Author:
Dennis Reedy

Field Summary
 
Fields inherited from class org.rioproject.event.BasicEventConsumer
DEFAULT_LEASE_DURATION, edTemplate, ektime, eventRegistrationTable, eventSubscribers, handback, leaseDuration, leaseTable, received, RESPONSE_WATCH, responseWatch, sktime, watchRegistry
 
Constructor Summary
DynamicEventConsumer(EventDescriptor edTemplate, DiscoveryManagement dMgr)
          Create a DynamicEventConsumer with an EventDescriptor
DynamicEventConsumer(EventDescriptor edTemplate, RemoteServiceEventListener listener, DiscoveryManagement dMgr)
          Create a DynamicEventConsumer with an EventDescriptor, a RemoteServiceEventListener and a DiscoveryManagement instance
DynamicEventConsumer(EventDescriptor edTemplate, RemoteServiceEventListener listener, MarshalledObject handback, DiscoveryManagement dMgr)
          Create a DynamicEventConsumer with an EventDescriptor, a RemoteServiceEventListener a MarshalledObject handback, a specified lease duration to be used for all event registrations and a DiscoveryManagement instance
DynamicEventConsumer(EventDescriptor edTemplate, RemoteServiceEventListener listener, MarshalledObject handback, DiscoveryManagement dMgr, Configuration config)
          Create a DynamicEventConsumer with an EventDescriptor, a RemoteServiceEventListener a MarshalledObject handback, a specified lease duration to be used for all event registrations and a DiscoveryManagement instance
 
Method Summary
 EventProducer[] getEventProducers()
          Returns an array of all EventProducer proxy objects that have been discovered
 boolean register(RemoteServiceEventListener listener, MarshalledObject handback)
          Override parent's register method to provide the ability if we've discovered EventProducer instances that match we should register with them
 void terminate()
          Override parent's terminate() method to terminate the ServiceDiscoveryManager
 
Methods inherited from class org.rioproject.event.BasicEventConsumer
createWatch, deregister, deregister, deregister, destroyWatch, finalize, getDescriptor, getEventRegistrationSource, getListeners, getProxyVerifier, getWatch, notify, printStats, register, register, register
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicEventConsumer

public DynamicEventConsumer(EventDescriptor edTemplate,
                            DiscoveryManagement dMgr)
                     throws Exception
Create a DynamicEventConsumer with an EventDescriptor

Parameters:
edTemplate - The EventDescriptor template
dMgr - The DiscoveryManagement instance
Throws:
Exception - if the DynamicEventConsumer cannot be created

DynamicEventConsumer

public DynamicEventConsumer(EventDescriptor edTemplate,
                            RemoteServiceEventListener listener,
                            DiscoveryManagement dMgr)
                     throws Exception
Create a DynamicEventConsumer with an EventDescriptor, a RemoteServiceEventListener and a DiscoveryManagement instance

Parameters:
edTemplate - The EventDescriptor template
listener - The RemoteServiceEventListener
dMgr - The DiscoveryManagement instance
Throws:
Exception - if the DynamicEventConsumer cannot be created

DynamicEventConsumer

public DynamicEventConsumer(EventDescriptor edTemplate,
                            RemoteServiceEventListener listener,
                            MarshalledObject handback,
                            DiscoveryManagement dMgr)
                     throws Exception
Create a DynamicEventConsumer with an EventDescriptor, a RemoteServiceEventListener a MarshalledObject handback, a specified lease duration to be used for all event registrations and a DiscoveryManagement instance

Parameters:
edTemplate - The EventDescriptor template
listener - The RemoteServiceEventListener
handback - The MarshalledObject to be used as a handback
dMgr - The DiscoveryManagement instance
Throws:
Exception - if the DynamicEventConsumer cannot be created

DynamicEventConsumer

public DynamicEventConsumer(EventDescriptor edTemplate,
                            RemoteServiceEventListener listener,
                            MarshalledObject handback,
                            DiscoveryManagement dMgr,
                            Configuration config)
                     throws Exception
Create a DynamicEventConsumer with an EventDescriptor, a RemoteServiceEventListener a MarshalledObject handback, a specified lease duration to be used for all event registrations and a DiscoveryManagement instance

Parameters:
edTemplate - The EventDescriptor template
listener - The RemoteServiceEventListener
handback - The MarshalledObject to be used as a handback
dMgr - The DiscoveryManagement instance
config - Configuration object
Throws:
Exception - if the DynamicEventConsumer cannot be created
Method Detail

terminate

public void terminate()
Override parent's terminate() method to terminate the ServiceDiscoveryManager

Specified by:
terminate in interface EventConsumer
Overrides:
terminate in class BasicEventConsumer

register

public boolean register(RemoteServiceEventListener listener,
                        MarshalledObject handback)
Override parent's register method to provide the ability if we've discovered EventProducer instances that match we should register with them

Specified by:
register in interface EventConsumer
Overrides:
register in class BasicEventConsumer
Parameters:
listener - The RemoteServiceEventListener
handback - The MarshalledObject to be used as a handback
Returns:
true if the RemoteServiceEventListener has been added

getEventProducers

public EventProducer[] getEventProducers()
Returns an array of all EventProducer proxy objects that have been discovered

Returns:
An array of EventProducer proxy objects

Copyright © Rio Project.

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