public CreateResourceResponse executeCreateResourceImmediately(CreateResourceRequest request)
throws PluginContainerException {
// Load the actual resource type instance to be passed to the facet
ResourceType resourceType = metadataManager.getType(request.getResourceTypeName(), request.getPluginName());
if (resourceType == null) {
throw new PluginContainerException("Could not retrieve resource type for request: " + request);
}
String creationType = (request.getResourceConfiguration() != null) ? "configuration" : "package";
{
log.debug("Creating " + creationType + "-based resource of type '" + request.getResourceTypeName()
+ "' and with parent with id " + request.getParentResourceId() + "...");
}
// Create the report to send the plugin
CreateResourceReport report = new CreateResourceReport(request.getResourceName(), resourceType, request
.getPluginConfiguration(), request.getResourceConfiguration(), request.getPackageDetails());
// Execute the create against the plugin
CreateChildResourceFacet facet = getCreateChildResourceFacet(request.getParentResourceId(), request
.getTimeout());
CreateResourceRunner runner = new CreateResourceRunner(this, request.getParentResourceId(), facet, request
.getRequestId(), report, configuration.isInsideAgent());
CreateResourceResponse response;
try {
response = (CreateResourceResponse) executor.submit((Callable) runner).get();
} catch (Exception e) {
throw new PluginContainerException("Error during create resource callable", e);
}
return response;
}