ScannerOutput<M> scannerOutput = scanner.scan(input); if (scannerOutput != null) { List<M> scanned_list = scannerOutput.getModels(); if (scanned_list != null) { for (M scanned : scanned_list) { config.setAttribute(XMLNS_ATTRIBUTE, xmlns); return new ScannerOutput<M>().setModel(merged);
M model = merge_scanner.scan(scanner_input).getModel(); if (_outputFile == null) { File od = new File(_project_build_outputDirectory, SWITCHYARD_XML_DEFAULT_FOLDER);
/** * Sets the first (and possibly only) Model found/created by the scan. * @param model the Model * @return this ScannerOutput (useful for chaining) */ public synchronized ScannerOutput<M> setModel(M model) { return setModels(Collections.singletonList(model)); }
/** * {@inheritDoc} */ @Override public ScannerOutput<SwitchYardModel> scan(ScannerInput<SwitchYardModel> input) throws IOException { SwitchYardNamespace switchyardNamespace = input.getSwitchyardNamespace(); SwitchYardModel switchyardModel = new V1SwitchYardModel(switchyardNamespace.uri()); CompositeModel compositeModel = new V1CompositeModel(); compositeModel.setName(input.getCompositeName()); ClasspathScanner bpmScanner = new ClasspathScanner(_bpmFilter); for (URL url : input.getURLs()) { bpmScanner.scan(url); } List<Class<?>> bpmClasses = _bpmFilter.getMatchedTypes(); for (Class<?> bpmClass : bpmClasses) { compositeModel.addComponent(scan(bpmClass, switchyardNamespace)); } if (!compositeModel.getModelChildren().isEmpty()) { switchyardModel.setComposite(compositeModel); } return new ScannerOutput<SwitchYardModel>().setModel(switchyardModel); }
/** * {@inheritDoc} */ @Override public ScannerOutput<SwitchYardModel> scan(ScannerInput<SwitchYardModel> input) throws IOException { SwitchYardNamespace switchyardNamespace = input.getSwitchyardNamespace(); SwitchYardModel switchyardModel = new V1SwitchYardModel(switchyardNamespace.uri()); CompositeModel compositeModel = new V1CompositeModel(); compositeModel.setName(input.getCompositeName()); ClasspathScanner bpmScanner = new ClasspathScanner(_bpmFilter); for (URL url : input.getURLs()) { bpmScanner.scan(url); } List<Class<?>> bpmClasses = _bpmFilter.getMatchedTypes(); for (Class<?> bpmClass : bpmClasses) { compositeModel.addComponent(scan(bpmClass, switchyardNamespace)); } if (!compositeModel.getModelChildren().isEmpty()) { switchyardModel.setComposite(compositeModel); } return new ScannerOutput<SwitchYardModel>().setModel(switchyardModel); }
/** * {@inheritDoc} */ @Override public ScannerOutput<SwitchYardModel> scan(ScannerInput<SwitchYardModel> input) throws IOException { SwitchYardNamespace switchyardNamespace = input.getSwitchyardNamespace(); SwitchYardModel switchyardModel = new V1SwitchYardModel(switchyardNamespace.uri()); CompositeModel compositeModel = new V1CompositeModel(); compositeModel.setName(input.getCompositeName()); ClasspathScanner rulesScanner = new ClasspathScanner(_rulesFilter); for (URL url : input.getURLs()) { rulesScanner.scan(url); } List<Class<?>> rulesClasses = _rulesFilter.getMatchedTypes(); for (Class<?> rulesClass : rulesClasses) { compositeModel.addComponent(scan(rulesClass, switchyardNamespace)); } if (!compositeModel.getModelChildren().isEmpty()) { switchyardModel.setComposite(compositeModel); } return new ScannerOutput<SwitchYardModel>().setModel(switchyardModel); }
ScannerOutput<M> scannerOutput = scanner.scan(input); if (scannerOutput != null) { List<M> scanned_list = scannerOutput.getModels(); if (scanned_list != null) { for (M scanned : scanned_list) { config.setAttribute(XMLNS_ATTRIBUTE, xmlns); return new ScannerOutput<M>().setModel(merged);
M model = merge_scanner.scan(scanner_input).getModel(); if (_outputFile == null) { File od = new File(_project_build_outputDirectory, SWITCHYARD_XML_DEFAULT_FOLDER);
/** * Sets the first (and possibly only) Model found/created by the scan. * @param model the Model * @return this ScannerOutput (useful for chaining) */ public synchronized ScannerOutput<M> setModel(M model) { return setModels(Collections.singletonList(model)); }
/** * {@inheritDoc} */ @Override public ScannerOutput<SwitchYardModel> scan(ScannerInput<SwitchYardModel> input) throws IOException { SwitchYardNamespace switchyardNamespace = input.getSwitchyardNamespace(); SwitchYardModel switchyardModel = new V1SwitchYardModel(switchyardNamespace.uri()); CompositeModel compositeModel = new V1CompositeModel(); compositeModel.setName(input.getCompositeName()); ClasspathScanner bpmScanner = new ClasspathScanner(_bpmFilter); for (URL url : input.getURLs()) { bpmScanner.scan(url); } List<Class<?>> bpmClasses = _bpmFilter.getMatchedTypes(); for (Class<?> bpmClass : bpmClasses) { compositeModel.addComponent(scan(bpmClass, switchyardNamespace)); } if (!compositeModel.getModelChildren().isEmpty()) { switchyardModel.setComposite(compositeModel); } return new ScannerOutput<SwitchYardModel>().setModel(switchyardModel); }
@Override public ScannerOutput<M> scan(ScannerInput<M> input) throws IOException { ScannerOutput<M> output = super.scan(input); M model = output.getModel(); if (model != null) { Model root = model.getModelRoot(); if (root instanceof SwitchYardModel) { if (!input.isSwitchyardNamespaceSet()) { String uri = root.getModelRootNamespace(); SwitchYardNamespace ns = SwitchYardNamespace.fromUri(uri); input.setSwitchyardNamespace(ns); } } } return output; } });
return new ScannerOutput<SwitchYardModel>().setModel(switchyardModel);
@Override public ScannerOutput<M> scan(ScannerInput<M> input) throws IOException { ScannerOutput<M> output = super.scan(input); M model = output.getModel(); if (model != null) { Model root = model.getModelRoot(); if (root instanceof SwitchYardModel) { if (!input.isSwitchyardNamespaceSet()) { String uri = root.getModelRootNamespace(); SwitchYardNamespace ns = SwitchYardNamespace.fromUri(uri); input.setSwitchyardNamespace(ns); } } } return output; } });
return new ScannerOutput<SwitchYardModel>().setModel(switchyardModel);
private SwitchYardModel createSwitchYardModel(InputStream configModel, List<Scanner<V1SwitchYardModel>> scanners, boolean validate) { Assert.assertNotNull("Test 'configModel' is null.", configModel); final SwitchYardModel returnModel; try { SwitchYardModel model = loadSwitchYardModel(configModel, false); ClassLoader classLoader = _testInstance.getClass().getClassLoader(); if (scanners != null && !scanners.isEmpty() && classLoader instanceof URLClassLoader) { String uri = model.getModelRootNamespace(); SwitchYardNamespace ns = SwitchYardNamespace.fromUri(uri); MergeScanner<V1SwitchYardModel> merge_scanner = new MergeScanner<V1SwitchYardModel>(true, scanners); List<URL> scanURLs = getScanURLs((URLClassLoader)classLoader); ScannerInput<V1SwitchYardModel> scanner_input = new ScannerInput<V1SwitchYardModel>() .setSwitchyardNamespace(ns).setCompositeName(model.getName()).setURLs(scanURLs); V1SwitchYardModel scannedModel = merge_scanner.scan(scanner_input).getModel(); returnModel = Models.merge(scannedModel, model, false); } else { returnModel = model; } if (validate) { returnModel.assertModelValid(); } return returnModel; } catch (java.io.IOException ioEx) { throw new SwitchYardException("Failed to read switchyard config.", ioEx); } }
return new ScannerOutput<SwitchYardModel>().setModel(switchyardModel);
private SwitchYardModel createSwitchYardModel(InputStream configModel, List<Scanner<V1SwitchYardModel>> scanners, boolean validate) { Assert.assertNotNull("Test 'configModel' is null.", configModel); final SwitchYardModel returnModel; try { SwitchYardModel model = loadSwitchYardModel(configModel, false); ClassLoader classLoader = _testInstance.getClass().getClassLoader(); if (scanners != null && !scanners.isEmpty() && classLoader instanceof URLClassLoader) { String uri = model.getModelRootNamespace(); SwitchYardNamespace ns = SwitchYardNamespace.fromUri(uri); MergeScanner<V1SwitchYardModel> merge_scanner = new MergeScanner<V1SwitchYardModel>(true, scanners); List<URL> scanURLs = getScanURLs((URLClassLoader)classLoader); ScannerInput<V1SwitchYardModel> scanner_input = new ScannerInput<V1SwitchYardModel>() .setSwitchyardNamespace(ns).setCompositeName(model.getName()).setURLs(scanURLs); V1SwitchYardModel scannedModel = merge_scanner.scan(scanner_input).getModel(); returnModel = Models.merge(scannedModel, model, false); } else { returnModel = model; } if (validate) { returnModel.assertModelValid(); } return returnModel; } catch (java.io.IOException ioEx) { throw new SwitchYardException("Failed to read switchyard config.", ioEx); } }
return new ScannerOutput<SwitchYardModel>().setModel(switchyardModel);
return new ScannerOutput<SwitchYardModel>().setModel(switchyardModel);
model = null; return new ScannerOutput<M>().setModel(model);