/** * Create and return a {@link FlowDefinitionRegistry} instance. */ public FlowDefinitionRegistry build() { DefaultFlowRegistry flowRegistry = new DefaultFlowRegistry(); flowRegistry.setParent(this.parent); registerFlowLocations(flowRegistry); registerFlowLocationPatterns(flowRegistry); registerFlowBuilders(flowRegistry); return flowRegistry; }
public void destroy() { flowRegistry.destroy(); }
public void setParent(FlowDefinitionRegistry parent) { super.setParent(parent); if (parent instanceof DefaultFlowRegistry) { DefaultFlowRegistry parentFlowRegistry = (DefaultFlowRegistry) parent; // link so a flow in the child registry that extends from a flow in the parent registry can find its parent flowModelRegistry.setParent(parentFlowRegistry.getFlowModelRegistry()); } } }
private void registerFlow(FlowDefinitionResource resource, DefaultFlowRegistry flowRegistry) { FlowModelBuilder flowModelBuilder; if (resource.getPath().getFilename().endsWith(".xml")) { flowModelBuilder = new XmlFlowModelBuilder(resource.getPath(), flowRegistry.getFlowModelRegistry()); } else { throw new IllegalArgumentException(resource + " is not a supported resource type; supported types are [.xml]"); } FlowModelHolder flowModelHolder = new DefaultFlowModelHolder(flowModelBuilder); FlowBuilder flowBuilder = new FlowModelFlowBuilder(flowModelHolder); FlowBuilderContext builderContext = new FlowBuilderContextImpl( resource.getId(), resource.getAttributes(), flowRegistry, this.flowBuilderServices); FlowAssembler assembler = new FlowAssembler(flowBuilder, builderContext); DefaultFlowHolder flowHolder = new DefaultFlowHolder(assembler); flowRegistry.getFlowModelRegistry().registerFlowModel(resource.getId(), flowModelHolder); flowRegistry.registerFlowDefinition(flowHolder); }
private void registerFlowBuilders() { if (flowBuilders != null) { for (FlowBuilderInfo builderInfo : flowBuilders) { flowRegistry.registerFlowDefinition(buildFlowDefinition(builderInfo)); } } }
private void registerFlowLocations() { if (flowLocations != null) { for (FlowLocation location : flowLocations) { flowRegistry.registerFlowDefinition(createFlowDefinitionHolder(createResource(location))); } } }
private void registerFlow(FlowDefinitionResource resource, DefaultFlowRegistry flowRegistry) { FlowModelBuilder flowModelBuilder; if (resource.getPath().getFilename().endsWith(".xml")) { flowModelBuilder = new XmlFlowModelBuilder(resource.getPath(), flowRegistry.getFlowModelRegistry()); } else { throw new IllegalArgumentException(resource + " is not a supported resource type; supported types are [.xml]"); } FlowModelHolder flowModelHolder = new DefaultFlowModelHolder(flowModelBuilder); FlowBuilder flowBuilder = new FlowModelFlowBuilder(flowModelHolder); FlowBuilderContext builderContext = new FlowBuilderContextImpl( resource.getId(), resource.getAttributes(), flowRegistry, this.flowBuilderServices); FlowAssembler assembler = new FlowAssembler(flowBuilder, builderContext); DefaultFlowHolder flowHolder = new DefaultFlowHolder(assembler); flowRegistry.getFlowModelRegistry().registerFlowModel(resource.getId(), flowModelHolder); flowRegistry.registerFlowDefinition(flowHolder); }
public void afterPropertiesSet() { flowResourceFactory = new FlowDefinitionResourceFactory(flowBuilderServices.getApplicationContext()); if (basePath != null) { flowResourceFactory.setBasePath(basePath); } flowRegistry = new DefaultFlowRegistry(); flowRegistry.setParent(parent); registerFlowLocations(); registerFlowLocationPatterns(); registerFlowBuilders(); }
private void registerFlowLocationPatterns() { if (flowLocationPatterns != null) { for (String pattern : flowLocationPatterns) { FlowDefinitionResource[] resources; AttributeMap<Object> attributes = getFlowAttributes(Collections.emptySet()); try { resources = flowResourceFactory.createResources(pattern, attributes); } catch (IOException e) { IllegalStateException ise = new IllegalStateException( "An I/O Exception occurred resolving the flow location pattern '" + pattern + "'"); ise.initCause(e); throw ise; } for (FlowDefinitionResource resource : resources) { flowRegistry.registerFlowDefinition(createFlowDefinitionHolder(resource)); } } } }
private FlowModelBuilder createFlowModelBuilder(FlowDefinitionResource resource) { if (isXml(resource.getPath())) { return new XmlFlowModelBuilder(resource.getPath(), flowRegistry.getFlowModelRegistry()); } else { throw new IllegalArgumentException(resource + " is not a supported resource type; supported types are [.xml]"); } }
public void destroy() { flowRegistry.destroy(); }
/** * Create and return a {@link FlowDefinitionRegistry} instance. */ public FlowDefinitionRegistry build() { DefaultFlowRegistry flowRegistry = new DefaultFlowRegistry(); flowRegistry.setParent(this.parent); registerFlowLocations(flowRegistry); registerFlowLocationPatterns(flowRegistry); registerFlowBuilders(flowRegistry); return flowRegistry; }
private void registerFlowBuilders(DefaultFlowRegistry flowRegistry) { for (FlowBuilderInfo info : this.flowBuilderInfos) { AttributeMap<Object> attributes = info.getAttributes(); updateFlowAttributes(attributes); FlowBuilderContext builderContext = new FlowBuilderContextImpl( info.getId(), attributes, flowRegistry, this.flowBuilderServices); FlowAssembler assembler = new FlowAssembler(info.getBuilder(), builderContext); flowRegistry.registerFlowDefinition(assembler.assembleFlow()); } }
private FlowModelHolder createFlowModelHolder(FlowDefinitionResource resource) { FlowModelHolder modelHolder = new DefaultFlowModelHolder(createFlowModelBuilder(resource)); // register the flow model holder with the backing flow model registry - this is needed to support flow model // merging during the flow build process flowRegistry.getFlowModelRegistry().registerFlowModel(resource.getId(), modelHolder); return modelHolder; }
public void destroy() throws Exception { flowRegistry.destroy(); }
public void afterPropertiesSet() { flowResourceFactory = new FlowDefinitionResourceFactory(flowBuilderServices.getApplicationContext()); if (basePath != null) { flowResourceFactory.setBasePath(basePath); } flowRegistry = new DefaultFlowRegistry(); flowRegistry.setParent(parent); registerFlowLocations(); registerFlowLocationPatterns(); registerFlowBuilders(); }
private void registerFlowBuilders() { if (flowBuilders != null) { for (int i = 0; i < flowBuilders.length; i++) { FlowBuilderInfo builderInfo = flowBuilders[i]; flowRegistry.registerFlowDefinition(buildFlowDefinition(builderInfo)); } } }
public void setParent(FlowDefinitionRegistry parent) { super.setParent(parent); if (parent instanceof DefaultFlowRegistry) { DefaultFlowRegistry parentFlowRegistry = (DefaultFlowRegistry) parent; // link so a flow in the child registry that extends from a flow in the parent registry can find its parent flowModelRegistry.setParent(parentFlowRegistry.getFlowModelRegistry()); } } }
public void afterPropertiesSet() throws Exception { flowResourceFactory = new FlowDefinitionResourceFactory(flowBuilderServices.getApplicationContext()); if (basePath != null) { flowResourceFactory.setBasePath(basePath); } flowRegistry = new DefaultFlowRegistry(); flowRegistry.setParent(parent); registerFlowLocations(); registerFlowLocationPatterns(); registerFlowBuilders(); }
private void registerFlowBuilders() { if (flowBuilders != null) { for (FlowBuilderInfo builderInfo : flowBuilders) { flowRegistry.registerFlowDefinition(buildFlowDefinition(builderInfo)); } } }