Examples of SwitchYardNamespace


Examples of org.switchyard.config.model.switchyard.SwitchYardNamespace

    /**
     * {@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());

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

        List<Class<?>> serviceClasses = scanForServiceBeans(input);

        for (Class<?> serviceClass : serviceClasses) {
            if (serviceClass.isInterface()) {
                continue;
            }
            if (Modifier.isAbstract(serviceClass.getModifiers())) {
                continue;
            }

            ComponentModel componentModel = new V1ComponentModel();
            ComponentServiceModel serviceModel = new V1ComponentServiceModel(switchyardNamespace.uri());
            String name = serviceClass.getSimpleName();
           
            BeanComponentImplementationModel beanModel = new V1BeanComponentImplementationModel(beanNamespace.uri());
            beanModel.setClazz(serviceClass.getName());
            componentModel.setImplementation(beanModel);
View Full Code Here

Examples of org.switchyard.config.model.switchyard.SwitchYardNamespace

    /**
     * {@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);
View Full Code Here

Examples of org.switchyard.config.model.switchyard.SwitchYardNamespace

    /**
     * {@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);
View Full Code Here

Examples of org.switchyard.config.model.switchyard.SwitchYardNamespace

*/
public class RouteScanner implements Scanner<SwitchYardModel> {

    @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());

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

        List<Class<?>> routeClasses = scanForRoutes(input.getURLs());

        // Create a Camel component model for each class
        for (Class<?> routeClass : routeClasses) {
            // Top-level component definition
            ComponentModel componentModel = new V1ComponentModel();
            componentModel.setName(routeClass.getSimpleName());

            // Component implementation definition
            CamelComponentImplementationModel camelModel = new V1CamelImplementationModel(camelNamespace.uri());
            camelModel.setJavaClass(routeClass.getName());
            componentModel.setImplementation(camelModel);
            compositeModel.addComponent(componentModel);

            // Component service definition
            ComponentServiceModel serviceModel = new V1ComponentServiceModel(switchyardNamespace.uri());
            InterfaceModel csiModel = new V1InterfaceModel(InterfaceModel.JAVA);
            Class<?> serviceInterface = routeClass.getAnnotation(Route.class).value();
            serviceModel.setName(getServiceName(routeClass));
            csiModel.setInterface(serviceInterface.getName());
            serviceModel.setInterface(csiModel);
View Full Code Here

Examples of org.switchyard.config.model.switchyard.SwitchYardNamespace

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

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

        List<Class<?>> transformerClasses = scanForTransformers(input.getURLs());
        for (Class<?> transformer : transformerClasses) {
            List<TransformerTypes> supportedTransforms = TransformerUtil.listTransformations(transformer);

            for (TransformerTypes supportedTransform : supportedTransforms) {
                JavaTransformModel transformModel = new V1JavaTransformModel(transformNamespace.uri());

                String bean = CDIUtil.getNamedAnnotationValue(transformer);
                if (bean != null) {
                    transformModel.setBean(bean);
                } else {
                    transformModel.setClazz(transformer.getName());
                }
                transformModel.setFrom(supportedTransform.getFrom());
                transformModel.setTo(supportedTransform.getTo());

                if (transformsModel == null) {
                    transformsModel = new V1TransformsModel(switchyardNamespace.uri());
                    switchyardModel.setTransforms(transformsModel);
                }
                transformsModel.addTransform(transformModel);
            }
        }
View Full Code Here

Examples of org.switchyard.config.model.switchyard.SwitchYardNamespace

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

Examples of org.switchyard.config.model.switchyard.SwitchYardNamespace

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

Examples of org.switchyard.config.model.switchyard.SwitchYardNamespace

    /**
     * {@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
TOP
Copyright © 2018 www.massapi.com. 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.