Package org.switchyard.config.model.switchyard.v1

Examples of org.switchyard.config.model.switchyard.v1.V1SwitchYardMarshaller


                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;
            }
View Full Code Here


     * {@inheritDoc}
     */
    @Override
    public ScannerOutput<SwitchYardModel> scan(ScannerInput<SwitchYardModel> input) throws IOException {
        SwitchYardNamespace switchyardNamespace = input.getSwitchyardNamespace();
        SwitchYardModel switchyardModel = new V1SwitchYardModel(switchyardNamespace.uri());
        ValidatesModel validatesModel = null;

        ValidateNamespace validateNamespace = ValidateNamespace.DEFAULT;
        for (ValidateNamespace value : ValidateNamespace.values()) {
            if (value.versionMatches(switchyardNamespace)) {
                validateNamespace = value;
                break;
            }
        }

        List<Class<?>> validatorClasses = scanForValidators(input.getURLs());
        for (Class<?> validator : validatorClasses) {
            List<ValidatorTypes> supportedValidators = ValidatorUtil.listValidations(validator);

            for (ValidatorTypes supportedValidate : supportedValidators) {
                JavaValidateModel validateModel = new V1JavaValidateModel(validateNamespace.uri());

                String bean = CDIUtil.getNamedAnnotationValue(validator);
                if (bean != null) {
                    validateModel.setBean(bean);
                } else {
                    validateModel.setClazz(validator.getName());
                }
                validateModel.setName(supportedValidate.getName());

                if (validatesModel == null) {
                    validatesModel = new V1ValidatesModel(switchyardNamespace.uri());
                    switchyardModel.setValidates(validatesModel);
                }
                validatesModel.addValidate(validateModel);
            }
        }

View Full Code Here

        _puller = new ModelPuller<SwitchYardModel>();
    }

    @Test
    public void testCreate() throws Exception {
        ThrottlingModel throttling = new V1ThrottlingModel(SwitchYardNamespace.DEFAULT.uri());
        throttling.setMaxRequests(MAX_REQUESTS).setTimePeriod(TIME_PERIOD);

        Assert.assertEquals(MAX_REQUESTS, (Integer) throttling.getMaxRequests());
        Assert.assertEquals(TIME_PERIOD, throttling.getTimePeriod());
    }
View Full Code Here

TOP

Related Classes of org.switchyard.config.model.switchyard.v1.V1SwitchYardMarshaller

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.