*
* @param context the deployment unit context
* @throws DeploymentUnitProcessingException
*/
public void processDeployment(DeploymentUnitContext context) throws DeploymentUnitProcessingException {
final JBossServiceXmlDescriptor serviceXmlDescriptor = context.getAttachment(JBossServiceXmlDescriptor.ATTACHMENT_KEY);
if(serviceXmlDescriptor == null)
return;
final Module module = context.getAttachment(ModuleDeploymentProcessor.MODULE_ATTACHMENT_KEY);
if(module == null)
throw new DeploymentUnitProcessingException("Failed to get module attachment for deployment: " + context.getName());
final ClassLoader classLoader = module.getClassLoader();
final Value<ClassLoader> classLoaderValue = Values.immediateValue(classLoader);
final JBossServiceXmlDescriptor.ControllerMode controllerMode = serviceXmlDescriptor.getControllerMode();
final List<JBossServiceConfig> serviceConfigs = serviceXmlDescriptor.getServiceConfigs();
final BatchBuilder batchBuilder = context.getBatchBuilder();
for(final JBossServiceConfig serviceConfig : serviceConfigs) {
addService(batchBuilder, serviceConfig, classLoaderValue);
}
}