//Validate that there is indeed a resource with the specified name.
final String type = getApplicationType(referenceName);
final Target target = TargetBuilder.INSTANCE.createTarget(
validTypes, targetName, configContext);
if (target.getType() == TargetType.CLUSTER) {
final Cluster cluster = ClusterHelper.getClusterByName(configContext, target.getName());
addApplicationReferenceToCluster(cluster, enabled, virtualServers, referenceName);
final Server[] servers = ServerHelper.getServersInCluster(configContext, target.getName());
addApplicationReferenceToClusteredServers(cluster, servers, enabled,
virtualServers, referenceName);
} else if (target.getType() == TargetType.SERVER ||