// Setup a batch level dependency on deployment service
deploymentSubBatch.addDependency(deploymentServiceName);
// Add a deployment failure listener to the batch
deploymentSubBatch.addListener(new DeploymentFailureListener(deploymentServiceName));
// Create the deployment unit context
final DeploymentUnitContext deploymentUnitContext = new DeploymentUnitContextImpl(deploymentServiceName.getSimpleName(), deploymentSubBatch, serviceBuilder);
attachVirtualFile(deploymentUnitContext, deploymentRoot);
deploymentUnitContext.putAttachment(MountHandle.ATTACHMENT_KEY, handle);