log.debug("Duplicate root ejb-name: "+ejbNameKey+" from: "+ejbCompID);
}
// Create mappings based on the bean business interfaces
if(bean instanceof JBossSessionBeanMetaData)
{
JBossSessionBeanMetaData sbean = (JBossSessionBeanMetaData) bean;
String ejbName = sbean.getEjbName();
SessionBeanJNDINameResolver sessionbeanJNDINameResolver = JNDIPolicyBasedJNDINameResolverFactory.getJNDINameResolver(sbean, this.defaultJNDIBindingPolicy);
// home
if(sbean.getHome() != null && sbean.getHome().length() > 0)
{
String remoteHomeJNDIName = sessionbeanJNDINameResolver.resolveRemoteHomeJNDIName(sbean);
cdmd.addJndiName(remoteHomeJNDIName);
// Add ejb/vfsPath@iface
String home = sbean.getHome();
String ifacePath = prefix + "@" + home;
if(endpointAlternateMap.containsKey(ifacePath))
log.debug(ejbName+" duplicates home: "+home+", existing: "+endpointAlternateMap.get(ifacePath));
else
{
endpointAlternateMap.put(ifacePath, ejbCompID);
mappings.add(ifacePath);
if(trace)
log.trace("mapEjbs, local-home: "+ifacePath+", ejbName: "+ejbName);
}
// Add ejb/iface
ifacePath = "ejb@" + home;
if(endpointMap.containsKey(ifacePath))
{
// TODO: may need to track the duplicates to create an error
log.debug(ejbName+" duplicates home: "+home+", existing: "+endpointMap.get(ifacePath));
}
else
{
endpointAlternateMap.put(ifacePath, ejbCompID);
mappings.add(ifacePath);
if(trace)
log.trace("mapEjbs, home: "+ifacePath+", ejbName: "+ejbName);
}
}
// remote
if(sbean.getRemote() != null && sbean.getRemote().length() > 0)
{
// Add ejb/vfsPath@iface
String remote = sbean.getRemote();
String remoteJndiName = sessionbeanJNDINameResolver.resolveJNDIName(sbean, remote);
cdmd.addJndiName(remoteJndiName);
String ifacePath = prefix + "@" + remote;
if(endpointAlternateMap.containsKey(ifacePath))
log.debug(ejbName+" duplicates remote: "+remote+", existing: "+endpointAlternateMap.get(ifacePath));
else
{
endpointAlternateMap.put(ifacePath, ejbCompID);
mappings.add(ifacePath);
if(trace)
log.trace("mapEjbs, remote: "+ifacePath+", ejbName: "+ejbName);
}
// Add ejb/iface
ifacePath = "ejb@" + remote;
if(endpointMap.containsKey(ifacePath))
{
// TODO: may need to track the duplicates to create an error
log.debug(ejbName+" duplicates remote: "+remote+", existing: "+endpointMap.get(ifacePath));
}
else
{
endpointAlternateMap.put(ifacePath, ejbCompID);
mappings.add(ifacePath);
if(trace)
log.trace("mapEjbs, local: "+ifacePath+", ejbName: "+ejbName);
}
}
// local-home
if(sbean.getLocalHome() != null && sbean.getLocalHome().length() > 0)
{
String localHomeJNDIName = sessionbeanJNDINameResolver.resolveLocalHomeJNDIName(sbean);
cdmd.addJndiName(localHomeJNDIName);
// Add ejb/vfsPath@iface
String local = sbean.getLocalHome();
String ifacePath = prefix + "@" + local;
if(endpointAlternateMap.containsKey(ifacePath))
log.debug(ejbName+" duplicates local-home: "+local+", existing: "+endpointAlternateMap.get(ifacePath));
else
{
endpointAlternateMap.put(ifacePath, ejbCompID);
mappings.add(ifacePath);
if(trace)
log.trace("mapEjbs, local-home: "+ifacePath+", ejbName: "+ejbName);
}
// Add ejb/iface
ifacePath = "ejb@" + local;
if(endpointMap.containsKey(ifacePath))
{
// TODO: may need to track the duplicates to create an error
log.debug(ejbName+" duplicates local-home: "+local+", existing: "+endpointMap.get(ifacePath));
}
else
{
endpointAlternateMap.put(ifacePath, ejbCompID);
mappings.add(ifacePath);
if(trace)
log.trace("mapEjbs, local-home: "+ifacePath+", ejbName: "+ejbName);
}
}
// local
if(sbean.getLocal() != null && sbean.getLocal().length() > 0)
{
// Add ejb/vfsPath@iface
String local = sbean.getLocal();
String localJndiName = sessionbeanJNDINameResolver.resolveJNDIName(sbean, local);
cdmd.addJndiName(localJndiName);
String ifacePath = prefix + "@" + local;
if(endpointAlternateMap.containsKey(ifacePath))
log.debug(ejbName+" duplicates local: "+local+", existing: "+endpointAlternateMap.get(ifacePath));
else
{
endpointAlternateMap.put(ifacePath, ejbCompID);
mappings.add(ifacePath);
if(trace)
log.trace("mapEjbs, local: "+ifacePath+", ejbName: "+ejbName);
}
// Add ejb/iface
ifacePath = "ejb@" + local;
if(endpointMap.containsKey(ifacePath))
{
// TODO: may need to track the duplicates to create an error
log.debug(ejbName+" duplicates local: "+local+", existing: "+endpointMap.get(ifacePath));
}
else
{
endpointAlternateMap.put(ifacePath, ejbCompID);
mappings.add(ifacePath);
if(trace)
log.trace("mapEjbs, local: "+ifacePath+", ejbName: "+ejbName);
}
}
BusinessLocalsMetaData locals = sbean.getBusinessLocals();
if(locals != null && locals.size() > 0)
{
String defaultLocalBusinessJNDIName = sessionbeanJNDINameResolver.resolveLocalBusinessDefaultJNDIName(sbean);
cdmd.addJndiName(defaultLocalBusinessJNDIName);
for(String local : locals)
{
// Add a targeted jndi name
String localBusinessJNDIName = sessionbeanJNDINameResolver.resolveJNDIName(sbean, local);
cdmd.addJndiName(localBusinessJNDIName);
// Add ejb/vfsPath@iface
String ifacePath = prefix + "@" + local;
if(endpointAlternateMap.containsKey(ifacePath))
log.debug(ejbName+" duplicates business local: "+local+", existing: "+endpointAlternateMap.get(ifacePath));
else
{
endpointAlternateMap.put(ifacePath, ejbCompID);
mappings.add(ifacePath);
if(trace)
log.trace("mapEjbs, business-local: "+ifacePath+", ejbName: "+ejbName);
}
// Add ejb/iface
ifacePath = "ejb@" + local;
if(endpointMap.containsKey(ifacePath))
{
// TODO: may need to track the duplicates to create an error
log.debug(ejbName+" duplicates business-local: "+local+", existing: "+endpointMap.get(ifacePath));
}
else
{
endpointAlternateMap.put(ifacePath, ejbCompID);
mappings.add(ifacePath);
if(trace)
log.trace("mapEjbs, business-local: "+ifacePath+", ejbName: "+ejbName);
}
}
}
BusinessRemotesMetaData remotes = sbean.getBusinessRemotes();
if(remotes != null && remotes.size() > 0)
{
String defaultRemoteBusinessJNDIName = sessionbeanJNDINameResolver.resolveRemoteBusinessDefaultJNDIName(sbean);
cdmd.addJndiName(defaultRemoteBusinessJNDIName);
for(String remote : remotes)
{
// Add a targeted jndi name
String remoteBusinessJNDIName = sessionbeanJNDINameResolver.resolveJNDIName(sbean, remote);
cdmd.addJndiName(remoteBusinessJNDIName);
// Add ejb/vfsPath/iface
String ifacePath = prefix + "@" + remote;
if(endpointAlternateMap.containsKey(ifacePath))
log.debug(ejbName+" duplicates business remote: "+remote+", existing: "+endpointAlternateMap.get(ifacePath));
else
{
endpointAlternateMap.put(ifacePath, ejbCompID);
mappings.add(ifacePath);
if(trace)
log.trace("mapEjbs, business-remote: "+ifacePath+", ejbName: "+ejbName);
}
// Add ejb/iface
ifacePath = "ejb@" + remote;
if(endpointMap.containsKey(ifacePath))
log.debug(ejbName+" duplicates business-remote: "+remote+", existing: "+endpointMap.get(ifacePath));
else
{
endpointAlternateMap.put(ifacePath, ejbCompID);
mappings.add(ifacePath);
if(trace)
log.trace("mapEjbs, business-remote: "+ifacePath+", ejbName: "+ejbName);
}
}
}
// Map no-interface view of EJB3.1 bean
if (sbean.getJBossMetaData().isEJB31() && sbean instanceof JBossSessionBean31MetaData)
{
JBossSessionBean31MetaData sessionBean31 = (JBossSessionBean31MetaData) sbean;
if (sessionBean31.isNoInterfaceBean())
{
// TODO: The rest of the stuff is way too ugly, but that's what is being