Package org.switchyard.common.type.classpath

Examples of org.switchyard.common.type.classpath.ClasspathScanner


                : routeClass.getAnnotation(Route.class).name();
    }

    private List<Class<?>> scanForRoutes(List<URL> urls) throws IOException {
        AbstractTypeFilter filter = new RouteFilter();
        ClasspathScanner scanner = new ClasspathScanner(filter);

        for (URL url : urls) {
            scanner.scan(url);
        }

        return filter.getMatchedTypes();
    }
View Full Code Here


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

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

        PackageFilter pkgFilter = new PackageFilter(input.getIncludePackages().toArray(new Package[0]));
        for (Package pkg : input.getExcludePackages()) {
            pkgFilter.addExclude(pkg);
        }
        CompositeFilter filter = new CompositeFilter(annoFilter, pkgFilter);
        ClasspathScanner serviceScanner = new ClasspathScanner(filter);

        for (URL url : input.getURLs()) {
            serviceScanner.scan(url);
        }

        return filter.getMatchedTypes();
    }
View Full Code Here

        return new ScannerOutput<SwitchYardModel>().setModel(switchyardModel);
    }

    private List<Class<?>> scanForTransformers(List<URL> urls) throws IOException {
        AbstractTypeFilter filter = new TransformerInstanceOfFilter();
        ClasspathScanner scanner = new ClasspathScanner(filter);

        for (URL url : urls) {
            scanner.scan(url);
        }

        return filter.getMatchedTypes();
    }
View Full Code Here

public class ConfigClasspathScanTest {

    @Test
    public void test_folder_scan() throws IOException {
        InstanceOfFilter filter = new InstanceOfFilter(Configuration.class);
        ClasspathScanner scanner = new ClasspathScanner(filter);

        // If running this test inside your IDE... you need to set the cwd to be the
        // root of the config module !!
        scanner.scan(new File("./target/classes").toURI().toURL());
        List<Class<?>> classes = filter.getMatchedTypes();

        Assert.assertTrue(classes.contains(Configuration.class));
        Assert.assertTrue(classes.contains(BaseConfiguration.class));
        Assert.assertTrue(classes.contains(DOMConfiguration.class));
View Full Code Here

        return new ScannerOutput<SwitchYardModel>().setModel(switchyardModel);
    }

    private List<Class<?>> scanForValidators(List<URL> urls) throws IOException {
        AbstractTypeFilter filter = new ValidatorInstanceOfFilter();
        ClasspathScanner scanner = new ClasspathScanner(filter);
        for (URL url : urls) {
            scanner.scan(url);
        }

        return filter.getMatchedTypes();
    }
View Full Code Here

TOP

Related Classes of org.switchyard.common.type.classpath.ClasspathScanner

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.