}
abstractAppmaster.setConfiguration(configuration);
abstractAppmaster.setResourceLocalizer(resourceLocalizer);
if (appmaster instanceof AbstractServicesAppmaster) {
AbstractServicesAppmaster abstractServicesAppmaster = (AbstractServicesAppmaster)appmaster;
DefaultContainerLauncher launcher = new DefaultContainerLauncher();
launcher.setConfiguration(configuration);
launcher.setEnvironment(environment);
launcher.setResourceLocalizer(resourceLocalizer);
abstractServicesAppmaster.setLauncher(postProcess(launcher));
if (containerAllocator == null) {
containerAllocator = new DefaultContainerAllocator();
}
if (containerAllocator instanceof AbstractAllocator) {
((AbstractAllocator)containerAllocator).setConfiguration(configuration);
((AbstractAllocator)containerAllocator).setEnvironment(environment);
}
abstractServicesAppmaster.setAllocator(postProcess(containerAllocator));
abstractServicesAppmaster.setMonitor(postProcess(new DefaultContainerMonitor()));
}
}
return appmaster;
}