private ModuleDefinition composeStream(String name, ModuleType typeHint, String dslDefinition, boolean force){
		// TODO: pass typeHint to parser (XD-2343)
		List<ModuleDescriptor> parseResult = this.parser.parse(name, dslDefinition, module);

		ModuleType type = this.determineType(parseResult);
		assertModuleUpdatability(name, type, force);

		// TODO: XD-2284 need more than ModuleDefinitions (need to capture passed in options, etc)
		List<ModuleDefinition> composedModuleDefinitions = createComposedModuleDefinitions(parseResult);
		ModuleDefinition moduleDefinition = ModuleDefinitions.composed(name, type, dslDefinition, composedModuleDefinitions);

		Assert.isTrue(this.registry.registerNew(moduleDefinition), moduleDefinition + " could not be saved");
		return moduleDefinition;
	}
A service that knows how to handle registration of new module definitions, be it through composition or
upload of actual 'bytecode'. Handles all bookkeeping (such as existence checking, dependency tracking, <i>etc.</i>)
that is common to all registration scenarios.

<p>Also adds pagination to {@code find*()} methods of {@code ModuleRegistry} after the fact.</p>

@author Eric Bottard
@author Gary Russell
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/module/support/ModuleDefinitionService.java