private ResourceSupport enhanceWithDeployment(D definition, R resource) {
		@SuppressWarnings("unchecked")
		AbstractInstancePersistingDeployer<D, BaseInstance<D>> ipDeployer = (AbstractInstancePersistingDeployer<D, BaseInstance<D>>) deployer;
		BaseInstance<D> deployedInstance = ipDeployer.deploymentInfo(definition.getName());
		String status = (deployedInstance != null) ? deployedInstance.getStatus().getState().toString()
				: DeploymentUnitStatus.State.undeployed.toString();
		((DeployableResource) resource).setStatus(status);
		return resource;
	}
Create a new resource definition.

@param name The name of the entity to create (required)
@param definition The entity definition, expressed in the XD DSL (required)
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/rest/XDController.java