{
scope = parent.getAttachment(DeploymentScope.class);
if (scope == null)
{
scope = new JBoss5DeploymentScope(unit.getParent());
parent.addAttachment(DeploymentScope.class, scope);
}
}
JBoss5DeploymentUnit du = new JBoss5DeploymentUnit(unit);
du.setDefaultPersistenceProperties(defaultPersistenceProperties);
Ejb3JBoss5Deployment deployment = new Ejb3JBoss5Deployment(du, kernel, mbeanServer, unit, scope, metaData, persistenceUnitsMetaData,