org.jboss.ejb3.common.resolvers.plugins
Class FirstMatchEjbReferenceResolver

java.lang.Object
  extended by org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolverBase
      extended by org.jboss.ejb3.common.resolvers.plugins.FirstMatchEjbReferenceResolver
All Implemented Interfaces:
EjbReferenceResolver

public class FirstMatchEjbReferenceResolver
extends EjbReferenceResolverBase
implements EjbReferenceResolver

FirstMatchEjbReferenceResolver An EJB Reference resolver which will return the first match found. In cases where the reference may be non-deterministic this implementation will stop when the reference requirements are satisfied NonDeterministicInterfaceException is therefore avoided when a common interface is used across DeploymentUnits in the same DU Hierarchy; very simply the first DU which is able to resolve the reference (without conflicting with possible references to other EJBs within that DU) will be used.

Version:
$Revision: $
Author:
ALR

Field Summary
 
Fields inherited from class org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolverBase
DU_ATTACHMENT_NAME_METADATA
 
Constructor Summary
FirstMatchEjbReferenceResolver()
           
 
Method Summary
 String resolveEjb(org.jboss.deployers.structure.spi.DeploymentUnit du, EjbReference reference)
          Returns the JNDI Name of the proxy described by the specified arguments.
protected  String resolveEjbFromRoot(org.jboss.deployers.structure.spi.DeploymentUnit rootDu, EjbReference reference)
          Follows a preorder traversal scheme to resolve the specified reference from the specified metadata (or its children).
 
Methods inherited from class org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolverBase
getJndiName, getMatch, getMetaData, getRoot, isMatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FirstMatchEjbReferenceResolver

public FirstMatchEjbReferenceResolver()
Method Detail

resolveEjb

public String resolveEjb(org.jboss.deployers.structure.spi.DeploymentUnit du,
                         EjbReference reference)
Description copied from interface: EjbReferenceResolver
Returns the JNDI Name of the proxy described by the specified arguments.

Specified by:
resolveEjb in interface EjbReferenceResolver
Parameters:
du - The DeploymentUnit in question
reference - The EJB reference used
Returns:

resolveEjbFromRoot

protected String resolveEjbFromRoot(org.jboss.deployers.structure.spi.DeploymentUnit rootDu,
                                    EjbReference reference)
Follows a preorder traversal scheme to resolve the specified reference from the specified metadata (or its children). Returns the resolved target JNDI name.

Parameters:
rootDu -
reference -
Returns:


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.