}
log.debug("********* " + this.getClass().getSimpleName() + " Begin Unit: " + unit.getSimpleName() + " jar: "
+ jar.getName());
JBoss5DeploymentScope scope = null;
VFSDeploymentUnit parent = unit.getTopLevel();
boolean initScopeDeployment = false;
if (parent != null)
{
// Check for an existing scope
scope = (JBoss5DeploymentScope) parent.getAttachment(DeploymentScope.class);
if (scope == null)
{
// Check for a scoped deployment or an ear top-level unit
boolean isEar = unit != unit.getTopLevel() || parent.isAttachmentPresent(JBossAppMetaData.class);
if(parent.isAttachmentPresent(DeploymentEndpointResolver.class) == true)
scope = new JBoss5DeploymentScope(parent, isEar);
else
{
// EJBTHREE-1291
scope = new JBoss5DeploymentScope(parent, isEar, unit.getSimpleName());
initScopeDeployment = true;
}
parent.addAttachment(DeploymentScope.class, scope);
}
}
JBoss5DeploymentUnit du = new JBoss5DeploymentUnit(unit);
Ejb3JBoss5Deployment deployment = new Ejb3JBoss5Deployment(du, kernel, mbeanServer, unit, scope, metaData);