} else {
// Using Embedded extension model - the defined type is actually a copy of another plugin's service or server type.
LOG.debug("Parsing embedded service type {" + pluginDescriptor.getName() + "}"
+ serviceDescriptor.getName() + ", which extends type {" + sourcePlugin + "}" + sourceType + "...");
ResourceDescriptor sourceTypeDescriptor;
if (sourceType.isEmpty()) {
sourceTypeDescriptor = serviceDescriptor;
} else {
Map<String, ServiceDescriptor> pluginServiceDescriptors = getPluginServiceDescriptors(sourcePlugin);
sourceTypeDescriptor = pluginServiceDescriptors.get(sourceType);
if (sourceTypeDescriptor == null) {
Map<String, ServerDescriptor> pluginServerDescriptors = getPluginServerDescriptors(sourcePlugin);
sourceTypeDescriptor = pluginServerDescriptors.get(sourceType);
}
}
if (sourceTypeDescriptor == null) {
LOG.warn("There is no service or server type named [" + sourceType + "] from a plugin named ["
+ sourcePlugin + "]. This is probably because that plugin is missing. Resource Type [{"
+ pluginDescriptor.getName() + "}" + serviceDescriptor.getName() + "] will be ignored.");
return null;
}
serviceResourceType = new ResourceType(serviceDescriptor.getName(), pluginDescriptor.getName(),
ResourceCategory.SERVICE, parentType);
// Let the plugin writer override these, or if not, parseResourceDescriptor() will pick up the source type's
// values.
serviceResourceType.setDescription(serviceDescriptor.getDescription());
serviceResourceType.setSubCategory(serviceDescriptor.getSubCategory());
serviceResourceType.setCreationDataType(convertCreationDataType(serviceDescriptor.getCreationDataType()));
serviceResourceType.setCreateDeletePolicy(convertCreateDeletePolicy(serviceDescriptor
.getCreateDeletePolicy()));
serviceResourceType.setSingleton(serviceDescriptor.isSingleton());
serviceResourceType.setSupportsMissingAvailabilityType(serviceDescriptor
.isSupportsMissingAvailabilityType());
String discoveryClass;
if (serviceDescriptor.getDiscovery() != null) {
discoveryClass = getFullyQualifiedComponentClassName(getPluginPackage(sourcePlugin), serviceDescriptor
.getDiscovery());
} else {
discoveryClass = getFullyQualifiedComponentClassName(getPluginPackage(sourcePlugin),
sourceTypeDescriptor.getDiscovery());
}
String componentClass;
if (serviceDescriptor.getClazz() != null) {
componentClass = getFullyQualifiedComponentClassName(getPluginPackage(sourcePlugin), serviceDescriptor
.getClazz());
} else {
componentClass = getFullyQualifiedComponentClassName(getPluginPackage(sourcePlugin),
sourceTypeDescriptor.getClazz());
}
parseResourceDescriptor(sourceTypeDescriptor, serviceResourceType, discoveryClass, componentClass,
sourcePlugin);
}