Package restx.specs

Examples of restx.specs.RestxSpecLoader


            }
        });
    }

    public static List<RestxSpec> findSpecsIn(String location) throws IOException {
        RestxSpecLoader loader = new RestxSpecLoader(Factory.getInstance());

        Set<String> specResources = new ConfigurationBuilder()
                .setUrls(ClasspathHelper.forPackage(location))
                .setScanners(new ResourcesScanner())
                .filterInputsBy(new FilterBuilder().includePackage(location.replace('/','.')))
                .build()
                .getResources(Pattern.compile(".*\\.spec\\.yaml"));

        List<RestxSpec> loaded = Lists.newArrayList();

        for (String specResource : specResources) {
            loaded.add(loader.load(specResource));
        }

        return loaded;
    }
View Full Code Here


    public RunningServer start() throws Exception {
        System.setProperty("restx.mode", RestxContext.Modes.INFINIREST);
        WebServer server = webServerSupplier.newWebServer(port);
        server.start();
        RestxSpecLoader specLoader = new RestxSpecLoader(factory);
        RestxSpecRunner runner = new RestxSpecRunner(specLoader, routerPath, server.getServerId(), server.baseUrl(), factory);
        RestxSpecRepository repository = new HotReloadRestxSpecRepository(specLoader);

        final RunningServer runningServer = new RunningServer(
                server, runner, repository,
View Full Code Here

    }

    @Override
    protected void afterServerCreated() {
        runner = new RestxSpecRunner(
                new RestxSpecLoader(factory), routerPath, server.getServerId(), server.baseUrl(), factory);
    }
View Full Code Here

TOP

Related Classes of restx.specs.RestxSpecLoader

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.