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();
}