org.objectweb.easybeans.deployment.resolver
Class JNDIResolver

java.lang.Object
  extended by org.objectweb.easybeans.deployment.resolver.JNDIResolver

public class JNDIResolver
extends java.lang.Object

Classes used to resolve JNDI Name for a given deployment.

Author:
Florent Benoit

Field Summary
private  java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> beans
          Map with key = bean name, value = <interface name, jndi name>.
private  java.util.Map<java.lang.String,java.lang.String> interfaces
          Map with key = interface name, value = jndi name.
private  JLog logger
          Logger.
static java.lang.String NAME
          Name.
 
Constructor Summary
JNDIResolver()
          Constructor.
JNDIResolver(Deployment deployment)
          Build a new resolver with the given deployment.
 
Method Summary
 void addDeployment(Deployment deployment)
          Add a given deployment object to this resolver.
 void addEjbJarAnnotationMetadata(EjbJarAnnotationMetadata ejbJarAnnotationMetadata)
          Adds the given metadata to the resolver.
private  void addInterface(java.lang.String itf, java.lang.String beanClassName, java.lang.String mode, java.lang.String mappedName, java.lang.String beanName)
          Add the jndi name for a given interface and a given bean name (may be null).
 java.lang.String getJndiNameInterface(java.lang.String itf, java.lang.String beanName)
          Gets jndi name for a given interface and a bean name.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

private JLog logger
Logger.


NAME

public static final java.lang.String NAME
Name.

See Also:
Constant Field Values

interfaces

private java.util.Map<java.lang.String,java.lang.String> interfaces
Map with key = interface name, value = jndi name.


beans

private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> beans
Map with key = bean name, value = <interface name, jndi name>.

Constructor Detail

JNDIResolver

public JNDIResolver()
Constructor.


JNDIResolver

public JNDIResolver(Deployment deployment)
Build a new resolver with the given deployment.

Parameters:
deployment - given deployment object to use.
Method Detail

addDeployment

public void addDeployment(Deployment deployment)
Add a given deployment object to this resolver.

Parameters:
deployment - to add to the resolver.

addEjbJarAnnotationMetadata

public void addEjbJarAnnotationMetadata(EjbJarAnnotationMetadata ejbJarAnnotationMetadata)
Adds the given metadata to the resolver.

Parameters:
ejbJarAnnotationMetadata - the metadata for a given jar file

addInterface

private void addInterface(java.lang.String itf,
                          java.lang.String beanClassName,
                          java.lang.String mode,
                          java.lang.String mappedName,
                          java.lang.String beanName)
Add the jndi name for a given interface and a given bean name (may be null).

Parameters:
itf - the interface of the bean
beanClassName - the class of the bean
mode - local/remote
mappedName - the mappedName (could be used as JNDI name)
beanName - the name of the bean

getJndiNameInterface

public java.lang.String getJndiNameInterface(java.lang.String itf,
                                             java.lang.String beanName)
Gets jndi name for a given interface and a bean name.

Parameters:
itf - the name of the interface.
beanName - the name of the bean.
Returns:
the jndi name or null if not found.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
string representation of this object