Rio Project 4.2 API Documentation



org.rioproject.associations.strategy
Class AbstractServiceSelectionStrategy<T>

java.lang.Object
  extended by org.rioproject.associations.strategy.AbstractServiceSelectionStrategy<T>
All Implemented Interfaces:
AssociationListener<T>, ServiceSelectionStrategy<T>
Direct Known Subclasses:
FailOver, RoundRobin, Utilization

public abstract class AbstractServiceSelectionStrategy<T>
extends Object
implements ServiceSelectionStrategy<T>

Boilerplate implementation of the ServiceSelectionStrategy.

Author:
Dennis Reedy

Field Summary
protected  Association<T> association
           
 
Constructor Summary
AbstractServiceSelectionStrategy()
           
 
Method Summary
 void broken(Association<T> association, T service)
          Notify the AssociationListener that an Association is broken.
 void changed(Association<T> association, T service)
          Notify the AssociationListener that a service endpoint has changed
 void discovered(Association<T> association, T service)
          Notify the AssociationListener that an Association has been discovered
 Association<T> getAssociation()
          Get the association set to the strategy
abstract  T getService()
          Select a service for invocation
 void setAssociation(Association<T> association)
          Set the association
 void terminate()
          Clean up any resources allocated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

association

protected Association<T> association
Constructor Detail

AbstractServiceSelectionStrategy

public AbstractServiceSelectionStrategy()
Method Detail

setAssociation

public void setAssociation(Association<T> association)
Description copied from interface: ServiceSelectionStrategy
Set the association

Specified by:
setAssociation in interface ServiceSelectionStrategy<T>
Parameters:
association - The association

getAssociation

public Association<T> getAssociation()
Description copied from interface: ServiceSelectionStrategy
Get the association set to the strategy

Specified by:
getAssociation in interface ServiceSelectionStrategy<T>
Returns:
The association

getService

public abstract T getService()
Description copied from interface: ServiceSelectionStrategy
Select a service for invocation

Specified by:
getService in interface ServiceSelectionStrategy<T>
Returns:
The proxy for a service

terminate

public void terminate()
Description copied from interface: ServiceSelectionStrategy
Clean up any resources allocated

Specified by:
terminate in interface ServiceSelectionStrategy<T>

discovered

public void discovered(Association<T> association,
                       T service)
Description copied from interface: AssociationListener
Notify the AssociationListener that an Association has been discovered

Specified by:
discovered in interface AssociationListener<T>
Parameters:
association - The Association
service - The associated service that has been discovered

changed

public void changed(Association<T> association,
                    T service)
Description copied from interface: AssociationListener
Notify the AssociationListener that a service endpoint has changed

Specified by:
changed in interface AssociationListener<T>
Parameters:
association - The Association
service - The service that was removed, changing the endpoint

broken

public void broken(Association<T> association,
                   T service)
Description copied from interface: AssociationListener
Notify the AssociationListener that an Association is broken. If the Association type is requires, the AssociationManagement object will unadvertise the ServiceBean using the ServiceBean instances ServiceBeanControl interface unless the unadvertiseOnBroken is set to false

Specified by:
broken in interface AssociationListener<T>
Parameters:
association - The Association.
service - The service that was removed, causing the Association to be broken

Copyright © Rio Project.

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