Rio Project 4.2 API Documentation



org.rioproject.associations
Class AssociationProxyUtil

java.lang.Object
  extended by org.rioproject.associations.AssociationProxyUtil

public class AssociationProxyUtil
extends Object

Utility for working with a dynamic proxies generated for associations

Author:
Dennis Reedy

Constructor Summary
AssociationProxyUtil()
           
 
Method Summary
static
<T> Association<T>
getAssociation(T proxy)
          Get the Association for the association proxy
static
<T> T
getFirst(T proxy)
          Get the first associated service proxy
static
<T> T
getService(T proxy)
          Get the associated service proxy from the ServiceSelectionStrategy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssociationProxyUtil

public AssociationProxyUtil()
Method Detail

getService

public static <T> T getService(T proxy)
Get the associated service proxy from the ServiceSelectionStrategy

Parameters:
proxy - The association proxy
Returns:
The service proxy as determined by the ServiceSelectionStrategy that manages the collection of associated services. If there are no services a null will be returned. If the supplied proxy is not an instanceof AssociationProxy (in other words not a generated proxy), this method will return the supplied proxy..

getFirst

public static <T> T getFirst(T proxy)
Get the first associated service proxy

Parameters:
proxy - The association proxy
Returns:
The first service proxy in the collection of associated services. If there are no services a null will be returned. If the supplied proxy is not an instanceof AssociationProxy (in other words not a generated proxy), this method will return the supplied proxy..

getAssociation

public static <T> Association<T> getAssociation(T proxy)
Get the Association for the association proxy

Parameters:
proxy - The association proxy
Returns:
The Association for the association proxy. If the provided proxy is not an instanceof AssociationProxy (in other words not a generated proxy), this method will return null.

Copyright © Rio Project.

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