appContext.setApplicationName(parameters.getApplicationName());
// Setup the container for the application master.
ContainerLaunchParameters appMasterParams = parameters.getApplicationMasterParameters(applicationId);
ContainerLaunchContext clc = clcFactory.create(appMasterParams);
appContext.setResource(clcFactory.createResource(appMasterParams));
appContext.setAMContainerSpec(clc);
appContext.setQueue(parameters.getQueue());
appContext.setPriority(clcFactory.createPriority(appMasterParams.getPriority()));
submitApplication(appContext);