Index: .classpath =================================================================== --- .classpath (revision 73539) +++ .classpath (working copy) @@ -1,39 +1,36 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: .project =================================================================== --- .project (revision 73539) +++ .project (working copy) @@ -1,13 +1,13 @@ - - jboss-metadata - The common JavaEE metadata classes - - - - org.eclipse.jdt.core.javabuilder - - - - org.eclipse.jdt.core.javanature - + + jboss-metadata + The common JavaEE metadata classes + + + + org.eclipse.jdt.core.javabuilder + + + + org.eclipse.jdt.core.javanature + \ No newline at end of file Index: src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeanMetaData.java =================================================================== --- src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeanMetaData.java (revision 73539) +++ src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeanMetaData.java (working copy) @@ -606,87 +606,99 @@ DefaultJndiBindingPolicy defaultPolicy) { String baseJndiName = getMappedName(); - if(baseJndiName == null) - baseJndiName = determineJndiName(); + if (baseJndiName == null) + baseJndiName = this.getEjbName(); String resolvedJndiName = baseJndiName; - if(getJBossMetaData().getDeploymentSummary() != null) + + // Obtain the Deployment Summary + DeploymentSummary dsummary = getJBossMetaData().getDeploymentSummary(); + + // Initialize the Default JNDI Binding Policy + DefaultJndiBindingPolicy policy = null; + + // If Deployment Summary is defined + if (dsummary != null) { - // Use summary info to create the metadata policy if it exists - DeploymentSummary dsummary = getJBossMetaData().getDeploymentSummary(); - DefaultJndiBindingPolicy policy = null; try { + // Create a JNDI Policy from the Deployment Summary policy = createPolicy(dsummary.getLoader(), null); } - catch(Exception e) + catch (Exception e) { } - if(policy == null) - policy = defaultPolicy; - if(policy == null) - { - // Use the metadata default binding policy - policy = new BasicJndiBindingPolicy(baseJndiName); - } + } + if (policy == null) + policy = defaultPolicy; + if (policy == null) + { + // Use the metadata default binding policy + policy = new BasicJndiBindingPolicy(baseJndiName); + } - // Derive the summary info from this metadata and deployment summary - EjbDeploymentSummary ejbSummary = new EjbDeploymentSummary(this, dsummary); - KnownInterfaceType ifaceType = KnownInterfaces.classifyInterface(iface); - // Need to compare iface against the metadata local-home/home & business locals/remotes - if(this.isSession() && ifaceType == KnownInterfaceType.UNKNOWN) + if(dsummary==null) + { + dsummary = new DeploymentSummary(); + } + + // Derive the summary info from this metadata and deployment summary + EjbDeploymentSummary ejbSummary = new EjbDeploymentSummary(this, dsummary); + KnownInterfaceType ifaceType = KnownInterfaces.classifyInterface(iface); + // Need to compare iface against the metadata local-home/home & business locals/remotes + if (this.isSession() && ifaceType == KnownInterfaceType.UNKNOWN) + { + JBossSessionBeanMetaData sbeanMD = (JBossSessionBeanMetaData) this; + // Figure out the interface type from the metadata + if (sbeanMD.getLocalHome() != null && sbeanMD.getLocalHome().equals(iface)) + ifaceType = KnownInterfaceType.LOCAL_HOME; + else if (sbeanMD.getHome() != null && sbeanMD.getHome().equals(iface)) + ifaceType = KnownInterfaceType.REMOTE_HOME; + else { - JBossSessionBeanMetaData sbeanMD = (JBossSessionBeanMetaData) this; - // Figure out the interface type from the metadata - if(sbeanMD.getLocalHome() != null && sbeanMD.getLocalHome().equals(iface)) - ifaceType = KnownInterfaceType.LOCAL_HOME; - else if(sbeanMD.getHome() != null && sbeanMD.getHome().equals(iface)) - ifaceType = KnownInterfaceType.REMOTE_HOME; - else + // Check business locals + BusinessLocalsMetaData locals = sbeanMD.getBusinessLocals(); + if (locals != null) { - // Check business locals - BusinessLocalsMetaData locals = sbeanMD.getBusinessLocals(); - if(locals != null) + for (String local : locals) { - for(String local : locals) + if (local.equals(iface)) { - if(local.equals(iface)) - { - ifaceType = KnownInterfaceType.BUSINESS_LOCAL; - break; - } + ifaceType = KnownInterfaceType.BUSINESS_LOCAL; + break; } } - if(ifaceType == KnownInterfaceType.UNKNOWN) + } + if (ifaceType == KnownInterfaceType.UNKNOWN) + { + // Check business remotes + BusinessRemotesMetaData remotes = sbeanMD.getBusinessRemotes(); + if (remotes != null) { - // Check business remotes - BusinessRemotesMetaData remotes = sbeanMD.getBusinessRemotes(); - if(remotes != null) + for (String remote : remotes) { - for(String remote : remotes) + if (remote.equals(iface)) { - if(remote.equals(iface)) - { - ifaceType = KnownInterfaceType.BUSINESS_REMOTE; - break; - } + ifaceType = KnownInterfaceType.BUSINESS_REMOTE; + break; } } } } } - else if(this.isEntity() && ifaceType == KnownInterfaceType.UNKNOWN) - { - JBossEntityBeanMetaData ebeanMD = (JBossEntityBeanMetaData) this; - // Figure out the interface type from the metadata - if(ebeanMD.getLocalHome() != null && ebeanMD.getLocalHome().equals(iface)) - ifaceType = KnownInterfaceType.LOCAL_HOME; - else if(ebeanMD.getHome() != null && ebeanMD.getHome().equals(iface)) - ifaceType = KnownInterfaceType.REMOTE_HOME; - } + } + else if (this.isEntity() && ifaceType == KnownInterfaceType.UNKNOWN) + { + JBossEntityBeanMetaData ebeanMD = (JBossEntityBeanMetaData) this; + // Figure out the interface type from the metadata + if (ebeanMD.getLocalHome() != null && ebeanMD.getLocalHome().equals(iface)) + ifaceType = KnownInterfaceType.LOCAL_HOME; + else if (ebeanMD.getHome() != null && ebeanMD.getHome().equals(iface)) + ifaceType = KnownInterfaceType.REMOTE_HOME; + } - // Have the policy generate the actual name - resolvedJndiName = policy.getJndiName(ejbSummary, iface, ifaceType); - } + // Have the policy generate the actual name + resolvedJndiName = policy.getJndiName(ejbSummary, iface, ifaceType); + return resolvedJndiName; } Index: src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/KnownInterfaces.java =================================================================== --- src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/KnownInterfaces.java (revision 73539) +++ src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/KnownInterfaces.java (working copy) @@ -58,7 +58,7 @@ public static final String LOCAL = "local"; public static final String LOCAL_HOME = "localHome"; public static final String REMOTE = "remote"; - public static final String HOME = "remoteHome"; + public static final String HOME = "home"; public static final String UNKNOWN = "unknown"; /** Index: .settings/org.eclipse.jdt.core.prefs =================================================================== --- .settings/org.eclipse.jdt.core.prefs (revision 73539) +++ .settings/org.eclipse.jdt.core.prefs (working copy) @@ -1,8 +1,5 @@ -#Fri Sep 07 10:35:32 CEST 2007 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 +#Sun May 18 02:01:03 EDT 2008 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5