{
// Create the application profile
String applicationProfileName = super.createApplicationProfile(applicationsSubProfiles);
// Create the farm profile
ProfileMetaData farm = null;
if (getFarmURIs() != null)
{
ProfileKey farmKey = new ProfileKey(FARM_NAME);
URI[] farmURIs = getFarmURIs().toArray(new URI[getFarmURIs().size()]);
String[] farmSubProfiles = new String[] { applicationProfileName };
farm = createClusteredProfileMetaData(
FARM_NAME, true, farmURIs, farmSubProfiles);
addProfile(farmKey, farm);
}
// Create the hasingleton profile
if (getHASingletonURIs() != null)
{
ProfileKey hasingletonKey = new ProfileKey(HASINGLETON_NAME);
URI[] hasingletonURIs = getHASingletonURIs().toArray(new URI[getHASingletonURIs().size()]);
// Note HASingleton can't depend on others or it will get undeployed
// prematurely
String[] hasingletonSubProfiles = new String[0];
ProfileMetaData hasingletons = createProfileMetaData(
HASINGLETON_NAME, true, hasingletonURIs, hasingletonSubProfiles);
addProfile(hasingletonKey, hasingletons);
}
// Return the dependencies for the root profile
return farm == null ? new String[] { applicationProfileName } : new String[] { FARM_NAME };