Search in sources :

Example 1 with Endpoint

use of org.finos.waltz.web.endpoints.Endpoint in project waltz by khartec.

the class Main method start.

void start() {
    // configure logging
    LoggingUtilities.configureLogging();
    ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    Map<String, Endpoint> endpoints = ctx.getBeansOfType(Endpoint.class);
    endpoints.forEach((name, endpoint) -> {
        LOG.info("Registering Endpoint: {}", name);
        endpoint.register();
    });
    Map<String, DataExtractor> extractors = ctx.getBeansOfType(DataExtractor.class);
    extractors.forEach((name, extractor) -> {
        LOG.info("Registering Extractor: {}", name);
        extractor.register();
    });
    new StaticResourcesEndpoint().register();
    LOG.info("Completed endpoint registration");
    registerExceptionHandlers();
    enableGZIP();
    enableCORS();
}
Also used : StaticResourcesEndpoint(org.finos.waltz.web.endpoints.api.StaticResourcesEndpoint) AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) Endpoint(org.finos.waltz.web.endpoints.Endpoint) StaticResourcesEndpoint(org.finos.waltz.web.endpoints.api.StaticResourcesEndpoint) DIConfiguration(org.finos.waltz.service.DIConfiguration) DataExtractor(org.finos.waltz.web.endpoints.extracts.DataExtractor)

Aggregations

DIConfiguration (org.finos.waltz.service.DIConfiguration)1 Endpoint (org.finos.waltz.web.endpoints.Endpoint)1 StaticResourcesEndpoint (org.finos.waltz.web.endpoints.api.StaticResourcesEndpoint)1 DataExtractor (org.finos.waltz.web.endpoints.extracts.DataExtractor)1 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1