Methods Summary |
---|
public org.jboss.ejb3.EJBContainer | getEjbContainer(java.lang.String ejbLink, java.lang.Class businessIntf)
int hashIndex = ejbLink.indexOf('#");
if (hashIndex != -1)
{
if (deploymentScope == null)
{
log.warn("ejb link '" + ejbLink + "' is relative, but no deployment scope found");
return null;
}
String relativePath = ejbLink.substring(0, hashIndex);
Ejb3Deployment dep = deploymentScope.findRelativeDeployment(relativePath);
if (dep == null)
{
log.warn("can't find a deployment for path '" + relativePath + "' of ejb link '" + ejbLink + "'");
return null;
}
String ejbName = ejbLink.substring(hashIndex + 1);
return dep.getEjbContainer(ejbName, businessIntf);
}
// look internally
EJBContainer ejb = searchDeploymentInternally(ejbLink, businessIntf);
if (ejb != null) return ejb;
for (Object obj : Ejb3Registry.getContainers())
{
EJBContainer container = (EJBContainer) obj;
if (container.getEjbName().equals(ejbLink))
{
return container;
}
}
return null;
|
public org.jboss.ejb3.EJBContainer | getEjbContainer(org.jboss.ejb3.Ejb3Deployment deployment, java.lang.Class businessIntf)
EJBContainer container = null;
// search in myself
for (Object obj : deployment.getEjbContainers().values())
{
EJBContainer newContainer = (EJBContainer) obj;
if (container == newContainer) continue;
if (ProxyFactoryHelper.publishesInterface(newContainer, businessIntf))
{
if (container != null) throw new NameNotFoundException("duplicated in " + errorName);
container = newContainer;
}
}
return container;
|
public org.jboss.ejb3.EJBContainer | getEjbContainer(java.lang.Class businessIntf)
EJBContainer rtnContainer = null;
// search in deployment first
rtnContainer = searchForEjbContainerInternally(businessIntf);
if (rtnContainer != null) return rtnContainer;
// search in EAR
String jarName = null;
if (deploymentScope != null)
{
for (Ejb3Deployment deployment : deploymentScope.getEjbDeployments())
{
EJBContainer newContainer = getEjbContainer(deployment, businessIntf);
if (rtnContainer == newContainer) continue; // don't check self
if (rtnContainer != null && newContainer != null)
{
throw new NameNotFoundException("duplicated in .ear within " + jarName +
" and " + deployment.getDeploymentUnit().getShortName());
}
if (newContainer != null)
{
rtnContainer = newContainer;
jarName = deployment.getDeploymentUnit().getShortName();
}
}
}
if (rtnContainer != null)
{
return rtnContainer;
}
// search everywhere
Iterator containers = Ejb3Registry.getContainers().iterator();
while (containers.hasNext())
{
Container container = (Container)containers.next();
EJBContainer ejbContainer = (EJBContainer) container;
if (ejbContainer == rtnContainer) continue;
if (ProxyFactoryHelper.publishesInterface(container, businessIntf))
{
if (rtnContainer != null)
{
throw new NameNotFoundException("duplicated in " + ejbContainer.getDeployment().getDeploymentUnit().getShortName()
+ " and " + jarName);
}
rtnContainer = ejbContainer;
jarName = ejbContainer.getDeployment().getDeploymentUnit().getShortName();
}
}
if (rtnContainer != null) return rtnContainer;
throw new NameNotFoundException("not used by any EJBs");
|
public java.lang.String | getEjbJndiName(java.lang.String ejbLink, java.lang.Class businessIntf)
EJBContainer container = getEjbContainer(ejbLink, businessIntf);
if (container == null)
{
return null;
}
return ProxyFactoryHelper.getJndiName(container, businessIntf);
|
public java.lang.String | getEjbJndiName(java.lang.Class businessIntf)
EJBContainer container = getEjbContainer(businessIntf);
String jndiName = ProxyFactoryHelper.getJndiName(container, businessIntf);
if (jndiName == null) throw new NameNotFoundException("not used by any EJBs");
return jndiName;
|
protected abstract org.jboss.ejb3.EJBContainer | searchDeploymentInternally(java.lang.String ejbLink, java.lang.Class businessIntf)
|
protected abstract org.jboss.ejb3.EJBContainer | searchForEjbContainerInternally(java.lang.Class businessIntf)
|